views:

17

answers:

1

Ok, so I've come upon an exception that is starting to frustrate me. Let me set the scene.

I am using Weld, Jboss' implementation of CDI. JPA/Hibernate for persistence. For something different I am giving it a crack on Glassfish 3 which I have not used before. I am using Maven for dependency management.

Anyway, as CDI doesn't have transaction management included out of the box, I decided to use the Seam 3 Persistence module instead of rolling my own. Now, I am well aware that this is only in Alpha at the moment so maybe I am asking for trouble but please bare with me. I'm hoping someone else has seen this and can either help me fix it or at least let me know why I'm getting the problems that I am.

So, before adding the persistence module, everything builds and runs fine. I can open the homepage of the app fine. However, when I add the Seam 3 persistence module to my pom.xml, the application throws an exception when starting up. The only difference between working and not working is the one dependency I am adding to the pom.xml

The dependency I am adding to my pom.xml is:

<dependency>
  <groupId>org.jboss.seam.persistence</groupId>
  <artifactId>seam-persistence-impl</artifactId>
  <version>3.0.0.Alpha1</version>
</dependency>

I added this dependency based on the instructions at http://seamframework.org/Seam3/PersistenceModule . I'm aware that when clicking on the documentation from this page it mentions a couple of other dependencies but I get the same problem when adding them as well. This is the dependency that I have narrowed the problem down to.

So, after adding the dependency above and starting the server I get the following on startup:

INFO: Launching GlassFish on Felix platform
Welcome to Felix
================
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Grizzly Framework 1.9.18-o started in: 113ms listening on port 8080
INFO: Grizzly Framework 1.9.18-o started in: 33ms listening on port 4848
INFO: Grizzly Framework 1.9.18-o started in: 76ms listening on port 8181
INFO: Starting Grizzly Framework 1.9.18-o - Thu Oct 28 23:06:04 BST 2010
INFO: Grizzly Framework 1.9.18-o started in: 10ms listening on port 3700
INFO: Starting Grizzly Framework 1.9.18-o - Thu Oct 28 23:06:04 BST 2010
INFO: Grizzly Framework 1.9.18-o started in: 7ms listening on port 7676
INFO: The Admin Console is already installed, but not yet loaded.
INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time : Felix(4429ms) startup services(1530ms) total(5959ms)
INFO: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Grizzly Framework 1.9.18-o started in: 16ms listening on port 8080
INFO: Binding RMI port to *:8686
INFO: JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://192.168.1.73:8686/jndi/rmi://192.168.1.73:8686/jmxrmi
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /Applications/NetBeans/glassfish-3.0.1/glassfish/domains/domain1/autodeploy/bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /var/folders/Q0/Q00qqJF1Gi8VesnYN54iM++++TI/-Tmp-/fileinstall-2957414086269585283, felix.fileinstall.filter = null}
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /var/folders/Q0/Q00qqJF1Gi8VesnYN54iM++++TI/-Tmp-/fileinstall--8933010182761076907, felix.fileinstall.filter = null}
INFO: Started bundle: file:/Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart/org.apache.felix.scr.jar
INFO: Started bundle: file:/Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart/osgi-web-container.jar
INFO: SEC1002: Security Manager is OFF.
INFO: Security startup service called
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created.
INFO: Realm certificate of classtype com.sun.enterprise.security.auth.realm.certificate.CertificateRealm successfully created.
INFO: Security service(s) started successfully....
INFO: Created HTTP listener http-listener-1 on port 8080
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Created HTTP listener admin-listener on port 4848
INFO: Created virtual server server
INFO: Created virtual server __asadmin
INFO: Virtual server server loaded system default web module
INFO: Updating configuration from org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: Installed /Applications/NetBeans/glassfish-3.0.1/glassfish/modules/autostart/org.apache.felix.fileinstall-autodeploy-bundles.cfg
INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir = /Applications/NetBeans/glassfish-3.0.1/glassfish/domains/domain1/autodeploy/bundles, felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start = true, felix.fileinstall.tmpdir = /var/folders/Q0/Q00qqJF1Gi8VesnYN54iM++++TI/-Tmp-/fileinstall-9012588867170808207, felix.fileinstall.filter = null}
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Portable JNDI names for EJB EjbSynchronizations : [java:global/com.coffeesnobs_web_war_1.0-SNAPSHOT/EjbSynchronizations, java:global/com.coffeesnobs_web_war_1.0-SNAPSHOT/EjbSynchronizations!org.jboss.seam.persistence.transaction.LocalEjbSynchronizations]
INFO: WELD-000900 1.0.1 (SP3)
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
SEVERE: Exception while loading the app
org.glassfish.deployment.common.DeploymentException: Exception #0 :null
        at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:167)
        at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:125)
        at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:224)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
        at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:680)
Caused by: org.jboss.weld.exceptions.DefinitionException: Exception #0 :null
        at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:45)
        at org.jboss.weld.bootstrap.events.ProcessAnnotatedTypeImpl.fire(ProcessAnnotatedTypeImpl.java:44)
        at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:61)
        at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:88)
        at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:134)
        at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:377)
        at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:165)
        ... 30 more

INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Grizzly Framework 1.9.18-o started in: 14ms listening on port 8181

As you can see, there really isn't much to go on.

Have you seen this exception before? Do you have any idea what is causing it? And finally, do you know how to fix it?

Thanks in advance...

+1  A: 

I've been seeing this too. I increased the loggin on Glassfish and found the following.

FINER: loadClass(org.jboss.logging.MessageLogger) FINER: Delegating to classloader1 org.glassfish.internal.api.DelegatingClassLoader@6f9240a4 FINER: Searching local repositories FINER: findClass(org.jboss.logging.MessageLogger) FINER: findClassInternal(org.jboss.logging.MessageLogger) FINER: --> Passing on ClassNotFoundException SEVERE: Exception while loading the app org.glassfish.deployment.common.DeploymentException: Exception #0 :null at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:167) at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:125) at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:224) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:637) Caused by: org.jboss.weld.exceptions.DefinitionException: Exception #0 :null at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:45) at org.jboss.weld.bootstrap.events.ProcessAnnotatedTypeImpl.fire(ProcessAnnotatedTypeImpl.java:44) at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:61) at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:88) at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:134) at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:377) at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:165) ... 30 more

It looks like there is a JBoss logging dependency problem. MessgeLogger is a new class in the jboss logging framework that the new Seam extensions appear to be using.

I added the following to my pom

org.jboss.slf4j slf4j-jboss-logging 1.0.2.GA org.jboss.logging jboss-logging-log4j 2.1.0.GA org.jboss.logging jboss-logging 3.0.0.Beta4

This seems to have fixed the missing class but now I get a NPE.

Caused by: java.lang.NullPointerException at org.apache.log4j.LogManager.getLogger(LogManager.java:188) at org.apache.log4j.Logger.getLogger(Logger.java:104) at org.jboss.logging.Log4jLogger.(Log4jLogger.java:35) at org.jboss.logging.Log4jLoggerProvider.getLogger(Log4jLoggerProvider.java:33) at org.jboss.logging.Logger.getLogger(Logger.java:2164) at org.jboss.slf4j.JBossLoggerFactory.getLogger(JBossLoggerFactory.java:66) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:246) at org.hibernate.search.util.LoggerFactory.make(LoggerFactory.java:38) at org.hibernate.search.store.FSDirectoryProvider.(FSDirectoryProvider.java:55)

I think it's a log4j config problem on Glassfish.

James Williams