如何在weblogic 10.3.5中调用Metro Web服务? [英] How to invoke metro web services in weblogic 10.3.5?

查看:203
本文介绍了如何在weblogic 10.3.5中调用Metro Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在weblogic服务器上部署了两个Web应用程序(其中的一个是耳文件).其中一个是Web服务应用程序,另一个是Web服务客户端.

I have two web applications (bot of them ear files) deployed on the weblogic server. One of them is a web service application and the other is a web service client.

METRO用于Web服务. Web服务应用程序正在正常运行.

METRO is used for the web services. The web service application is running properly.

当我尝试部署Web服务客户端应用程序时,出现以下错误.

When I try to deploy the web service client application, I am getting the following error.

    <Dec 14, 2011 9:51:25 AM GMT+05:30> <Error> <WLSS.Setup> <BEA-331210> <Skip SIP related logic, because error occurs when parsing sip related annotatio
ns of "DIMeX2"
com.bea.wcp.sip.engine.server.setup.SipAnnotationParsingException:
    at com.bea.wcp.sip.engine.server.setup.SipAnnotationData.<init>(SipAnnotationData.java:146)
    at com.bea.wcp.sip.util.DeploymentUtil.getOrCreateAnnotationData(DeploymentUtil.java:70)
    at com.bea.wcp.sip.util.DeploymentUtil.isSipModule(DeploymentUtil.java:96)
    at com.bea.wcp.sip.engine.server.SipServerTailModule$1.visit(SipServerTailModule.java:127)
    at com.bea.wcp.sip.engine.server.SipServerTailModule.visitAllContexts(SipServerTailModule.java:112)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.IncompatibleClassChangeError: class com.sun.codemodel.writer.FilterCodeWriter has interface com.sun.codemodel.CodeWriter as super
 class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:343)
    Truncated. see log file for complete stacktrace
>
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
<Dec 14, 2011 9:51:26 AM GMT+05:30> <Error> <HTTP> <BEA-101216> <Servlet: "dimex" failed to preload on startup in Web application: "/DIMeX2".
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotati
onHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean w
ith name 'auditLogController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException
: Could not autowire field: com.dimex.services.UserService com.dimex.controllers.AuditLogController.userService; nested exception is org.springframewo
rk.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of resource dependencies failed; nested exception is or
g.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.dimex.services.client.UserServiceWS_Service]: Constructor th
rew exception; nested exception is java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws.spi.ProviderImpl could not
be instantiated: java.lang.ExceptionInInitializerError
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditLogController': Injection of autowired depende
ncies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.dimex.services.UserService co
m.dimex.controllers.AuditLogController.userService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean w
ith name 'userService': Injection of resource dependencies failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not
 instantiate bean class [com.dimex.services.client.UserServiceWS_Service]: Constructor threw exception; nested exception is java.util.ServiceConfigura
tionError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws.spi.ProviderImpl could not be instantiated: java.lang.ExceptionInInitializerError
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProc
essor.java:285)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.dimex.services.UserService com.dimex.controllers.Aud
itLogController.userService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService':
 Injection of resource dependencies failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class
 [com.dimex.services.client.UserServiceWS_Service]: Constructor threw exception; nested exception is java.util.ServiceConfigurationError: javax.xml.ws
.spi.Provider: Provider com.sun.xml.ws.spi.ProviderImpl could not be instantiated: java.lang.ExceptionInInitializerError
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostP
rocessor.java:502)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProc
essor.java:282)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of resource dependencies fa
iled; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.dimex.services.client.UserServic
eWS_Service]: Constructor threw exception; nested exception is java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws
.spi.ProviderImpl could not be instantiated: java.lang.ExceptionInInitializerError
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:3
00)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.dimex.services.client.UserServiceWS_Service]: C
onstructor threw exception; nested exception is java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws.spi.ProviderIm
pl could not be instantiated: java.lang.ExceptionInInitializerError
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$WebServiceRefElement.getResourceToInject(CommonAnnotationBeanPostP
rocessor.java:627)
    at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:147)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
    Truncated. see log file for complete stacktrace
Caused By: java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws.spi.ProviderImpl could not be instantiated: java.la
ng.ExceptionInInitializerError
    at java.util.ServiceLoader.fail(Unknown Source)
    at java.util.ServiceLoader.access$100(Unknown Source)
    at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
    at java.util.ServiceLoader$1.next(Unknown Source)
    at javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Provider.java:146)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
    at java.util.ServiceLoader$1.next(Unknown Source)
    at javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Provider.java:146)
    Truncated. see log file for complete stacktrace
Caused By: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference.
    at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:261)
    at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:257)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:256)
    at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:90)
    Truncated. see log file for complete stacktrace
Caused By: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "address". Use @XmlType.name and @XmlType.namespace to assign different names to them.
    this problem is related to the following location:
        at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address
        at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address com.sun.xml.ws.developer.MemberSubmissionEndpointReferenc
e.addr
        at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
    this problem is related to the following location:
        at javax.xml.ws.wsaddressing.W3CEndpointReference$Address
        at private javax.xml.ws.wsaddressing.W3CEndpointReference$Address javax.xml.ws.wsaddressing.W3CEndpointReference.address
        at javax.xml.ws.wsaddressing.W3CEndpointReference
