Weblogic 10.3.3与HtmlUnit Spring webservice冲突

时间:2012-04-13 10:22:33

标签: spring exception weblogic conflict htmlunit

在weblogic 10.3.3应用服务器上启动并运行screenscraper webservice时遇到一些麻烦。我正在使用Maven来管理我的构建,HtmlUnit用于我的抓取逻辑,所有内容都通过spring框架连接。这是我开发网络服务的第一次尝试!

我在我的pom.xml中有HtmlUnit作为依赖,因为:

    <dependency>
        <groupId>net.sourceforge.htmlunit</groupId>
        <artifactId>htmlunit</artifactId>
        <version>2.9</version>
        <scope>compile</scope>
    </dependency>

...这是我的spring-ws-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:p="http://www.springframework.org/schema/p" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:sws="http://www.springframework.org/schema/web-services"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">


    <sws:annotation-driven />
        <context:component-scan base-package="com.x.ws"/>

        <bean id="addressLookupConfiguration" class="com.x.ws.z.utils.AddressLookupConfiguration"/>

        <sws:interceptors>
            <bean id="interceptor"
                class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
                <property name="schemas">
                    <list>
                        <value>/WEB-INF/AddressLookup.xsd</value>
                    </list>
                </property>
                <property name="validateRequest" value="true" />
                <property name="validateResponse" value="true" />
            </bean>

            <bean class="org.springframework.ws.soap.security.xwss.XwsSecurityInterceptor">
              <property name="policyConfiguration" value="/WEB-INF/securityPolicy.xml"/>
              <property name="callbackHandlers">
                  <list>
                      <ref bean="callbackHandler"/>
                  </list>
              </property>
          </bean>
        </sws:interceptors>

        <bean id="callbackHandler"
                class="com.x.ws.z.security.AddressLookupValidationCallbackHandler">
                <property name="users">
                    <props>
                        <prop key="x">x</prop>
                        <prop key="x">x</prop>
                        <prop key="x">x</prop>
                    </props>
                </property>
        </bean>
        <sws:dynamic-wsdl id="addressLookup" portTypeName="addressLookup"
            locationUri="http://bob/ws/z/x/addressLookup">
            <sws:xsd location="/WEB-INF/AddressLookup.xsd" />
        </sws:dynamic-wsdl>
</beans>

我可以查看生成的WSDL,一切看起来都很好,但是当我调用我的webservice时,我得到了:

ERROR | 2012-04-12 18:20:01,026 | AddressLookupEndpoint.java:60 | java.lang.NoSuchMethodError: org/apache/commons/lang/StringUtils.startsWithIgnoreCase(Ljava/lang/String;Ljava/lang/String;)Z

当我打电话给它时,我每次都会这样说:

ERROR | 2012-04-12 18:20:25,676 | AddressLookupEndpoint.java:60 | java.lang.NoClassDefFoundError: com/gargoylesoftware/htmlunit/WebClient

不知道为什么我第一次得到NoSuchMethod异常,但很明显weblogic没有找到HtmlUnit jar(我已经在war-file的WEB-INF / lib中确认了它)。

我认为weblogic端上有一些jar冲突,所以我将以下内容添加到我的应用程序weblogic.xml

<wls:container-descriptor>
    <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>

但是,当我部署应用程序时,无法正确创建WSDL。抛出以下异常:

ERROR | 2012-04-12 18:03:46,484 | FrameworkServlet.java:314 | Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSoapEndpointInterceptor#0': Cannot create inner bean 'interceptor' of type [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'interceptor' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is org.springframework.xml.validation.XmlValidationException: Could not create Schema: SAX2 driver class weblogic.xml.jaxp.RegistryXMLReader does not implement XMLReader; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
<trunc>
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSoapEndpointInterceptor#0': Cannot create inner bean 'interceptor' of type [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'interceptor' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is org.springframework.xml.validation.XmlValidationException: Could not create Schema: SAX2 driver class weblogic.xml.jaxp.RegistryXMLReader does not implement XMLReader; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
<trunc>
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
        ... 9 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'interceptor' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is org.springframework.xml.validation.XmlValidationException: Could not create Schema: SAX2 driver class weblogic.xml.jaxp.RegistryXMLReader does not implement XMLReader; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
        ... 56 more
Caused by: org.springframework.xml.validation.XmlValidationException: Could not create Schema: SAX2 driver class weblogic.xml.jaxp.RegistryXMLReader does not implement XMLReader; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
        at org.springframework.xml.validation.Jaxp13ValidatorFactory.createValidator(Jaxp13ValidatorFactory.java:45)
        at org.springframework.xml.validation.XmlValidatorFactory.createValidator(XmlValidatorFactory.java:92)
<trunc>
        ... 9 more
