2 Replies Latest reply on Sep 1, 2012 4:20 AM by Markus Michaels

    Error running errai-project with built-in jetty from eclipse

    Markus Michaels Newbie

      Hello,

       

      i want to run/debug my errai project within eclipse/embedded jetty. I have read some threads and have adjusted my web.xml as described as well as provided a jetty-env.xml (I have provided the contents of my web.xml and jetty-xml on the end of this posting). The beans.xml is also present.

       

      However, when starting up the web application i get this following exception:

       

      Starting Jetty on port 8888

         [WARN] Config error at <New id="BeanManager" class="org.mortbay.jetty.plus.naming.Resource"><Arg><Ref id="sample-weld"/></Arg><Arg>BeanManager</Arg><Arg>

                  <New class="javax.naming.Reference"><Arg>javax.enterprise.inject.spi.BeanManager</Arg><Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg><Arg/></New>

              </Arg></New>

         [WARN] Failed startup of context org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload@58a6af{/,C:\Dokumente und Einstellungen\test\workspace\MySample\target}

      java.lang.IllegalStateException: No Constructor: <New id="BeanManager" class="org.mortbay.jetty.plus.naming.Resource"><Arg><Ref id="sample-weld"/></Arg><Arg>BeanManager</Arg><Arg>

                  <New class="javax.naming.Reference"><Arg>javax.enterprise.inject.spi.BeanManager</Arg><Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg><Arg/></New>

              </Arg></New> on org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload@58a6af{/,C:\Dokumente und Einstellungen\test\workspace\MySample\target}

                at org.mortbay.xml.XmlConfiguration.newObj(XmlConfiguration.java:623)

                at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:248)

                at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:182)

                at org.mortbay.jetty.plus.webapp.EnvConfiguration.configureWebApp(EnvConfiguration.java:132)

                at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1217)

                at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)

                at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)

                at org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:486)

                at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

                at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

                at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)

                at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

                at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

                at org.mortbay.jetty.Server.doStart(Server.java:222)

                at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)

                at org.jboss.errai.cdi.server.gwt.JettyLauncher.start(JettyLauncher.java:692)

                at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)

                at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)

                at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)

                at com.google.gwt.dev.DevMode.main(DevMode.java:311)

       

      jetty-env.xml:

      <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
              "http://jetty.mortbay.org/configure.dtd">
      
      
      <Configure id="sample-weld" class="org.mortbay.jetty.webapp.WebAppContext">
      
      
                <Array id="plusConfig" type="java.lang.String">
                          <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
                          <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
                          <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>
                          <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
                </Array>
      
      
                <New id="BeanManager" class="org.mortbay.jetty.plus.naming.Resource">
                          <Arg>
                                    <Ref id="sample-weld" />
                          </Arg>
                          <Arg>BeanManager</Arg>
                          <Arg>
                                    <New class="javax.naming.Reference">
                                              <Arg>javax.enterprise.inject.spi.BeanManager</Arg>
                                              <Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg>
                                              <Arg />
                                    </New>
                          </Arg>
                </New>
      
      
                <New id="Errai" class="org.mortbay.jetty.plus.naming.Resource">
                          <Arg>
                                    <Ref id="sample-weld" />
                          </Arg>
                          <Arg>ErraiService</Arg>
                          <Arg>
                                    <New class="javax.naming.Reference">
                                              <Arg>org.jboss.errai.bus.server.service.ErraiService</Arg>
                                              <Arg>org.jboss.errai.container.ErraiServiceObjectFactory</Arg>
                                              <Arg />
                                    </New>
                          </Arg>
                </New>
      </Configure>
      
      

       

       

      web.xml:

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
           version="3.0">
      
      
           <servlet>
               <servlet-name>ErraiServlet</servlet-name>
               <servlet-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</servlet-class>
               <load-on-startup>1</load-on-startup>
           </servlet>
      
      
           <servlet-mapping>
               <servlet-name>ErraiServlet</servlet-name>
               <url-pattern>*.erraiBus</url-pattern>
           </servlet-mapping>
      
      
           <listener>
               <!-- NOTE: The orig servlet listener has been patched, until a solution 
                     to the bean validation problems in hosted mode is found. <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class> -->
      
      
               <listener-class>org.jboss.errai.container.CDIServletStateListener</listener-class>
           </listener>
      
      
           <resource-env-ref>
               <description>Object factory for the CDI Bean Manager</description>
               <resource-env-ref-name>BeanManager</resource-env-ref-name>
               <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
           </resource-env-ref>
      
      
           <resource-env-ref>
               <description>Object factory for the Errai Service</description>
               <resource-env-ref-name>ErraiService</resource-env-ref-name>
               <resource-env-ref-type>org.jboss.errai.bus.server.service.ErraiService</resource-env-ref-type>
           </resource-env-ref>
      
      
      
      
      </web-app>
      
      

       

      Would be glad if someone could help me... This one problem is going to make me mad since a whole day now.

       

      Regards,

      Markus_Michael