Two classes have the same XML type name "elements". Use @XmlType.name and @XmlType.namespace to assign different names to them.
    this problem is related to the following location:
        at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements
        at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements com.sun.xml.ws.developer.MemberSubmissionEndpointReferen
ce.referenceProperties
        at com.sun.xml.ws.developer.MemberSubmissionEndpointReference
    this problem is related to the following location:
        at javax.xml.ws.wsaddressing.W3CEndpointReference$Elements
        at private javax.xml.ws.wsaddressing.W3CEndpointReference$Elements javax.xml.ws.wsaddressing.W3CEndpointReference.referenceParameters
        at javax.xml.ws.wsaddressing.W3CEndpointReference

    at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:472)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
    Truncated. see log file for complete stacktrace
>

我无法弄清楚我在做什么,尤其是当我能够正确运行带有METRO的Web服务应用程序时.

I cant figure out what I am doing wrong especially when I am able to run the web service application with METRO in it properly.

我花了好几天没有解决.

I have spent like days on it with no solution.

请帮助.

推荐答案

首先,您拥有

原因:java.lang.IncompatibleClassChangeError:class com.sun.codemodel.writer.FilterCodeWriter具有接口 com.sun.codemodel.CodeWriter作为超类

Caused By: java.lang.IncompatibleClassChangeError: class com.sun.codemodel.writer.FilterCodeWriter has interface com.sun.codemodel.CodeWriter as super class

这似乎在类路径上有同一个库的多个版本.

This looks like you have several versions of the same library on classpath.

com.sun.codemodel属于JAXB.确保JAXB api和实现jar的版本匹配.删除过期的double(如果有)(包括与WebLogic捆绑在一起的JAXB). 还要检查所有jaxb,jax-ws和wsit jar是否与最新的Metro发行版的版本匹配.

com.sun.codemodel belongs to JAXB. Ensure that JAXB api and implementation jars' versions match. Remove obsolete doubles if any (including the JAXB bundled with WebLogic). Also check that all jaxb, jax-ws and wsit jars match the versions of the latest metro release.

这也可以解决下一个异常. 如果没有,请继续.

This can resolve the next exceptions too. If not, continue further.

第二,您具有以下相关的报价单形式的堆栈跟踪:

Secondly you have this relevant quote form stacktrace:

原因:javax.xml.ws.WebServiceException:创建错误 W3CEndpointReference的JAXBContext. 在com.sun.xml.ws.spi.ProviderImpl $ 2.run(ProviderImpl.java:261) 引起原因:com.sun.xml.bind.v2.runtime.IllegalAnnotationsException:2次计数 IllegalAnnotationExceptions两个类具有相同的XML类型名称 地址".使用@ XmlType.name和@ XmlType.namespace为其分配不同的名称. 此问题与以下位置有关: 位于com.sun.xml.ws.developer.MemberSubmissionEndpointReference $ Address 在公共com.sun.xml.ws.developer.MemberSubmissionEndpointReference $ Address com.sun.xml.ws.developer.MemberSubmissionEndpointReference.addr 在com.sun.xml.ws.developer.MemberSubmissionEndpointReference中 此问题与以下位置有关: 在javax.xml.ws.wsaddressing.W3CEndpointReference $ Address 在私有javax.xml.ws.wsaddressing.W3CEndpointReference $ Address处 javax.xml.ws.wsaddressing.W3CEndpointReference.address 在javax.xml.ws.wsaddressing.W3CEndpointReference

Caused By: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference. at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:261) Caused By: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions Two classes have the same XML type name "address". Use @XmlType.name and @XmlType.namespace to assign different names to them. this problem is related to the following location: at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address com.sun.xml.ws.developer.MemberSubmissionEndpointReference.addr at com.sun.xml.ws.developer.MemberSubmissionEndpointReference this problem is related to the following location: at javax.xml.ws.wsaddressing.W3CEndpointReference$Address at private javax.xml.ws.wsaddressing.W3CEndpointReference$Address javax.xml.ws.wsaddressing.W3CEndpointReference.address at javax.xml.ws.wsaddressing.W3CEndpointReference

这意味着这两个类都以某种方式xmlns:samens="http://www.w3.org/2005/08/addressing". 尝试完全删除"http://schemas.xmlsoap.org/ws/2004/08/addressing"的概念.

This means that somehow both classes W3CEndpointReference and MemberSubmissionEndpointReference participate in creation of the same JAXBContext under the same namespace. Actually these classes have different NSes in code as can be seen at the end of the above links. Examine client's wsdl if it has both xmlns:samens="http://schemas.xmlsoap.org/ws/2004/08/addressing" and xmlns:samens="http://www.w3.org/2005/08/addressing". Experiment to remove notion of "http://schemas.xmlsoap.org/ws/2004/08/addressing" at all.

如果没有帮助,则可以使用Metro来源对其进行调试.甚至可能是jaxb或Metro中的错误.

If nothing helps you can debug it with metro sources. It can be even a bug in jaxb or metro.

但更可能的原因是在类路径中偷偷摸摸地发现了一个旧的没有名称空间的JAXB版本.

But more likely the cause is in an old namespace-unaware version of JAXB that sneaked in classpath.

这篇关于如何在weblogic 10.3.5中调用Metro Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