【问题标题】:Problem adding <listener> to web.xml in eclipse在 Eclipse 中将 <listener> 添加到 web.xml 时出现问题
【发布时间】:2010-01-13 14:45:18
【问题描述】:

我将 Eclipse 与 Websphere 服务器一起使用。

我需要添加一个会话监听器。我在包 net.test 中添加了类 SessionListener.java 。当我将 标签添加到 web.xml 文件时,我收到以下错误:

Distribution of configuration failed.  See log for details.
  Error unmarshaling return; nested exception is: 
    java.net.MalformedURLException: no protocol: Files/IBM/WebSphere/AppServerCommunityEdition/repository/org/apache/geronimo/modules/geronimo-common/2.0.1/geronimo-common-2.0.1.jar
  java.rmi.UnmarshalException: Error unmarshaling return; nested exception is: 
    java.net.MalformedURLException: no protocol: Files/IBM/WebSphere/AppServerCommunityEdition/repository/org/apache/geronimo/modules/geronimo-common/2.0.1/geronimo-common-2.0.1.jar
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:141)
    at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(RMIConnectionImpl_Stub.java:400)
    at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:984)
    at org.apache.geronimo.system.jmx.KernelDelegate.invokeKernel(KernelDelegate.java:890)
    at org.apache.geronimo.system.jmx.KernelDelegate.invoke(KernelDelegate.java:551)
    at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
    at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
    at java.lang.Thread.run(Thread.java:810)
  Caused by: java.net.MalformedURLException: no protocol: Files/IBM/WebSphere/AppServerCommunityEdition/repository/org/apache/geronimo/modules/geronimo-common/2.0.1/geronimo-common-2.0.1.jar
    at java.net.URL.<init>(URL.java:602)
    at java.net.URL.<init>(URL.java:499)
    at java.net.URL.<init>(URL.java:448)
    at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:762)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:162)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:632)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:259)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:212)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1568)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1490)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1723)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1932)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1856)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1743)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:363)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:231)
    ... 9 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">
  <display-name>odyssey</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>
  <listener>
        <listener-class>net.testt.SessionListener</listener-class>
    </listener>  

</web-app>

当我删除标签时,一切正常...请帮助...我真的需要那个监听器进行清理工作以跟踪当前的在线用户...

【问题讨论】:

    标签: eclipse jsp websphere listener


    【解决方案1】:

    这是 WASCE 中的一个(讨厌的)错误。应该是"file:///C:/Program Files/IBM/...."file:// 是由于Program Files 中的空格而丢失的协议。 IBM 的人应该引用路径名,但他们显然忽略了它。

    要解决此问题,请将 WASCE 安装在没有空格的路径中,或者升级到可用的最新版本。

    【讨论】:

    • 哈哈.. 有趣。但它与听众有什么关系?
    • 它显然(在)直接需要一些来自 geronimo-common JAR 文件的东西。
    • 这是仪式..路径是c:/program files/ibm ..在c:/安装wasce后错误消失..thnx BalusC
    猜你喜欢
    • 2011-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-08
    • 2019-07-09
    相关资源
    最近更新 更多