12 Replies Latest reply on Jul 21, 2011 4:05 AM by hantsy bai

    Problem in Weld and Seam 3 in Tomcat 6

    hantsy bai Master

      I create a serlvet based project from the weld servlet archetype.
      And updated the dependencies to the latest version(weld 1.1.1Final), it works well.
      But when I tried to added the Seam3 dependencies, and run application via mvn tomcat:run, I encountered a exception.



      严重: Exception sending context initialized event to listener instance of class
      org.jboss.weld.environment.servlet.Listener
      java.lang.RuntimeException: Error instantiating class org.jboss.seam.xml.bootstr
      ap.XmlExtension
              at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:
      282)
              at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:238)
      
              at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java:
      194)
              at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:157)
              at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:346)
              at org.jboss.weld.bootstrap.ExtensionBeanDeployer.addExtensions(Extensio
      nBeanDeployer.java:93)
              at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootst
      rap.java:340)
              at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listen
      er.java:170)
              at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
      t.java:4135)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
      630)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      
              at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      
              at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445
      )
              at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
              at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMo
      jo.java:558)
              at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
      :255)
              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
      BuildPluginManager.java:101)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
      .java:209)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
      .java:153)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor




      but when I remove the weld listener in web.xml, and browsed the home page, and another exception in the page.



      java.lang.IllegalStateException: Singleton is not set
           at org.jboss.weld.bootstrap.api.helpers.IsolatedStaticSingletonProvider$IsolatedStaticSingleton.get(IsolatedStaticSingletonProvider.java:52)
           at org.jboss.weld.Container.instance(Container.java:58)
           at org.jboss.weld.jsf.WeldPhaseListener.instance(WeldPhaseListener.java:145)
           at org.jboss.weld.jsf.WeldPhaseListener.activateConversations(WeldPhaseListener.java:102)
           at org.jboss.weld.jsf.WeldPhaseListener.beforePhase(WeldPhaseListener.java:84)
           at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at com.dna.bifincan.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:28)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
           at java.lang.Thread.run(Thread.java:662)



      Some of my configuration.
      web.xml



      <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
          </servlet>
      
         <!-- Tell the context which URLs to process with JSF -->
          <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.jsf</url-pattern>
          </servlet-mapping>
      
      
         <!-- This section is optional. We are allowing index.jsf to handle the root URL (i.e., /). -->
          <welcome-file-list>
              <!-- Add additional files here, if desired, for example: <welcome-file>index.html</welcome-file> -->
              <welcome-file>index.jsf</welcome-file>
          </welcome-file-list>
      
       
      
          <listener>
              <listener-class>org.jboss.weld.environment.servlet.Listener</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>




      And beans.xml content



      <beans xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:s="urn:java:ee"
         xmlns:t="urn:java:org.jboss.seam.transaction"
         xsi:schemaLocation="
            http://java.sun.com/xml/ns/javaee
            http://docs.jboss.org/cdi/beans_1_0.xsd">
          <interceptors>
              <class>org.jboss.seam.transaction.TransactionInterceptor</class>
          </interceptors>
          <t:SeSynchronizations>
              <s:modifies/>
          </t:SeSynchronizations>
          <t:EntityTransaction>
              <s:modifies />
          </t:EntityTransaction>
      </beans>
      


      And the seam3 dependencies added in pom.



      <!-- Seam 3 Persistence-->
              <dependency>
                  <groupId>org.jboss.seam.persistence</groupId>
                  <artifactId>seam-persistence-api</artifactId>
                  <version>${seam.persistence.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.jboss.seam.persistence</groupId>
                  <artifactId>seam-persistence-impl</artifactId>
                  <version>${seam.persistence.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.jboss.seam.solder</groupId>
                  <artifactId>seam-solder</artifactId>
                  <version>${seam.solder.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.jboss.seam.xml</groupId>
                  <artifactId>seam-xml-config</artifactId>
                  <version>${seam.xml.version}</version>
              </dependency>




      How to overcome the barrier? Thanks.









        • 1. Re: Problem in Weld and Seam 3 in Tomcat 6
          Jason Porter Master

          Was there more to the stack trace in your first exception? Also, do you have this problem with Tomcat 7? The configuration should work, but it is better to split up configuration in beans.xml (core CDI configuration for interceptors and alternatives, etc) with seam-beans.xml (seam3 configuration).

          • 2. Re: Problem in Weld and Seam 3 in Tomcat 6
            hantsy bai Master

            Jason Porter wrote on Jul 19, 2011 01:42:


            Was there more to the stack trace in your first exception?


            I added weld-extension in pom as dependency...and anther exception was occurred.




            严重: Exception sending context initialized event to listener instance of class
            org.jboss.weld.environment.servlet.Listener
            org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
            
            Exception 0 :
            java.lang.IllegalStateException: Both Weld Extensions and Seam Solder libraries
            detected on the classpath. If you're migrating to Seam Solder, please remove Wel
            d Extensions from the deployment.
                    at org.jboss.seam.solder.core.CoreExtension.failIfWeldExtensionsDetected
            (CoreExtension.java:251)
                    at org.jboss.seam.solder.core.CoreExtension.afterBeanDiscovery(CoreExten
            sion.java:238)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
            java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflec
            tions.java:305)
                    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureRefle
            ctionAccess.java:54)
                    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation
            (SecureReflectionAccess.java:163)
                    at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflect
            ions.java:299)
                    at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldM
            ethodImpl.java:188)
                    at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(For
            wardingWeldMethod.java:59)
                    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpe
            cialValue(MethodInjectionPoint.java:198)
                    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.
            java:282)
                    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.
            java:265)
                    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.jav
            a:234)
                    at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractC
            ontainerEvent.java:88)
                    at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire
            (AbstractDefinitionContainerEvent.java:52)
                    at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBean
            DiscoveryImpl.java:43)
                    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java
            :372)
                    at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listen
            er.java:205)
                    at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
            t.java:4135)
                    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
            630)
                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
            
                    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
            
                    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445
            )
                    at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
                    at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMo
            jo.java:558)
                    at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
            :255)
                    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
            BuildPluginManager.java:101)
                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
            .java:209)
                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
            .java:153)
                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
            .java:145)
                    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
            ct(LifecycleModuleBuilder.java:84)
                    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
            ct(LifecycleModuleBuilder.java:59)
                    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
            ild(LifecycleStarter.java:183)
                    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
            eStarter.java:161)
                    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
                    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
                    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
                    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
                    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
            java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
            cher.java:290)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
            a:230)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
            uncher.java:409)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
            352)
            
                    at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire
            (AbstractDefinitionContainerEvent.java:55)
                    at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBean
            DiscoveryImpl.java:43)
                    at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java
            :372)
                    at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listen
            er.java:205)
                    at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
            t.java:4135)
                    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
            630)
                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
            
                    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
            
                    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445
            )
                    at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
                    at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMo
            jo.java:558)
                    at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
            :255)
                    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
            BuildPluginManager.java:101)
                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
            .java:209)
                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
            .java:153)
                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
            .java:145)
                    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
            ct(LifecycleModuleBuilder.java:84)
                    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
            ct(LifecycleModuleBuilder.java:59)
                    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
            ild(LifecycleStarter.java:183)
                    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
            eStarter.java:161)
                    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
                    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
                    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
                    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
                    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
            java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
            cher.java:290)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
            a:230)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
            uncher.java:409)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
            352)
            




            But if i removed weld-extension, and got




            严重: Exception sending context initialized event to listener instance of cla
            org.jboss.weld.environment.servlet.Listener
            java.lang.RuntimeException: Error instantiating class org.jboss.seam.xml.boot
            ap.XmlExtension
                    at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.ja
            282)
                    at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:2
            
                    at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.ja
            194)
                    at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:157)
                    at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:346)
                    at org.jboss.weld.bootstrap.ExtensionBeanDeployer.addExtensions(Exten
            nBeanDeployer.java:93)
                    at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBoo
            rap.java:340)
                    at org.jboss.weld.environment.servlet.Listener.contextInitialized(Lis
            er.java:170)
                    at org.apache.catalina.core.StandardContext.listenerStart(StandardCon
            t.java:4135)
                    at org.apache.catalina.core.StandardContext.start(StandardContext.jav
            630)
                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:10
            
                    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:10
            
                    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
            )
                    at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
                    at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRu
            jo.java:558)
                    at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.j
            :255)
                    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Defa
            BuildPluginManager.java:101)
                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecu
            .java:209)
                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecu
            .java:153)
                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecu
            .java:145)
                    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildPr
            ct(LifecycleModuleBuilder.java:84)
                    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildPr
            ct(LifecycleModuleBuilder.java:59)
                    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreade
            ild(LifecycleStarter.java:183)
                    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifec
            eStarter.java:161)
                    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
                    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
                    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
                    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
                    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorIm
            java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
            sorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(L
            cher.java:290)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.
            a:230)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
            uncher.java:409)
                    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.ja
            352)
            Caused by: java.lang.NoClassDefFoundError: org/jboss/weld/extensions/reflecti
            AnnotationInstanceProvider
                    at org.jboss.seam.xml.bootstrap.XmlExtension.<init>(XmlExtension.java
            )
                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Meth
            
                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstr
            orAccessorImpl.java:39)
                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegati
            onstructorAccessorImpl.java:27)
                    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                    at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.ja
            273)
                    ... 37 more
            Caused by: java.lang.ClassNotFoundException: org.jboss.weld.extensions.reflec
            n.AnnotationInstanceProvider
                    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClass
            der.java:1645)
                    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClass
            der.java:1491)
                    ... 43 more





            Some of my maven dependencies.



                <version.weld-servlet>1.1.1.Final</version.weld-servlet>
                    <version.arquillian>1.0.0.Alpha5</version.arquillian>
                    <version.mojarra>2.1.2</version.mojarra>
                    <seam.persistence.version>3.0.0.Final</seam.persistence.version>
                    <seam.solder.version>3.0.0.Final</seam.solder.version>
                    <seam.xml.version>3.0.0.Beta1</seam.xml.version>
                    <seam.servlet.version>3.0.0.Final</seam.servlet.version>



            How to fix the problem? Is this somewhere version incompitible?


            Thanks


            • 3. Re: Problem in Weld and Seam 3 in Tomcat 6
              Jason Porter Master

              Use the final version of Seam Xml: 3.0.0.Final


              You could also try not deploying from maven after you have the dependencies correct, see if it changes anything.

              • 4. Re: Problem in Weld and Seam 3 in Tomcat 6
                hantsy bai Master

                Oh, the config xml artifact id and group id were changed.


                I had updated and tried, but unluckily it still does not work.


                I remove the Seam servlet configurtion( the doc was not updated, several erros in the document, some classes can not be found).


                I have tried to run on tomcat 7 in NetBeans IDE, and get the following error info in the console windows.




                Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener
                java.lang.RuntimeException: Error instantiating class org.jboss.seam.xml.bootstrap.XmlExtension
                     at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:282)
                     at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:238)
                     at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java:194)
                     at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:157)
                     at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:346)
                     at org.jboss.weld.bootstrap.ExtensionBeanDeployer.addExtensions(ExtensionBeanDeployer.java:93)
                     at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:340)
                     at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:170)
                     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
                     at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
                     at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
                     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
                     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
                     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                     at java.lang.Thread.run(Thread.java:662)
                Caused by: java.lang.NoClassDefFoundError: org/jboss/weld/extensions/reflection/AnnotationInstanceProvider
                     at org.jboss.seam.xml.bootstrap.XmlExtension.<init>(XmlExtension.java:64)
                     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                     at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:273)
                     ... 15 more
                Caused by: java.lang.ClassNotFoundException: org.jboss.weld.extensions.reflection.AnnotationInstanceProvider
                     at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
                     at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
                     ... 21 more



                • 5. Re: Problem in Weld and Seam 3 in Tomcat 6
                  hantsy bai Master

                  Other exceptions when remove some seam dependencies in pom...It seems it is close to make it run on Tomcat.



                  2011-07-20 11:10:59,356 DEBUG org.jboss.seam.persistence.HibernatePersistencePr
                  vider - no Hibernate Search
                  java.lang.ClassNotFoundException: Could not load class org.hibernate.search.Ver
                  ion with the context class loader WebappClassLoader
                    context: /bifincan
                    delegate: false
                    repositories:
                  ----------> Parent Classloader:
                  ClassRealm[plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1, parent: sun.misc.L
                  uncher$AppClassLoader@19821f]
                   or any of the additional ClassLoaders: []
                          at org.jboss.seam.solder.reflection.Reflections.classForName(Reflection
                  .java:386)
                          at org.jboss.seam.persistence.HibernatePersistenceProvider.<clinit>(Hib
                  rnatePersistenceProvider.java:60)
                          at org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtensio
                  Impl.<clinit>(HibernateManagedSessionExtensionImpl.java:65)
                          at org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtensio
                  .<init>(HibernateManagedSessionExtension.java:51)
                          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method
                  
                          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruc
                  orAccessorImpl.java:39)
                          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegating
                  onstructorAccessorImpl.java:27)
                          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                          at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java
                  273)
                          at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:238
                  
                          at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java
                  194)
                          at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:157)
                          at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:346)
                          at org.jboss.weld.bootstrap.ExtensionBeanDeployer.addExtensions(Extensi
                  nBeanDeployer.java:93)
                          at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBoots
                  rap.java:340)
                          at org.jboss.weld.environment.servlet.Listener.contextInitialized(Liste
                  er.java:170)
                          at org.apache.catalina.core.StandardContext.listenerStart(StandardConte
                  t.java:4135)
                          at org.apache.catalina.core.StandardContext.start(StandardContext.java:
                  630)
                          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045
                  
                          at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
                          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045
                  
                          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:44
                  )
                          at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
                          at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunM
                  jo.java:558)
                          at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.jav
                  :255)
                          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Defaul
                  BuildPluginManager.java:101)
                          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                  .java:209)
                          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                  .java:153)
                          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                  .java:145)
                          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
                  ct(LifecycleModuleBuilder.java:84)
                          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
                  ct(LifecycleModuleBuilder.java:59)
                          at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedB
                  ild(LifecycleStarter.java:183)
                          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecyc
                  eStarter.java:161)
                          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
                          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
                          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
                          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
                          at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
                  java:39)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
                  sorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:597)
                          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Lau
                  cher.java:290)
                          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.ja
                  a:230)
                          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(L
                  uncher.java:409)
                          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java
                  352)
                  2011-07-20 11:10:59,597 INFO  org.jboss.seam.solder.Version - Seam Solder 3.0.0
                  Final (build id: 3.0.0.Final)
                  2011-07-20 11:10:59,600 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                  sion - Seam Config XML provider starting...
                  2011-07-20 11:10:59,602 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                  sion - Loading XmlDocumentProvider: org.jboss.seam.config.xml.bootstrap.Resourc
                  LoaderXmlDocumentProvider
                  2011-07-20 11:10:59,616 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                  sion - Reading XML file: file:/E:/MyWorks/bifincan.com/bifincan/target/classes/
                  ETA-INF/seam-beans.xml
                  2011-07-20 11:10:59,663 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                  sion - Reading XML file: jar:file:/E:/Users/hantsy/.m2/repository/org/jboss/sea
                  /solder/seam-solder-impl/3.0.0.Final/seam-solder-impl-3.0.0.Final.jar!/META-INF
                  beans.xml
                  2011-07-20 11:10:59,665 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                  sion - Reading XML file: jar:file:/E:/Users/hantsy/.m2/repository/org/jboss/sea
                  /solder/seam-solder/3.0.0.Final/seam-solder-3.0.0.Final.jar!/META-INF/beans.xml
                  2011-07-20 11:10:59,668 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                  sion - Reading XML file: jar:file:/E:/Users/hantsy/.m2/repository/org/jboss/sea
                  /persistence/seam-persistence-impl/3.0.0.Final/seam-persistence-impl-3.0.0.Fina
                  .jar!/META-INF/beans.xml
                  2011-07-20 11:10:59,680 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                  sion - Adding XML Defined Bean: org.jboss.seam.transaction.SeSynchronizations
                  2011-07-20 11:10:59,705 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                  sion - Adding XML Defined Bean: org.jboss.seam.transaction.EntityTransaction
                  2011-7-20 11:10:59 org.jboss.weld.environment.tomcat.Tomcat6Container initializ
                  
                  信息: Tomcat 6 detected, CDI injection will be available in Servlets and Filter
                  . Injection into Listeners is not supported
                  2011-07-20 11:10:59,914 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                  ing class org.jboss.seam.transaction.UTTransaction from being installed as bean
                  due to @Veto annotation
                  2011-07-20 11:11:00,018 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                  ing class org.jboss.seam.solder.core.VersionLoggerUtil from being installed as
                  ean due to @Veto annotation
                  2011-07-20 11:11:00,077 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                  sion - Preventing installation of default bean: org.jboss.seam.transaction.Enti
                  yTransaction
                  2011-07-20 11:11:00,078 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                  ing class org.jboss.seam.transaction.EntityTransaction from being installed as
                  ean due to @Veto annotation
                  2011-07-20 11:11:00,214 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                  ing class org.jboss.seam.solder.resourceLoader.ResourceProvider from being inst
                  lled as bean due to @Veto annotation
                  2011-07-20 11:11:00,243 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                  sion - Preventing installation of default bean: org.jboss.seam.transaction.SeSy
                  chronizations
                  2011-07-20 11:11:00,244 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                  ing class org.jboss.seam.transaction.SeSynchronizations from being installed as
                  bean due to @Veto annotation
                  2011-07-20 11:11:00,274 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                  ing class org.jboss.seam.persistence.HibernatePersistenceProvider from being in
                  talled as bean due to @Veto annotation
                  2011-07-20 11:11:00,410 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                  ing class org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtension
                  mpl from being installed as bean due to @Veto annotation
                  2011-07-20 11:11:00,414 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                  ing class org.jboss.seam.transaction.NoTransaction from being installed as bean
                  due to @Veto annotation
                  2011-07-20 11:11:00,547 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                  ing class org.jboss.seam.transaction.HibernateTransaction from being installed
                  s bean due to @Veto annotation
                  2011-7-20 11:11:00 org.jboss.interceptor.util.InterceptionTypeRegistry <clinit>
                  警告: Class 'javax.ejb.PostActivate' not found, interception based on it is not
                  enabled
                  2011-7-20 11:11:00 org.jboss.interceptor.util.InterceptionTypeRegistry <clinit>
                  警告: Class 'javax.ejb.PrePassivate' not found, interception based on it is not
                  enabled
                  2011-07-20 11:11:00,843 INFO  org.jboss.seam.solder.bean.defaultbean.DefaultBea
                  Extension - Preventing install of default bean Managed Bean [class org.jboss.se
                  m.transaction.DefaultSeamTransaction] with qualifiers [@Any @Synthetic]
                  2011-07-20 11:11:00,844 INFO  org.jboss.seam.solder.bean.defaultbean.DefaultBea
                  Extension - Preventing install of default bean Managed Bean [class org.jboss.se
                  m.transaction.TransactionManagerSynchronizations] with qualifiers [@Any @Synthe
                  ic]
                  2011-07-20 11:11:00,845 DEBUG org.jboss.seam.solder.bean.defaultbean.DefaultBea
                  Extension - Installing default managed bean Default Bean with types [class java
                  lang.Object, class javax.el.FunctionMapper] and qualifiers [@org.jboss.seam.sol
                  er.el.Mapper()]
                  2011-07-20 11:11:00,846 DEBUG org.jboss.seam.solder.bean.defaultbean.DefaultBea
                  Extension - Installing default managed bean Default Bean with types [interface
                  rg.jboss.seam.persistence.FlushModeManager, class java.lang.Object] and qualifi
                  rs [@javax.enterprise.inject.Default()]
                  2011-07-20 11:11:00,847 DEBUG org.jboss.seam.solder.bean.defaultbean.DefaultBea
                  Extension - Installing default managed bean Default Bean with types [class java
                  lang.Object, class javax.el.VariableMapper] and qualifiers [@org.jboss.seam.sol
                  er.el.Mapper()]
                  2011-7-20 11:11:00 org.apache.catalina.core.StandardContext listenerStart
                  严重: Exception sending context initialized event to listener instance of class
                  org.jboss.weld.environment.servlet.Listener
                  org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependen
                  ies for type [EntityManager] with qualifiers [@Default] at injection point [[fi
                  ld] @Inject private org.jboss.seam.transaction.EntityTransaction.entityManager]
                          at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.
                  ava:270)
                          at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:106)
                          at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:129
                  
                          at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:351)
                          at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java
                  336)
                          at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.j
                  va:396)
                          at org.jboss.weld.environment.servlet.Listener.contextInitialized(Liste
                  er.java:205)
                          at org.apache.catalina.core.StandardContext.listenerStart(StandardConte
                  t.java:4135)
                          at org.apache.catalina.core.StandardContext.start(StandardContext.java:
                  630)
                          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045
                  
                          at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
                          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045
                  
                          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:44
                  )
                          at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
                          at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunM
                  jo.java:558)
                          at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.jav
                  :255)
                          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Defaul
                  BuildPluginManager.java:101)
                          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                  .java:209)
                          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                  .java:153)
                          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                  .java:145)
                          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
                  ct(LifecycleModuleBuilder.java:84)
                          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
                  ct(LifecycleModuleBuilder.java:59)
                          at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedB
                  ild(LifecycleStarter.java:183)
                          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecyc
                  eStarter.java:161)
                          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
                          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
                          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
                          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
                          at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
                  java:39)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
                  sorImpl.java:25)
                          at java.lang.reflect.Method.invoke(Method.java:597)
                          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Lau
                  cher.java:290)
                          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.ja
                  a:230)
                          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(L
                  uncher.java:409)
                          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java
                  352)
                  2011-7-20 11:11:00 com.sun.faces.config.ConfigureListener contextInitialized
                  信息: 初始化上下文 '/bifincan' 的 Mojarra 2.1.2 (FCS 20110610)
                  2011-7-20 11:11:01 org.hibernate.validator.util.Version <clinit>
                  信息: Hibernate Validator 4.1.0.Final
                  2011-7-20 11:11:01 org.hibernate.validator.engine.resolver.DefaultTraversableRe
                  olver detectJPA
                  信息: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATr
                  versableResolver.
                  2011-7-20 11:11:02 org.primefaces.webapp.PostConstructApplicationEventListener
                  rocessEvent
                  信息: Running on PrimeFaces 3.0.M2
                  2011-7-20 11:11:02 com.sun.faces.config.ConfigureListener$WebConfigResourceMoni
                  or$Monitor <init>
                  信息: Monitoring jndi:/localhost/bifincan/WEB-INF/faces-config.xml for modifica
                  ions
                  2011-7-20 11:11:02 org.apache.catalina.core.StandardContext start
                  严重: Error listenerStart
                  2011-7-20 11:11:02 org.apache.catalina.core.StandardContext start
                  严重: Context [/bifincan] startup failed due to previous errors
                  2011-7-20 11:11:02 org.apache.catalina.loader.WebappClassLoader clearThreadLoca
                  Map
                  严重: The web application [/bifincan] created a ThreadLocal with key of type [n
                  ll] (value [javax.faces.context.FacesContext$1@b04589]) and a value of type [co
                  .sun.faces.config.InitFacesContext] (value [com.sun.faces.config.InitFacesConte
                  t@a553e2]) but failed to remove it when the web application was stopped. This i
                   very likely to create a memory leak.
                  



                  • 6. Re: Problem in Weld and Seam 3 in Tomcat 6
                    Jason Porter Master

                    hantsy bai wrote on Jul 19, 2011 22:42:


                    Oh, the config xml artifact id and group id were changed.

                    I had updated and tried, but unluckily it still does not work.

                    I remove the Seam servlet configurtion( the doc was not updated, several erros in the document, some classes can not be found).

                    I have tried to run on tomcat 7 in NetBeans IDE, and get the following error info in the console windows.



                    Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener
                    java.lang.RuntimeException: Error instantiating class org.jboss.seam.xml.bootstrap.XmlExtension
                         at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:282)
                         at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:238)
                         at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java:194)
                         at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:157)
                         at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:346)
                         at org.jboss.weld.bootstrap.ExtensionBeanDeployer.addExtensions(ExtensionBeanDeployer.java:93)
                         at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:340)
                         at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:170)
                         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
                         at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
                         at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
                         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
                         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
                         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                         at java.lang.Thread.run(Thread.java:662)
                    Caused by: java.lang.NoClassDefFoundError: org/jboss/weld/extensions/reflection/AnnotationInstanceProvider
                         at org.jboss.seam.xml.bootstrap.XmlExtension.<init>(XmlExtension.java:64)
                         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                         at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java:273)
                         ... 15 more
                    Caused by: java.lang.ClassNotFoundException: org.jboss.weld.extensions.reflection.AnnotationInstanceProvider
                         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
                         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
                         ... 21 more






                    Remove Weld Extensions, you only need Solder, and make sure you're using seam-xml-3.0.0.Final

                    • 7. Re: Problem in Weld and Seam 3 in Tomcat 6
                      Jason Porter Master

                      hantsy bai wrote on Jul 19, 2011 23:15:


                      Other exceptions when remove some seam dependencies in pom...It seems it is close to make it run on Tomcat.


                      2011-07-20 11:10:59,356 DEBUG org.jboss.seam.persistence.HibernatePersistencePr
                      vider - no Hibernate Search
                      java.lang.ClassNotFoundException: Could not load class org.hibernate.search.Ver
                      ion with the context class loader WebappClassLoader
                        context: /bifincan
                        delegate: false
                        repositories:
                      ----------> Parent Classloader:
                      ClassRealm[plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1, parent: sun.misc.L
                      uncher$AppClassLoader@19821f]
                       or any of the additional ClassLoaders: []
                              at org.jboss.seam.solder.reflection.Reflections.classForName(Reflection
                      .java:386)
                              at org.jboss.seam.persistence.HibernatePersistenceProvider.<clinit>(Hib
                      rnatePersistenceProvider.java:60)
                              at org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtensio
                      Impl.<clinit>(HibernateManagedSessionExtensionImpl.java:65)
                              at org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtensio
                      .<init>(HibernateManagedSessionExtension.java:51)
                              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method
                      
                              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruc
                      orAccessorImpl.java:39)
                              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegating
                      onstructorAccessorImpl.java:27)
                              at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                              at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java
                      273)
                              at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:238
                      
                              at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java
                      194)
                              at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:157)
                              at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:346)
                              at org.jboss.weld.bootstrap.ExtensionBeanDeployer.addExtensions(Extensi
                      nBeanDeployer.java:93)
                              at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBoots
                      rap.java:340)
                              at org.jboss.weld.environment.servlet.Listener.contextInitialized(Liste
                      er.java:170)
                              at org.apache.catalina.core.StandardContext.listenerStart(StandardConte
                      t.java:4135)
                              at org.apache.catalina.core.StandardContext.start(StandardContext.java:
                      630)
                              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045
                      
                              at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
                              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045
                      
                              at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:44
                      )
                              at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
                              at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunM
                      jo.java:558)
                              at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.jav
                      :255)
                              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Defaul
                      BuildPluginManager.java:101)
                              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                      .java:209)
                              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                      .java:153)
                              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                      .java:145)
                              at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
                      ct(LifecycleModuleBuilder.java:84)
                              at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
                      ct(LifecycleModuleBuilder.java:59)
                              at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedB
                      ild(LifecycleStarter.java:183)
                              at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecyc
                      eStarter.java:161)
                              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
                              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
                              at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
                              at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
                              at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
                      java:39)
                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
                      sorImpl.java:25)
                              at java.lang.reflect.Method.invoke(Method.java:597)
                              at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Lau
                      cher.java:290)
                              at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.ja
                      a:230)
                              at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(L
                      uncher.java:409)
                              at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java
                      352)
                      2011-07-20 11:10:59,597 INFO  org.jboss.seam.solder.Version - Seam Solder 3.0.0
                      Final (build id: 3.0.0.Final)
                      2011-07-20 11:10:59,600 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                      sion - Seam Config XML provider starting...
                      2011-07-20 11:10:59,602 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                      sion - Loading XmlDocumentProvider: org.jboss.seam.config.xml.bootstrap.Resourc
                      LoaderXmlDocumentProvider
                      2011-07-20 11:10:59,616 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                      sion - Reading XML file: file:/E:/MyWorks/bifincan.com/bifincan/target/classes/
                      ETA-INF/seam-beans.xml
                      2011-07-20 11:10:59,663 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                      sion - Reading XML file: jar:file:/E:/Users/hantsy/.m2/repository/org/jboss/sea
                      /solder/seam-solder-impl/3.0.0.Final/seam-solder-impl-3.0.0.Final.jar!/META-INF
                      beans.xml
                      2011-07-20 11:10:59,665 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                      sion - Reading XML file: jar:file:/E:/Users/hantsy/.m2/repository/org/jboss/sea
                      /solder/seam-solder/3.0.0.Final/seam-solder-3.0.0.Final.jar!/META-INF/beans.xml
                      2011-07-20 11:10:59,668 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                      sion - Reading XML file: jar:file:/E:/Users/hantsy/.m2/repository/org/jboss/sea
                      /persistence/seam-persistence-impl/3.0.0.Final/seam-persistence-impl-3.0.0.Fina
                      .jar!/META-INF/beans.xml
                      2011-07-20 11:10:59,680 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                      sion - Adding XML Defined Bean: org.jboss.seam.transaction.SeSynchronizations
                      2011-07-20 11:10:59,705 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                      sion - Adding XML Defined Bean: org.jboss.seam.transaction.EntityTransaction
                      2011-7-20 11:10:59 org.jboss.weld.environment.tomcat.Tomcat6Container initializ
                      
                      信息: Tomcat 6 detected, CDI injection will be available in Servlets and Filter
                      . Injection into Listeners is not supported
                      2011-07-20 11:10:59,914 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                      ing class org.jboss.seam.transaction.UTTransaction from being installed as bean
                      due to @Veto annotation
                      2011-07-20 11:11:00,018 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                      ing class org.jboss.seam.solder.core.VersionLoggerUtil from being installed as
                      ean due to @Veto annotation
                      2011-07-20 11:11:00,077 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                      sion - Preventing installation of default bean: org.jboss.seam.transaction.Enti
                      yTransaction
                      2011-07-20 11:11:00,078 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                      ing class org.jboss.seam.transaction.EntityTransaction from being installed as
                      ean due to @Veto annotation
                      2011-07-20 11:11:00,214 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                      ing class org.jboss.seam.solder.resourceLoader.ResourceProvider from being inst
                      lled as bean due to @Veto annotation
                      2011-07-20 11:11:00,243 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExte
                      sion - Preventing installation of default bean: org.jboss.seam.transaction.SeSy
                      chronizations
                      2011-07-20 11:11:00,244 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                      ing class org.jboss.seam.transaction.SeSynchronizations from being installed as
                      bean due to @Veto annotation
                      2011-07-20 11:11:00,274 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                      ing class org.jboss.seam.persistence.HibernatePersistenceProvider from being in
                      talled as bean due to @Veto annotation
                      2011-07-20 11:11:00,410 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                      ing class org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtension
                      mpl from being installed as bean due to @Veto annotation
                      2011-07-20 11:11:00,414 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                      ing class org.jboss.seam.transaction.NoTransaction from being installed as bean
                      due to @Veto annotation
                      2011-07-20 11:11:00,547 INFO  org.jboss.seam.solder.core.CoreExtension - Preven
                      ing class org.jboss.seam.transaction.HibernateTransaction from being installed
                      s bean due to @Veto annotation
                      2011-7-20 11:11:00 org.jboss.interceptor.util.InterceptionTypeRegistry <clinit>
                      警告: Class 'javax.ejb.PostActivate' not found, interception based on it is not
                      enabled
                      2011-7-20 11:11:00 org.jboss.interceptor.util.InterceptionTypeRegistry <clinit>
                      警告: Class 'javax.ejb.PrePassivate' not found, interception based on it is not
                      enabled
                      2011-07-20 11:11:00,843 INFO  org.jboss.seam.solder.bean.defaultbean.DefaultBea
                      Extension - Preventing install of default bean Managed Bean [class org.jboss.se
                      m.transaction.DefaultSeamTransaction] with qualifiers [@Any @Synthetic]
                      2011-07-20 11:11:00,844 INFO  org.jboss.seam.solder.bean.defaultbean.DefaultBea
                      Extension - Preventing install of default bean Managed Bean [class org.jboss.se
                      m.transaction.TransactionManagerSynchronizations] with qualifiers [@Any @Synthe
                      ic]
                      2011-07-20 11:11:00,845 DEBUG org.jboss.seam.solder.bean.defaultbean.DefaultBea
                      Extension - Installing default managed bean Default Bean with types [class java
                      lang.Object, class javax.el.FunctionMapper] and qualifiers [@org.jboss.seam.sol
                      er.el.Mapper()]
                      2011-07-20 11:11:00,846 DEBUG org.jboss.seam.solder.bean.defaultbean.DefaultBea
                      Extension - Installing default managed bean Default Bean with types [interface
                      rg.jboss.seam.persistence.FlushModeManager, class java.lang.Object] and qualifi
                      rs [@javax.enterprise.inject.Default()]
                      2011-07-20 11:11:00,847 DEBUG org.jboss.seam.solder.bean.defaultbean.DefaultBea
                      Extension - Installing default managed bean Default Bean with types [class java
                      lang.Object, class javax.el.VariableMapper] and qualifiers [@org.jboss.seam.sol
                      er.el.Mapper()]
                      2011-7-20 11:11:00 org.apache.catalina.core.StandardContext listenerStart
                      严重: Exception sending context initialized event to listener instance of class
                      org.jboss.weld.environment.servlet.Listener
                      org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependen
                      ies for type [EntityManager] with qualifiers [@Default] at injection point [[fi
                      ld] @Inject private org.jboss.seam.transaction.EntityTransaction.entityManager]
                              at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.
                      ava:270)
                              at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:106)
                              at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:129
                      
                              at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:351)
                              at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java
                      336)
                              at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.j
                      va:396)
                              at org.jboss.weld.environment.servlet.Listener.contextInitialized(Liste
                      er.java:205)
                              at org.apache.catalina.core.StandardContext.listenerStart(StandardConte
                      t.java:4135)
                              at org.apache.catalina.core.StandardContext.start(StandardContext.java:
                      630)
                              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045
                      
                              at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
                              at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045
                      
                              at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:44
                      )
                              at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
                              at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunM
                      jo.java:558)
                              at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.jav
                      :255)
                              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Defaul
                      BuildPluginManager.java:101)
                              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                      .java:209)
                              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                      .java:153)
                              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                      .java:145)
                              at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
                      ct(LifecycleModuleBuilder.java:84)
                              at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
                      ct(LifecycleModuleBuilder.java:59)
                              at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedB
                      ild(LifecycleStarter.java:183)
                              at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecyc
                      eStarter.java:161)
                              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
                              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
                              at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
                              at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
                              at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
                              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
                      java:39)
                              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
                      sorImpl.java:25)
                              at java.lang.reflect.Method.invoke(Method.java:597)
                              at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Lau
                      cher.java:290)
                              at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.ja
                      a:230)
                              at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(L
                      uncher.java:409)
                              at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java
                      352)
                      2011-7-20 11:11:00 com.sun.faces.config.ConfigureListener contextInitialized
                      信息: 初始化上下文 '/bifincan' 的 Mojarra 2.1.2 (FCS 20110610)
                      2011-7-20 11:11:01 org.hibernate.validator.util.Version <clinit>
                      信息: Hibernate Validator 4.1.0.Final
                      2011-7-20 11:11:01 org.hibernate.validator.engine.resolver.DefaultTraversableRe
                      olver detectJPA
                      信息: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATr
                      versableResolver.
                      2011-7-20 11:11:02 org.primefaces.webapp.PostConstructApplicationEventListener
                      rocessEvent
                      信息: Running on PrimeFaces 3.0.M2
                      2011-7-20 11:11:02 com.sun.faces.config.ConfigureListener$WebConfigResourceMoni
                      or$Monitor <init>
                      信息: Monitoring jndi:/localhost/bifincan/WEB-INF/faces-config.xml for modifica
                      ions
                      2011-7-20 11:11:02 org.apache.catalina.core.StandardContext start
                      严重: Error listenerStart
                      2011-7-20 11:11:02 org.apache.catalina.core.StandardContext start
                      严重: Context [/bifincan] startup failed due to previous errors
                      2011-7-20 11:11:02 org.apache.catalina.loader.WebappClassLoader clearThreadLoca
                      Map
                      严重: The web application [/bifincan] created a ThreadLocal with key of type [n
                      ll] (value [javax.faces.context.FacesContext$1@b04589]) and a value of type [co
                      .sun.faces.config.InitFacesContext] (value [com.sun.faces.config.InitFacesConte
                      t@a553e2]) but failed to remove it when the web application was stopped. This i
                       very likely to create a memory leak.
                      






                      This one looks like you may not have the JPA API classes in the web app.

                      • 8. Re: Problem in Weld and Seam 3 in Tomcat 6
                        hantsy bai Master

                        I added hibernate as JPA provider.




                           <!--JPA provider, Hibernate-->
                                <dependency>
                                    <groupId>org.hibernate</groupId>
                                    <artifactId>hibernate-entitymanager</artifactId>
                                    <version>3.6.3.Final</version>  
                                </dependency>
                                <dependency>
                                    <groupId>org.hibernate</groupId>
                                    <artifactId>hibernate-c3p0</artifactId>
                                    <version>3.6.3.Final</version>  
                                </dependency>
                             
                                <dependency>
                                    <groupId>org.hibernate.javax.persistence</groupId>
                                    <artifactId>hibernate-jpa-2.0-api</artifactId>
                                    <version>1.0.0.Final</version>
                                </dependency>
                                
                                <dependency>
                                    <groupId>mysql</groupId>
                                    <artifactId>mysql-connector-java</artifactId>
                                    <version>5.1.16</version>
                                </dependency>



                        • 9. Re: Problem in Weld and Seam 3 in Tomcat 6
                          Jason Porter Master

                          Hm, little confused now. You have the classes there, I don't know how it isn't seeing it and giving you a Unsatisfied dependency, unless you didn't add the producer for it.

                          • 10. Re: Problem in Weld and Seam 3 in Tomcat 6
                            hantsy bai Master

                            I recreated the project from scratch, everything is ok.
                            The difference is:




                            1.   Int the project, I did not update the dependencies version, and hibernate used the recommended version in the seam doc(3.5.1-Final).

                            2.   There are two bean.xml files in the project, in before project, I removed the one in META-INF folder, now I kept all.





                            I do not know what is the reason.


                            There are still two problem.
                            One is the exception at tomcat starup, it does not cause problem in application.




                            2011-07-20 11:10:59,356 DEBUG org.jboss.seam.persistence.HibernatePersistencePr
                            vider - no Hibernate Search
                            java.lang.ClassNotFoundException: Could not load class org.hibernate.search.Ver
                            ion with the context class loader WebappClassLoader
                              context: /bifincan
                              delegate: false
                              repositories:
                            ----------> Parent Classloader:
                            ClassRealm[plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1, parent: sun.misc.L
                            uncher$AppClassLoader@19821f]
                             or any of the additional ClassLoaders: []
                                    at org.jboss.seam.solder.reflection.Reflections.classForName(Reflection
                            .java:386)
                                    at org.jboss.seam.persistence.HibernatePersistenceProvider.<clinit>(Hib
                            rnatePersistenceProvider.java:60)
                                    at org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtensio
                            Impl.<clinit>(HibernateManagedSessionExtensionImpl.java:65)
                                    at org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtensio
                            .<init>(HibernateManagedSessionExtension.java:51)
                                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method
                            
                                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruc
                            orAccessorImpl.java:39)
                                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegating
                            onstructorAccessorImpl.java:27)
                                    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                                    at org.jboss.weld.util.ServiceLoader.prepareInstance(ServiceLoader.java
                            273)
                                    at org.jboss.weld.util.ServiceLoader.loadService(ServiceLoader.java:238
                            
                                    at org.jboss.weld.util.ServiceLoader.loadServiceFile(ServiceLoader.java
                            194)
                                    at org.jboss.weld.util.ServiceLoader.reload(ServiceLoader.java:157)
                                    at org.jboss.weld.util.ServiceLoader.iterator(ServiceLoader.java:346)
                                    at org.jboss.weld.bootstrap.ExtensionBeanDeployer.addExtensions(Extensi
                            nBeanDeployer.java:93)
                                    at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBoots
                            rap.java:340)
                                    at org.jboss.weld.environment.servlet.Listener.contextInitialized(Liste
                            er.java:170)
                                    at org.apache.catalina.core.StandardContext.listenerStart(StandardConte
                            t.java:4135)
                                    at org.apache.catalina.core.StandardContext.start(StandardContext.java:
                            630)
                                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045
                            
                                    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
                                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045
                            
                                    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:44
                            )
                                    at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
                                    at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunM
                            jo.java:558)
                                    at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.jav
                            :255)
                                    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Defaul
                            BuildPluginManager.java:101)
                                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                            .java:209)
                                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                            .java:153)
                                    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecuto
                            .java:145)
                                    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
                            ct(LifecycleModuleBuilder.java:84)
                                    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProj
                            ct(LifecycleModuleBuilder.java:59)
                                    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedB
                            ild(LifecycleStarter.java:183)
                                    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecyc
                            eStarter.java:161)
                                    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
                                    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
                                    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
                                    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
                                    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
                            java:39)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
                            sorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:597)
                                    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Lau
                            cher.java:290)
                                    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.ja
                            a:230)
                                    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(L
                            uncher.java:409)
                                    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java
                            352)




                            The second is the test in the weld-servlet-jsf archetype dose not work.




                            2011-7-21 8:31:20 org.jboss.weld.bootstrap.WeldBootstrap <clinit>
                            信息: WELD-000900 1.1.0 (Final)
                            2011-07-21 08:31:20,581 DEBUG org.jboss.seam.persistence.HibernatePersistencePro
                            vider - no Hibernate Search
                            java.lang.ClassNotFoundException: Could not load class org.hibernate.search.Vers
                            ion with the context class loader org.jboss.shrinkwrap.classloader.ShrinkWrapCla
                            ssLoader@1ff7a1e or any of the additional ClassLoaders: []
                                    at org.jboss.seam.solder.reflection.Reflections.classForName(Reflections
                            .java:386)
                                    at org.jboss.seam.persistence.HibernatePersistenceProvider.<clinit>(Hibe
                            rnatePersistenceProvider.java:60)
                                    at org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtension
                            Impl.<clinit>(HibernateManagedSessionExtensionImpl.java:65)
                                    at org.jboss.seam.persistence.hibernate.HibernateManagedSessionExtension
                            .<init>(HibernateManagedSessionExtension.java:51)
                                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                            
                                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
                            orAccessorImpl.java:39)
                                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
                            onstructorAccessorImpl.java:27)
                                    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                                    at org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.ServiceLoade
                            r.prepareInstance(ServiceLoader.java:297)
                                    at org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.ServiceLoade
                            r.loadService(ServiceLoader.java:262)
                                    at org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.ServiceLoade
                            r.loadServiceFile(ServiceLoader.java:218)
                                    at org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.ServiceLoade
                            r.reload(ServiceLoader.java:181)
                                    at org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.ServiceLoade
                            r.iterator(ServiceLoader.java:370)
                                    at org.jboss.weld.bootstrap.ExtensionBeanDeployer.addExtensions(Extensio
                            nBeanDeployer.java:93)
                                    at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootst
                            rap.java:334)
                                    at org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.TestContaine
                            r.startContainer(TestContainer.java:258)
                                    at org.jboss.arquillian.container.weld.ee.embedded_1_1.WeldEEMockContain
                            er.deploy(WeldEEMockContainer.java:71)
                                    at org.jboss.arquillian.impl.handler.ContainerDeployer.callback(Containe
                            rDeployer.java:62)
                                    at org.jboss.arquillian.impl.handler.ContainerDeployer.callback(Containe
                            rDeployer.java:50)
                                    at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.
                            java:63)
                                    at org.jboss.arquillian.impl.context.AbstractEventContext.fire(AbstractE
                            ventContext.java:115)
                                    at org.jboss.arquillian.impl.EventTestRunnerAdaptor.beforeClass(EventTes
                            tRunnerAdaptor.java:96)
                                    at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:162)
                            
                                    at org.jboss.arquillian.junit.Arquillian$3$1.evaluate(Arquillian.java:18
                            6)
                                    at org.jboss.arquillian.junit.Arquillian$MultiStatementExecutor.execute(
                            Arquillian.java:297)
                                    at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:182)
                            
                                    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
                                    at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:127)
                                    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.
                            java:35)
                                    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4
                            Provider.java:115)
                                    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider
                            .java:97)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                            java:39)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                            sorImpl.java:25)
                                    at java.lang.reflect.Method.invoke(Method.java:597)
                                    at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.inv
                            oke(ProviderFactory.java:103)
                                    at $Proxy0.invoke(Unknown Source)
                                    at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(Suref
                            ireStarter.java:150)
                                    at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(S
                            urefireStarter.java:91)
                                    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
                            69)
                            2011-07-21 08:31:20,805 INFO  org.jboss.seam.solder.Version - Seam Solder 3.0.0.
                            Final (build id: 3.0.0.Final)
                            2011-07-21 08:31:20,827 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExten
                            sion - Seam Config XML provider starting...
                            2011-07-21 08:31:20,829 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExten
                            sion - Loading XmlDocumentProvider: org.jboss.seam.config.xml.bootstrap.Resource
                            LoaderXmlDocumentProvider
                            2011-07-21 08:31:20,842 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExten
                            sion - Reading XML file: file:/E:/MyWorks/bifincan/bifincan-web/target/classes/M
                            ETA-INF/beans.xml
                            2011-07-21 08:31:20,886 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExten
                            sion - Reading XML file: jar:file:/E:/Users/hantsy/.m2/repository/org/jboss/seam
                            /solder/seam-solder-impl/3.0.0.Final/seam-solder-impl-3.0.0.Final.jar!/META-INF/
                            beans.xml
                            2011-07-21 08:31:20,888 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExten
                            sion - Reading XML file: jar:file:/E:/Users/hantsy/.m2/repository/org/jboss/seam
                            /solder/seam-solder/3.0.0.Final/seam-solder-3.0.0.Final.jar!/META-INF/beans.xml
                            2011-07-21 08:31:20,891 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExten
                            sion - Reading XML file: jar:file:/E:/Users/hantsy/.m2/repository/org/jboss/seam
                            /persistence/seam-persistence-impl/3.0.0.Final/seam-persistence-impl-3.0.0.Final
                            .jar!/META-INF/beans.xml
                            2011-07-21 08:31:20,904 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExten
                            sion - Adding XML Defined Bean: org.jboss.seam.transaction.SeSynchronizations
                            2011-07-21 08:31:20,927 INFO  org.jboss.seam.config.xml.bootstrap.XmlConfigExten
                            sion - Adding XML Defined Bean: org.jboss.seam.transaction.EntityTransaction
                            Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.882 sec <<< FA
                            ILURE!
                            Running com.dna.bifincan.HelloWorldTest
                            Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
                            
                            Results :
                            
                            Tests in error:
                              com.dna.bifincan.BeanManagerTest: org.jboss.weld.exceptions.DeploymentExceptio
                            n: WELD-001408 Unsatisfied dependencies for type [EntityManager] with qualifiers
                             [@Default] at injection point [[field] @Inject private org.jboss.seam.transacti
                            on.EntityTransaction.entityManager]
                            
                            Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
                            
                            [INFO] ------------------------------------------------------------------------
                            [INFO] BUILD FAILURE
                            [INFO] ------------------------------------------------------------------------
                            [INFO] Total time: 6.549s
                            [INFO] Finished at: Thu Jul 21 08:31:21 GMT+08:00 2011
                            [INFO] Final Memory: 9M/23M
                            [INFO] ------------------------------------------------------------------------
                            [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
                            7.2:test (default-test) on project bifincan-web: There are test failures.
                            [ERROR]
                            [ERROR] Please refer to E:\MyWorks\bifincan\bifincan-web\target\surefire-reports
                             for the individual test results.
                            [ERROR] -> [Help 1]
                            [ERROR]
                            [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
                            ch.
                            [ERROR] Re-run Maven using the -X switch to enable full debug logging.
                            [ERROR]
                            [ERROR] For more information about the errors and possible solutions, please rea
                            d the following articles:
                            [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
                            eption
                            



                            Thanks for ur help in these days.




                            • 11. Re: Problem in Weld and Seam 3 in Tomcat 6
                              Jason Porter Master

                              Glad you got it working. The first error looks like it's because you don't have Hibernate Search, but as you said it's actually more of an info, and not really an error.


                              The second one, you can add a JIRA, but archetypes are going to have to come from the community, we're mostly focusing on Forge for archetype kinds of quick start ups.

                              • 12. Re: Problem in Weld and Seam 3 in Tomcat 6
                                hantsy bai Master

                                Thanks.


                                I have filed three issues(reference doc and archetype) I found in these two days.
                                I will report this test problem later.