【问题标题】:Application on tomcat5 fails to starttomcat5 上的应用程序无法启动
【发布时间】:2012-04-05 09:30:52
【问题描述】:

tomcat5 安装在 cent 操作系统上。我的战争文件无法启动。我正在使用 JAX-WS Web 服务。 Catlina.out 显示以下日志

我有以下java版本

java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.6) (rhel-1.25.1.10.6.el5_8-i386)
OpenJDK Server VM (build 20.0-b11, mixed mode)


SEVERE: Exception sending context initialized event to listener instance of class 

com.sun.xml.ws.transport.http.servlet.WSServletContextListener
com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: java.lang.IllegalArgumentException: prefix cannot be "null" when creating a QName


    at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:139)
       at org.apache.catalina.core.StandardContext.listenerStart(catalina-5.5.23.jar.so)
       at org.apache.catalina.core.StandardContext.start(catalina-5.5.23.jar.so)
       at org.apache.catalina.manager.ManagerServlet.start(catalina-manager-5.5.23.jar.so)
       at org.apache.catalina.manager.HTMLManagerServlet.start(catalina-manager-5.5.23.jar.so)
       at org.apache.catalina.manager.HTMLManagerServlet.doGet(catalina-manager-5.5.23.jar.so)
       at javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.23.jar.so)
       at javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.23.jar.so)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(catalina-5.5.23.jar.so)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(catalina-5.5.23.jar.so)
       at org.apache.catalina.core.StandardWrapperValve.invoke(catalina-5.5.23.jar.so)
       at org.apache.catalina.core.StandardContextValve.invoke(catalina-5.5.23.jar.so)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(catalina-5.5.23.jar.so)
       at org.apache.catalina.core.StandardHostValve.invoke(catalina-5.5.23.jar.so)
       at org.apache.catalina.valves.ErrorReportValve.invoke(catalina-5.5.23.jar.so)
       at org.apache.catalina.core.StandardEngineValve.invoke(catalina-5.5.23.jar.so)
       at org.apache.catalina.connector.CoyoteAdapter.service(catalina-5.5.23.jar.so)
       at org.apache.coyote.http11.Http11Processor.process(tomcat-http-5.5.23.jar.so)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(tomcat-http-5.5.23.jar.so)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(tomcat-util-5.5.23.jar.so)
       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(tomcat-util-5.5.23.jar.so)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(tomcat-util-5.5.23.jar.so)
       at java.lang.Thread.run(libgcj.so.7rh)
    Caused by: java.lang.IllegalArgumentException: prefix cannot be "null" when creating a QName
       at javax.xml.namespace.QName.<init>(xml-commons-apis-1.3.02.jar.so)
       at gnu.xml.stream.XMLParser.getAttributeName(libgcj.so.7rh)
       at com.sun.xml.ws.util.xml.XMLStreamReaderFilter.getAttributeName(XMLStreamReaderFilter.java:228)

   at com.sun.xml.ws.streaming.XMLStreamReaderUtil$AttributesImpl.<init>(XMLStreamReaderUtil.java:355)
   at com.sun.xml.ws.streaming.XMLStreamReaderUtil.getAttributes(XMLStreamReaderUtil.java:198)
   at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:204)
   at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
   at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:124)
   ...22 more

请任何人帮助我摆脱这个问题。 web.xml

的内容
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xmlns="http://java.sun.com/xml/ns/javaee" 
         xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee `http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
         id="WebApp_ID" version="2.5">`

<listener>
    <listener-class>
            com.sun.xml.ws.transport.http.servlet.WSServletContextListener
    </listener-class>
</listener>
<servlet>
    <servlet-name>fileserver</servlet-name>
    <servlet-class>
        com.sun.xml.ws.transport.http.servlet.WSServlet
    </servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>fileserver</servlet-name>
    <url-pattern>/fileserver</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>120</session-timeout>
</session-config>

<display-name>FrostBoxServer</display-name>
<welcome-file-list>
   <welcome-file>index.html</welcome-file>
   <welcome-file>index.htm</welcome-file>
   <welcome-file>index.jsp</welcome-file>
   <welcome-file>default.html</welcome-file>
   <welcome-file>default.htm</welcome-file>
   <welcome-file>default.jsp</welcome-file>
 </welcome-file-list>
</web-app>

sun-javax.xml

<?xml version="1.0" encoding="UTF-8"?>
<endpoints
  xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime"
  version="2.0">
  <endpoint
      name="FileService"
      implementation="org.tml.ws.FileServiceImpl"
      url-pattern="/fileserver"/>
</endpoints>

【问题讨论】:

  • 你能发布 web.xml 的内容吗?
  • 已编辑:包含 web.xml 和 sun-javax.xml 的内容
  • @Asghar 您的文件在我看来还不错,您是否按照我在答案中的建议检查了包含在 WEB-INF/lib 目录中的库?
  • @Carlo:所有必需的库都存在于 lib WEB-INF/lib 文件夹中。
  • 模式定位中的“`”字符是错字吗?

标签: java jax-ws tomcat5.5


【解决方案1】:

尝试切换到 sun-jdk 而不是 open-jdk。

【讨论】:

  • 我不认为问题是由 open-jdk 引起的。是吗?
  • 我不能说它是否肯定,但这很可能是原因。请注意下面堆栈跟踪中的 com.sun.xml Caused by: java.lang.IllegalArgumentException: prefix cannot be "null" when creating a QName at javax.xml.namespace.QName.(xml-commons-apis-1.3 .02.jar.so) 在 gnu.xml.stream.XMLParser.getAttributeName(libgcj.so.7rh) 在 com.sun.xml.ws.util.xml.XMLStreamReaderFilter.getAttributeName(XMLStream
【解决方案2】:

根据this:这可能是与缺少库有关的问题。您是否检查过所需的库是否在您的类路径中?

【讨论】:

  • 没有找到。缺少哪些库
【解决方案3】:

将版本更改为 tomcat 7 并将 open-jdk 替换为 sun-jdk。问题已解决。谢谢大家。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-10-02
    • 1970-01-01
    • 1970-01-01
    • 2015-01-04
    • 2021-12-31
    • 1970-01-01
    相关资源
    最近更新 更多