1 2 Previous Next 19 Replies Latest reply on Jun 12, 2011 11:08 AM by Ken Finnigan

    Seam Solder and native logger API not working for me...

    Hanspeter Gisler Newbie

      Hi All


      I am new to seam and all and probably I'm doing something terribly wrong, but any way, perhaps someone could enlighten me... here it goes:


      I am trying to setup simple logging with the native logger API (as described here: Native Logger API ).


      As I understand the doc further down ( Generating Classes ) the jar (added via maven according to doc) of the annotation processor should take care to generate the source files automatically and I should not have to define ANY additional Logger classes. Do I understand the doc correctly? Because as it is now, no code gets generated and deployment naturally fails.


      If I add a Logger producing class, it works, e.g.:




      public class MyLogger {
          @Produces
          public Logger produceLog(InjectionPoint injectionPoint) {
              return Logger.getLogger(injectionPoint.getMember().getDeclaringClass());
          }
      }



      But according to docu, this shouldn't be necessary, or is it?
      Has anybody please an idea, what I am doing (or understanding) wrong?


      Btw, the module is an EJB JAR - if this is of any importance...


      I would be very thankful for any help.
      Regards
      Hanspeter

        • 1. Re: Seam Solder and native logger API not working for me...
          Jan Groth Novice

          As the documentation states, the native logger is identical to the plain old logger. This means that unless you want to use this fancy trainspotter stuff,



          @Inject
          private Logger logger;
          



          should work out of the box if you have the dependency to Seam solder in the classpath. If not, a deployment exception should inform you at startup time that no producer for org.jboss.logging.Logger is registered.


          The documentation about generating implementation classes is a bit misleadingly placed, but certainly does not refer to pure logger injection.


          So, what exactly happens if you put the above code in any of your classes? If simply nothing happens, I suspect that you either got the import statement or the log level wrong...


          • 2. Re: Seam Solder and native logger API not working for me...
            Hanspeter Gisler Newbie

            Hi Jan, thanks for responding so fast.


            My testing class in question looks as follows, actually this is the only class in the project:


            package ejbtest;
            
            import javax.annotation.PostConstruct;
            import javax.ejb.Singleton;
            import javax.ejb.Startup;
            import javax.inject.Inject;
            
            import org.jboss.seam.solder.logging.Logger;
            
            @Singleton
            @Startup
            public class SessionBean {
                @Inject
                private Logger log;
            
                @PostConstruct
                public void importData() {
            
                      log.info("Successfully post constructed session bean.");
                }
            }
            



            The relevant pom.xml parts are as follows:




            <dependencies>
                 <dependency> 
                      <groupId>org.jboss.spec</groupId>
                      <artifactId>jboss-javaee-6.0</artifactId>
                      <version>1.0.0.Final</version>
                      <type>pom</type>
                      <scope>provided</scope>
                 </dependency>
            
                 <dependency>
                      <groupId>org.jboss.seam.solder</groupId>
                      <artifactId>seam-solder</artifactId>
                      <version>3.0.0.Final</version>
                      <type>jar</type>
                 </dependency>
            
                 <dependency>
                      <groupId>org.jboss.seam.solder</groupId>
                      <artifactId>seam-solder-tooling</artifactId>
                      <version>3.0.0.Final</version>
                 </dependency>
                            [...]
            </dependencies>
            
            [...]
            
            <build>
                 <plugins>
                      <plugin>
                           <groupId>org.apache.maven.plugins</groupId>
                           <artifactId>maven-compiler-plugin</artifactId>
                           <version>2.3.2</version>
                           <configuration>
                                <source>1.6</source>
                                <target>1.6</target>
                           </configuration>
                      </plugin>
                      [...]
                 </plugins>
            </build>



            Compilation works ok. When deplying, I get:



            SCHWERWIEGEND: Exception while invoking class org.glassfish.ejb.startup.EjbApplication start method
            javax.ejb.EJBException: javax.ejb.CreateException: Initialization failed for Singleton SessionBean
                 at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:719)
            [...]



            As far as I understand, the logger can't be injected...?


            Btw. I am using Glassfish 3.1 with upgraded weld ( according to: Upgrading Weld in Glassfish )

            • 3. Re: Seam Solder and native logger API not working for me...
              Jan Groth Novice

              try changing



              import org.jboss.seam.solder.logging.Logger;
              




              to



              org.jboss.logger
              



              If that doesn't make the trick, I suspect the setup of Glassfish (I'm a JBoss guy, so it's always good to have someone to blame ;-) ). What I can tell from the stacktrace is that it's not a Weld deployment exception, so I suspect the same exception without using the logger...






              • 4. Re: Seam Solder and native logger API not working for me...
                Hanspeter Gisler Newbie

                Hmmm, importing


                org.jboss.logger.Logger



                instead of


                org.jboss.seam.solder.logging.Logger



                has no effect whatsoever (same error message as before).


                Out of curiosity, I've tried to deploy the code on Jboss AS 6. It was a bit more verbose regarding the error, unfortunately I don't see through this either... Any ideas?


                Jboss output:




                18:10:34,133 INFO  [service] Removing bootstrap log handlers
                18:10:37,787 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///home/hp/bin/jboss-6.0.0.Final/server/default/deploy/ejbtest.jar_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private ejbtest.SessionBean.log]
                     at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:305) [:6.0.0.Final]
                [...]
                
                18:10:43,490 WARN  [seam] Seed data import failed.: java.lang.NullPointerException
                     at org.jboss.weld.integration.persistence.JBossJpaServices.resolvePersistenceContext(JBossJpaServices.java:59) [:6.0.0.Final]
                
                [...]
                
                18:10:43,569 INFO  [org.jboss.ejb3.nointerface.impl.jndi.AbstractNoInterfaceViewBinder] Binding the following entry in Global JNDI for bean:SeedDataImporter
                
                     SeedDataImporter/no-interface -> EJB3.1 no-interface view
                
                18:10:43,650 ERROR [ProfileServiceBootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                
                DEPLOYMENTS MISSING DEPENDENCIES:
                  Deployment "jboss-injector:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.SessionBeanInterceptor" is missing the following dependencies:
                    Dependency "<UNKNOWN jboss-injector:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.SessionBeanInterceptor>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=ejbtest,module=ejbtest,name=SessionBean' **")
                  Deployment "jboss-injector:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor" is missing the following dependencies:
                    Dependency "<UNKNOWN jboss-injector:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=ejbtest,module=ejbtest,name=SessionBean' **")
                
                [...]
                
                DEPLOYMENTS IN ERROR:
                  Deployment "<UNKNOWN jboss.j2ee:jar=ejbtest.jar,name=SessionBean,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss-injector:bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor,topLevelUnit=ejbtest.jar,unit=ejbtest.jar' **, ** UNRESOLVED Demands 'jboss-injector:bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.SessionBeanInterceptor,topLevelUnit=ejbtest.jar,unit=ejbtest.jar' **
                  Deployment "<UNKNOWN jboss-injector:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.SessionBeanInterceptor>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss-switchboard:appName=ejbtest,module=ejbtest,name=SessionBean' **
                  Deployment "<UNKNOWN jboss.j2ee:jar=ejbtest.jar,name=SessionBean,service=EJB3,type=singleton-bean-jndi-binder>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.j2ee:jar=ejbtest.jar,name=SessionBean,service=EJB3' **
                  Deployment "vfs:///home/hp/bin/jboss-6.0.0.Final/server/default/deploy/ejbtest.jar_WeldBootstrapBean" is in error due to the following reason(s): org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private ejbtest.SessionBean.log], **ERROR**
                  Deployment "java:global/cdi/ejbtest/ejbtest/BeanManager" is in error due to the following reason(s): ** NOT FOUND Depends on 'java:global/cdi/ejbtest/ejbtest/BeanManager' **
                  Deployment "<UNKNOWN startup-singleton-initiator:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss-switchboard:appName=ejbtest,module=ejbtest,name=SessionBean' **
                  Deployment "jboss.jca:name=jdbc/__default,service=DataSourceBinding" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:name=jdbc/__default,service=DataSourceBinding' **
                  Deployment "<UNKNOWN jboss-injector:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss-switchboard:appName=ejbtest,module=ejbtest,name=SessionBean' **
                
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]
                
                [...]
                
                18:11:00,137 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///home/hp/bin/jboss-6.0.0.Final/server/default/deploy/ejbtest.jar_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Logger] with qualifiers [@Default] at injection point [[field] @Inject private ejbtest.SessionBean.log]
                     at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:305) [:6.0.0.Final]
                
                [...]
                
                DEPLOYMENTS MISSING DEPENDENCIES:
                  Deployment "jboss-injector:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.SessionBeanInterceptor" is missing the following dependencies:
                    Dependency "<UNKNOWN jboss-injector:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.SessionBeanInterceptor>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=ejbtest,module=ejbtest,name=SessionBean' **")
                  Deployment "jboss-injector:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor" is missing the following dependencies:
                    Dependency "<UNKNOWN jboss-injector:topLevelUnit=ejbtest.jar,unit=ejbtest.jar,bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-switchboard:appName=ejbtest,module=ejbtest,name=SessionBean' **")
                  Deployment "jboss-switchboard:appName=ejbtest,module=ejbtest,name=SessionBean" is missing the following dependencies:
                    Dependency "java:global/cdi/ejbtest/ejbtest/BeanManager" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'java:global/cdi/ejbtest/ejbtest/BeanManager' **")
                  Deployment "jboss.j2ee:jar=ejbtest.jar,name=SessionBean,service=EJB3" is missing the following dependencies:
                    Dependency "<UNKNOWN jboss.j2ee:jar=ejbtest.jar,name=SessionBean,service=EJB3>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-injector:bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.SessionBeanInterceptor,topLevelUnit=ejbtest.jar,unit=ejbtest.jar' **")
                    Dependency "<UNKNOWN jboss.j2ee:jar=ejbtest.jar,name=SessionBean,service=EJB3>" (should be in state "Installed", but is actually in state "** UNRESOLVED Demands 'jboss-injector:bean=SessionBean,interceptor=org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor,topLevelUnit=ejbtest.jar,unit=ejbtest.jar' **")
                 
                [...]
                


                Is it possible, that dependencies (regarding weld) are missing?

                • 5. Re: Seam Solder and native logger API not working for me...
                  Jan Groth Novice

                  Yes, it looks as if dependencies are missing...


                  This class

                  org.jboss.seam.solder.logging.LoggerProducer

                  from


                  seam-solder-3.0.0.Final.jar



                  produces the Logger. Seems like the deployment is the problem, you should double check that the JAR is deployed and visible from where you are calling it...




                  • 6. Re: Seam Solder and native logger API not working for me...
                    Ken Finnigan Master

                    I think the logger may be a red herring as to the real problem.


                    Neither the error logs for glassfish or jboss appear to suggest a problem with logging, it appears to be a more general EJB error in the case of glassfish and a JPA error in JBoss.


                    Can you try removing the logger completely from the @Singleton and replace the log.info() in the @PostConstruct with a simple System.out.println and try running it on glassfish and post any error log?

                    • 7. Re: Seam Solder and native logger API not working for me...
                      Hanspeter Gisler Newbie

                      @Ken


                      The modified code without injecting the Logger as suggested by you:


                      package ejbtest;
                      
                      import javax.annotation.PostConstruct;
                      import javax.ejb.Singleton;
                      import javax.ejb.Startup;
                      //import javax.inject.Inject;
                      //import org.jboss.logging.Logger;
                      
                      @Singleton
                      @Startup
                      public class SessionBean {
                      //  @Inject
                      //  private Logger log;
                          @PostConstruct
                          public void importData() {
                                System.out.println("Successfully post constructed session bean.");
                                //log.info("Successfully post constructed session bean.");
                          }
                      }



                      works flawlessly and Glassfish's output is as expected:


                      INFO: JRebel: Directory '/home/hp/work/seam/ejbtest/target/classes' will be monitored for changes.
                      INFO: JRebel-GlassFish-BaseContainer: Watching 'ejbtest.SessionBean' for changes
                      INFO: Portable JNDI names for EJB SessionBean : [java:global/ejbtest_ejbtest_ejb_1.0-SNAPSHOT/SessionBean, java:global/ejbtest_ejbtest_ejb_1.0-SNAPSHOT/SessionBean!ejbtest.SessionBean]
                      INFO: WELD-000900 ${parsedVersion (osgiVersion})
                      INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                      INFO: Seam Solder 3.0.0.Final (build id: 3.0.0.Final)
                      INFO: Successfully post constructed session bean.
                      INFO: ejbtest_ejbtest_ejb_1.0-SNAPSHOT was successfully deployed in 6,647 milliseconds.
                      [...]



                      I also suspect the Logger beeing a red herring - I rather think (as Jan suggested) that something with the classpath is amiss, because the following observations I've made:


                      If I package the EJB together with the seam-solder classfiles with the maven plugin


                      <plugin>
                           <artifactId>maven-assembly-plugin</artifactId>
                           <configuration>
                                <descriptorRefs>
                                     <descriptorRef>jar-with-dependencies</descriptorRef>
                                </descriptorRefs>
                                <archive>
                                     <manifest>
                                          <addClasspath>true</addClasspath>
                                     </manifest>
                                </archive>
                           </configuration>
                           <executions>
                                <execution>
                                     <id>make-assembly</id>
                                     <phase>package</phase>
                                     <goals>
                                          <goal>single</goal>
                                     </goals>
                                </execution>
                           </executions>
                      </plugin>



                      and deploy it to Glassfish (auto-deploying it by copying the jar to Glassfish's autodeploy directory), it works.


                      However, as expected of course, if I auto-deploy the one jar that has no dependencies included via the maven-plugin, it doesn't work - as the seam-solder lib is of course unknown to Glassfish by default.


                      After that, I had the suspicion, that Netbeans didn't extend the classpath correctly for Glassfish / JBoss when starting in-place debug-deployment. However, Netbeans output log for the failing deployment (for the source with Logger Injection in it) is as follows:


                      In-place deployment at /home/hp/work/seam/ejbtest/target/classes
                      deploy?DEFAULT=/home/hp/work/seam/ejbtest/target/classes&name=ejbtest_ejbtest_ejb_1.0-SNAPSHOT&libraries=/home/hp/.m2/repository/org/jboss/seam/solder/seam-solder/3.0.0.Final/seam-solder-3.0.0.Final.jar&force=true failed on GlassFish Server 3.x 
                       Error occurred during deployment: Exception while loading the app : javax.ejb.CreateException: Initialization failed for Singleton SessionBean. Please see server.log for more details.
                      The module has not been deployed.
                           at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:187)
                           at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:167)
                           at org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:123)
                           at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:208)
                           at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)



                      This seems to indicate, that the correct path to seam-solder-3.0.0.Final.jar is setup for debugging...


                      Hmmm, I am a bit at loss here... Any thoughts?



                      • 8. Re: Seam Solder and native logger API not working for me...
                        Ken Finnigan Master

                        Hanspeter,


                        Is there any further stacktrace from glassfish when the javax.ejb.CreateException occurs, from a non NetBeans deployment?


                        If that is the only exception, that implies something is being hidden in terms of logging errors, as if it works fine without the solder jar and adding it causes that exception then I would expect to see a more detailed error as to why it can't start the EJB.

                        • 9. Re: Seam Solder and native logger API not working for me...
                          Hanspeter Gisler Newbie

                          One further observation:


                          I've created a small test lib: logging.jar


                          logging.jar includes the (obligate?) beans.xml file in META-INF and one simple self written class, TestLogger.
                          Instead of the afore mentioned Logger's (i.e. from seam-solder, etc.) I tried to inject the TestLogger defined in logging.jar. This didn't work either! (exact same error message as above).


                          So it seams (ups, I mean seems) , that I have misunderstood CDI's functionality... :-/
                          I thought, that it should be possible to inject classes (objects) from one jar into an other jar... Is that wrong thinking? Or do I have to do some special configuration first to allow that?


                          • 10. Re: Seam Solder and native logger API not working for me...
                            Ken Finnigan Master

                            There shouldn't be anything special required to inject a class from one jar into a class in another.


                            How is your application packaged?  Is it a WAR or EAR?

                            • 11. Re: Seam Solder and native logger API not working for me...
                              Hanspeter Gisler Newbie

                              @Ken


                              Our last blog entries have crossed each other.
                              As stated in my last comment, it seems that the whole problem has nothing to do with seam-solder - as the error also occurs with my own little test-lib logging.jar. What could be the problem preventing cross-jar injection?


                              However, here some lines the lengthy stacktrace generated by glassfish (also deployed out of netbeans):


                              INFO: JRebel-GlassFish-BaseContainer: Watching 'ejbtest.SessionBean' for changes
                              INFO: Portable JNDI names for EJB SessionBean : [java:global/ejbtest_ejbtest_ejb_1.0-SNAPSHOT/SessionBean, java:global/ejbtest_ejbtest_ejb_1.0-SNAPSHOT/SessionBean!ejbtest.SessionBean]
                              INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
                              SCHWERWIEGEND: Exception while invoking class org.glassfish.ejb.startup.EjbApplication start method
                              javax.ejb.EJBException: javax.ejb.CreateException: Initialization failed for Singleton SessionBean
                                   at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:719)
                                   at com.sun.ejb.containers.AbstractSingletonContainer.instantiateSingletonInstance(AbstractSingletonContainer.java:449)
                                   at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:216)
                                   at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:177)
                                   at org.glassfish.ejb.startup.SingletonLifeCycleManager.doStartup(SingletonLifeCycleManager.java:155)
                                   at org.glassfish.ejb.startup.EjbApplication.start(EjbApplication.java:177)
                                   at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
                                   at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
                                   at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:286)
                                   at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
                                   at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
                                   at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
                                   at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
                                   at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
                                   at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
                                   at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
                                   at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
                                   at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
                                   at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
                                   at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
                                   at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
                                   at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
                                   at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
                                   at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
                                   at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
                                   at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
                                   at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
                                   at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
                                   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
                                   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
                                   at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
                                   at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
                                   at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
                                   at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
                                   at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
                                   at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
                                   at java.lang.Thread.run(Thread.java:662)
                              Caused by: javax.ejb.CreateException: Initialization failed for Singleton SessionBean
                                   at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:545)
                                   at com.sun.ejb.containers.AbstractSingletonContainer.access$100(AbstractSingletonContainer.java:79)
                                   at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:717)
                                   ... 36 more
                              [... rest is cut for brevitys sake]

                              • 12. Re: Seam Solder and native logger API not working for me...
                                Hanspeter Gisler Newbie

                                @Ken


                                To your question:



                                How is your application packaged? Is it a WAR or EAR?

                                I believe, this brings me closer to the cause of the problem:


                                Eventually the packaging of all modules will be EAR (1 EJB-jar, 2 WAR's, 1 API-jar)
                                However, for this whole testing thing I've just deployed the EJB-jar allone (not inside an EAR). Is that procedure the real culprit? (I thought, that EJB-jar's could be deployed separately into Java EE container)

                                • 13. Re: Seam Solder and native logger API not working for me...
                                  Ken Finnigan Master

                                  Not sure if EJBs can be deployed standalone within a JEE6 container, but I don't believe CDI will work in that situation if it is possible.


                                  If you can try bundling the EJB jar into a WAR and retesting that should solve the problem

                                  • 14. Re: Seam Solder and native logger API not working for me...
                                    Hanspeter Gisler Newbie

                                    Ok, I think the most important problem is solved (thank you very much Ken and Jan).


                                    I had ignored, that when building an EAR, the classpath in the EJB module needs to be included for pointing to the correct jar lib files (i.e. seam-solder.jar in my example).


                                    Just for the record: In EJB pom.xml, I had to include


                                    <addClasspath>true</addClasspath>



                                    i.e.


                                         <build>
                                              <plugins>
                                                   <plugin>
                                                        <groupId>org.apache.maven.plugins</groupId>
                                                        <artifactId>maven-ejb-plugin</artifactId>
                                                        <version>2.3</version>
                                                        <configuration>
                                                             <ejbVersion>3.1</ejbVersion>
                                                             <archive>
                                                                  <manifest>
                                                                       <addClasspath>true</addClasspath>
                                                                  </manifest>
                                                             </archive>
                                                        </configuration>
                                                   </plugin>
                                              </plugins>
                                         </build>



                                    This then yields a MANIFEST.MF file in ejb.jar with content:


                                    Manifest-Version: 1.0
                                    Archiver-Version: Plexus Archiver
                                    Created-By: Apache Maven
                                    Built-By: hp
                                    Build-Jdk: 1.6.0_22
                                    Class-Path: seam-solder-3.0.0.Final.jar



                                    The seam-solder.jar is put into lib dir in EAR archive, where it can be found (lib is searched for classes defined in classpath).


                                    The only prolbem remaining (not important for the moment for me) is that the bare EJB.jar still yields to afore mentioned error when beeing deployed. I am sure, this is also some classpath issue, but can't figure out why at the moemnt...


                                    Note: according to java EE 6 tutorial, deploying a bare EJB.jar (not packaged inside an EAR) to glassfish is supported, see: Java EE 6 Tutorial



                                    You can also deploy an EJB JAR that is not contained in an EAR file.
                                    1 2 Previous Next