Caused by: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
        at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
        at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
        at org.springframework.xml.validation.SchemaLoaderUtils.loadSchema(SchemaLoaderUtils.java:70)
        at org.springframework.xml.validation.Jaxp13ValidatorFactory.createValidator(Jaxp13ValidatorFactory.java:41)
        ... 63 more
<Apr 12, 2012 6:03:46 PM IST> <Error> <HTTP> <BEA-101017> <[ServletContext@135824637[app:nieAddressLookup module:nieAddressLookup.war path:/ws/nieaddresslookup/v1 spec-version:null]] Root cause of ServletException.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSoapEndpointInterceptor#0': Cannot create inner bean 'interceptor' of type [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'interceptor' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is org.springframework.xml.validation.XmlValidationException: Could not create Schema: SAX2 driver class weblogic.xml.jaxp.RegistryXMLReader does not implement XMLReader; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
        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 'org.springframework.ws.soap.server.endpoint.interceptor.DelegatingSmartSoapEndpointInterceptor#0': Cannot create inner bean 'interceptor' of type [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'interceptor' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is org.springframework.xml.validation.XmlValidationException: Could not create Schema: SAX2 driver class weblogic.xml.jaxp.RegistryXMLReader does not implement XMLReader; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
        Truncated. see log file for complete stacktrace

Caused By: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'interceptor' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Invocation of init method failed; nested exception is org.springframework.xml.validation.XmlValidationException: Could not create Schema: SAX2 driver class weblogic.xml.jaxp.RegistryXMLReader does not implement XMLReader; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
        Truncated. see log file for complete stacktrace

Caused By: org.springframework.xml.validation.XmlValidationException: Could not create Schema: SAX2 driver class weblogic.xml.jaxp.RegistryXMLReader does not implement XMLReader; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
        at org.springframework.xml.validation.Jaxp13ValidatorFactory.createValidator(Jaxp13ValidatorFactory.java:45)
        at org.springframework.xml.validation.XmlValidatorFactory.createValidator(XmlValidatorFactory.java:92)
        at org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor.afterPropertiesSet(AbstractValidatingInterceptor.java:153)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
        Truncated. see log file for complete stacktrace

Caused By: java.lang.ClassCastException: org.apache.xerces.jaxp.SAXParserFactoryImpl
        at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
        at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
        at org.springframework.xml.validation.SchemaLoaderUtils.loadSchema(SchemaLoaderUtils.java:70)
        at org.springframework.xml.validation.Jaxp13ValidatorFactory.createValidator(Jaxp13ValidatorFactory.java:41)
        at org.springframework.xml.validation.XmlValidatorFactory.createValidator(XmlValidatorFactory.java:92)
        Truncated. see log file for complete stacktrace
>

我的应用程序中的jar似乎与weblogic xml解析器冲突。我从构建中删除了xmlParserAPIs jar并重新部署。现在我得到以下异常:

ERROR | 2012-04-13 11:10:51,316 | FrameworkServlet.java:314 | Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring-ws-servlet.xml]; nested exception is java.lang.NoClassDefFoundError: javax/xml/namespace/QName
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:468)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
        at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
        at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
        at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:129)
        at javax.servlet.GenericServlet.init(GenericServlet.java:242)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
        at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
        at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
        at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:243)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3686)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.lang.NoClassDefFoundError: javax/xml/namespace/QName
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:328)
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:285)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:253)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:56)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:42)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.reset(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.configurePipeline(Unknown Source)
        at org.apache.xerces.parsers.XIncludeAwareParserConfiguration.configurePipeline(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
        at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
        at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
        at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
        at javax.servlet.GenericServlet.init(GenericServlet.java:241)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
        at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
        at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
        at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:243)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
        ... 9 more
<Apr 13, 2012 11:10:51 AM IST> <Error> <HTTP> <BEA-101017> <[ServletContext@135546353[app:nieAddressLookup module:nieAddressLookup.war path:/ws/nieaddresslookup/v1 spec-version:null]] Root cause of ServletException.
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring-ws-servlet.xml]; nested exception is java.lang.NoClassDefFoundError: javax/xml/namespace/QName
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
        Truncated. see log file for complete stacktrace

Caused By: java.lang.NoClassDefFoundError: javax/xml/namespace/QName
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:328)
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:285)
        Truncated. see log file for complete stacktrace

我无法看到weblogic无法找到QName。 weblogic框是我们生产的一个镜像,我们有很多其他web服务正常运行,所以应该正确配置。

我很感激有关如何让weblogic看到HtmlUnit jar的一些建议,这些问题真的让人筋疲力尽。

1 个答案:

答案 0 :(得分:3)

WL 10.3.3引入了.war的weblogic.xml文件中prefer-application-packages的使用,而不仅仅是在.ear的weblogic-application.xml中。

以下内容应该有助于找不到问题的方法。

<container-descriptor>
  <prefer-application-packages>
    <package-name>org.apache.commons.lang.*</package-name>
  </prefer-application-packages>
</container-descriptor>