weblogic.descriptor.DescriptorException: Unmarshaller failed
2015-07-16 20:32
603 查看
问题描述
通过weblogic生成的webservice客户端client.jar,在导入到工程中运行时,发生报错。错误信息:java.lang.Exception: Failed to load weblogic client internal deployment descriptor. weblogic.descriptor.DescriptorException: Unmarshaller failed
原因分析
上述报错中提到的“internal deployment descriptor”是什么东西?打开客户端的jar,发现有个xml文件,名字是internaldd.xml,再看xml的内容,定义了service-ref节点,内部确定了服务名、接口类名、wsdl文件名及mapping文件。很明显,加载失败的weblogic客户端内部发布描述文件,看来说的就是这个文件。jar包内的CoreDataInterfaceService_Service_internaldd.xml内容:
<?xml version='1.0' encoding='UTF-8'?> <weblogic-wsee-standaloneclient xmlns="http://xmlns.oracle.com/weblogic/weblogic-wsee-standaloneclient" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-wsee-standaloneclient http://xmlns.oracle.com/weblogic/weblogic-wsee-standaloneclient/1.0/weblogic-wsee-standaloneclient.xsd"> <service-ref> <j2ee:service-ref-name xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">unused information</j2ee:service-ref-name> <j2ee:service-interface xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">com.wss.coredatainterfaceservice.CoreDataInterfaceService_Service</j2ee:service-interface> <j2ee:wsdl-file xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">com/wss/coredatainterfaceservice/CoreDataInterfaceService_Service_saved_wsdl.wsdl</j2ee:wsdl-file> <j2ee:jaxrpc-mapping-file xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">com/wss/coredatainterfaceservice/CoreDataInterfaceService_Service_java_wsdl_mapping.xml</j2ee:jaxrpc-mapping-file> <j2ee:service-qname xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:cor="http://wss.com/CoreDataInterfaceService/">cor:CoreDataInterfaceService</j2ee:service-qname> </service-ref> </weblogic-wsee-standaloneclient>
为什么这个文件会加载失败呢?Unmarshaller又是个什么东西?
Marshaller和Unmarshaller是JAXB(Java Architecture for XML Binding)中定义的一组接口,分别实现Java对象(内容树)到XML的转换和逆向转换。而在weblogic.jar中,weblogic自己实现了Marshaller和Unmarshaller类似功能。当发生版本、命名空间不一致时,将会抛出DescriptorException。
解决方法
比对了weblogic的命名空间与client.jar的命名空间,将~internaldd.xml中的xmlns更改为:<weblogic-wsee-standaloneclient xmlns="http://www.bea.com/ns/weblogic/weblogic-wsee-standaloneclient" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-wsee-standaloneclient http://www.bea.com/ns/weblogic/weblogic-wsee-standaloneclient/1.0/weblogic-wsee-standaloneclient.xsd">[/code]
调整前的xmlns=”http://xmlns.oracle.com/…”
调整后的xmlns=”http://www.bea.com/ns/…”
更新后,重新启动应用,发现运行正常。结论
1、weblogic功能强大,同时,其jar包含了太多零乱的功能。在使用时,需要注意配置weblogic的相关xml的版本号、等信息与使用到的weblogic.jar相适应。但是其内部验证的具体机制还不清楚。
2、如果用weblogic某个版本生成webservice client,则在引入并使用该client的project中,最好使用相同版本的weblogic.jar。参考信息
stackoverflow.com上的类似问题:weblogic.descriptor.DescriptorException: Unmarshaller failed
weblogic常见错误
相关文章推荐
- LeetCode#219 Contains Duplicate II
- Codeforces Round #289 (Div. 2, ACM ICPC Rules)——B贪心——Painting Pebbles
- Captain_kunkka
- Ubuntu 14.04 SSH bug for “Agent admitted failure to sign using the key”
- 开源蘑菇街TeamTalk报make db_proxy_server failed,信息分析
- Allocation Failure
- ORA-27054 NFS问题解决 AIX 挂载NFS文件
- poj 2904 The Mailboxes Manufacturers Problem( 区间dp)
- Container ViewController初探1
- init engine failure
- Map containsKey用法
- Contains Duplicate III -leetcode
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- 增加samba用户提示Failed to add entry for user
- AIX系统中使用bsdlog函数输出内核信息
- 阻塞socket上read/write出现errno为EAGAIN的原因解密
- LeetCode#217 Contains Duplicate
- Achieving High Availability and Scalability - ARR and NLB
- 解决Xcode的MainStoryboard对齐不正确的问题
- Error : APP-FND-01926: The custom event WHEN-LOGON-CHANGED raised unhandled exception: ORA-06502: PL