Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] classnotfoundexception jetty 9 eclipse websocketservlet

Hi

I have been working on this problem all day.
I am trying to write a websocket servlet using eclipse and jetty 9

I downloaded the jetty source and I am using " root/jetty-websocket/websocket-servlet/src/test/java/examples" as the source. 

I have checked the directories, the classes are there.  I see the build path in the classpath. 

How can I get this to work?

web.xml
<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_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>srcWSServlet</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>
  <servlet>
    <servlet-name>MyEchoServlet</servlet-name>
    <servlet-class>examples.MyEchoServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>MyEchoServlet</servlet-name>
    <url-pattern>/echo</url-pattern>
  </servlet-mapping>
</web-app>


Running Jetty 9.0.0.M3
ParentLoaderPriority enabled
Enable config class:runjettyrun.webapp.RJRWebInfConfiguration
Enable config class:org.eclipse.jetty.webapp.WebXmlConfiguration
Enable config class:runjettyrun.webapp.RJRMetaInfoConfiguration
Enable config class:org.eclipse.jetty.webapp.FragmentConfiguration
Enable config class:runjettyrun.annotation.RJRAnnotationConfiguration
Enable config class:org.eclipse.jetty.webapp.JettyWebXmlConfiguration
Enable config class:org.eclipse.jetty.webapp.TagLibConfiguration
ProjectClassLoader: entry=/opt/jetty/lib/websocket/websocket-api-9.0.3.v20130506.jar
ProjectClassLoader: entry=/opt/jetty/lib/servlet-api-3.0.jar
ProjectClassLoader: entry=/opt/jetty/lib/websocket/websocket-servlet-9.0.3.v20130506.jar
ProjectClassLoader: entry=/home/savages/websock/org.eclipse.jetty.project/jetty-websocket/websocket-servlet/src/test/java/examples/build/classes
2013-05-18 20:56:38.972:INFO:oejs.Server:main: jetty-9.0.0.M3
2013-05-18 20:56:39.327:WARN:oejw.DiscoveredAnnotation:main:
java.lang.ClassNotFoundException: examples.MyEchoServlet
    at runjettyrun.ProjectClassLoader.loadClass(ProjectClassLoader.java:94)
    at org.eclipse.jetty.util.Loader.loadClass(Loader.java:101)
    at org.eclipse.jetty.util.Loader.loadClass(Loader.java:80)
    at org.eclipse.jetty.webapp.DiscoveredAnnotation.loadClass(DiscoveredAnnotation.java:82)
    at org.eclipse.jetty.webapp.DiscoveredAnnotation.getTargetClass(DiscoveredAnnotation.java:67)
    at org.eclipse.jetty.annotations.WebServletAnnotation.apply(WebServletAnnotation.java:64)
    at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:377)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1318)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:706)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:485)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:108)
    at org.eclipse.jetty.server.Server.start(Server.java:307)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
    at org.eclipse.jetty.server.Server.doStart(Server.java:274)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
    at runjettyrun.Bootstrap.main(Bootstrap.java:80)
2013-05-18 20:56:39.327:WARN:oeja.WebServletAnnotation:main: examples.MyEchoServlet cannot be loaded
2013-05-18 20:56:39.330:WARN:oejw.DiscoveredAnnotation:main:
java.lang.ClassNotFoundException: examples.MyAdvancedEchoServlet
    at runjettyrun.ProjectClassLoader.loadClass(ProjectClassLoader.java:94)



Back to the top