1

在 weblogic 10.3.3 应用服务器上启动和运行屏幕截图 web 服务时遇到了一些问题。我使用 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,一切看起来都很好,但是当我调用我的 web 服务时,我得到:

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 文件的 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 的建议,这些问题真的很累。

4

1 回答 1

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>
于 2012-06-28T03:23:22.310 回答