3 Replies Latest reply on Aug 14, 2008 12:02 AM by Kristof Batizy

    java.lang.NoClassDefFoundError: org/mortbay/jetty/Connector

    Kristof Batizy Newbie

      Trying to use jbossws-cxf-3.0.2.GA to make a real simple ws that is part of an existing war.

      I basically have a context listener that does the following:


       public void contextInitialized(ServletContextEvent arg0) {
       ClockWS clock = new ClockWS();
       JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
       svrFactory.setServiceClass(ClockWS.class);
       svrFactory.setServiceBean(clock);
       svrFactory.getInInterceptors().add(new LoggingInInterceptor());
       svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
       svrFactory.create();
       }
      


      and when I deploy, I get:


      15:38:19,009 ERROR [[/sandbox]] Exception sending context initialized event to listener instance of class com.mim.listeners.context.WebServicePublisher
      java.lang.NoClassDefFoundError: org/mortbay/jetty/Connector
       at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory.createJettyHTTPServerEngine(JettyHTTPServerEngineFactory.java:195)
       at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.retrieveEngine(JettyHTTPDestination.java:107)
       at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.finalizeConfig(JettyHTTPDestination.java:135)
       at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTPTransportFactory.java:123)
       at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTransportFactory.java:103)
       at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90)
       at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:69)
       at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:115)
       at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:160)
       at com.mim.listeners.context.WebServicePublisher.contextInitialized(WebServicePublisher.java:36) ....
      


      I *thought* I followed all the install steps, the test ran without error, etc.

      So, either I'm doing something stupid, or something is broken. Any enlightenment would be greatly appreciated.

        • 2. Re: java.lang.NoClassDefFoundError: org/mortbay/jetty/Connec
          Kristof Batizy Newbie

          Ok, so I made a stupid assumption---putting the cxf jar in my war file's lib cleared it up, but now it chokes on

          
          org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path resource [META-INF/cxf/cxf.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.ClassCastException: class org.w3._2006._05.addressing.wsdl.UsingAddressing
          Caused by:
          org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested exception is java.lang.ClassCastException: class org.w3._2006._05.addressing.wsdl.UsingAddressing
          Caused by:
          java.lang.ClassCastException: class org.w3._2006._05.addressing.wsdl.UsingAddressing
           at java.lang.Class.asSubclass(Class.java:2979)
           at org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:72)
           at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:24
          ...
          


          So, I guess I'm missing something else.

          • 3. Re: java.lang.NoClassDefFoundError: org/mortbay/jetty/Connec
            Kristof Batizy Newbie

            So, I was trying to make this entirely more complicated than it actually is.

            Please ignore everything above. Nothing to see here...move along.