CDI (Weld) / Seam 3 持久性模块 / Glassfish 3 - 启动服务器时出现无法解释的异常

发布于 2024-09-29 05:49:42 字数 9797 浏览 4 评论 0原文

我正在使用 Weld,Jboss 的 CDI 实现。 JPA/Hibernate 用于持久性。对于一些不同的东西,我在 Glassfish 3 上进行了破解,我以前从未使用过它。我正在使用 Maven 进行依赖管理。

由于 CDI 不包含开箱即用的事务管理,因此我决定使用 Seam 3 Persistence 模块而不是自己开发。现在,我很清楚这目前仅处于 Alpha 阶段,所以也许我是在自找麻烦。我希望其他人看到了这个,可以帮助我解决它,或者至少让我知道为什么我会遇到这样的问题。

因此,在添加持久性模块之前,一切都构建并运行良好。我可以正常打开应用程序的主页。然而,当我将 Seam 3 持久性模块添加到 pom.xml 时,应用程序在启动时抛出异常。工作和不工作之间的唯一区别是我添加到 pom.xml 的一个依赖项 我添加

到 pom.xml 的依赖项是:

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

我根据 http://seamframework.org/Seam3/PersistenceModule 。我知道,当单击此页面的文档时,它提到了一些其他依赖项,但在添加它们时我也遇到了同样的问题。这就是我将问题范围缩小到的依赖关系。

因此,在添加上面的依赖项并启动服务器后,我在启动时得到以下信息:

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

正如您所看到的,实际上没有什么可继续的。

您以前见过这个异常吗?您知道是什么原因造成的吗?最后,你知道如何解决它吗?

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.

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. 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

满意归宿 2024-10-06 05:49:42

我也看到过这个。我增加了 Glassfish 的登录并发现了以下内容。

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 

<dependency>
            <groupId>org.jboss.slf4j</groupId>
            <artifactId>slf4j-jboss-logging</artifactId>
            <version>1.0.2.GA</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-log4j</artifactId>
            <version>2.1.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>3.0.0.Beta4</version>
        </dependency>

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.<init>(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.<clinit>(FSDirectoryProvider.java:55)

我认为这是 Glassfish 上的 log4j 配置问题。

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 

<dependency>
            <groupId>org.jboss.slf4j</groupId>
            <artifactId>slf4j-jboss-logging</artifactId>
            <version>1.0.2.GA</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-log4j</artifactId>
            <version>2.1.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>3.0.0.Beta4</version>
        </dependency>

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.<init>(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.<clinit>(FSDirectoryProvider.java:55)

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

习ぎ惯性依靠 2024-10-06 05:49:42

事实证明,这是我们使用的版本和技术组合的一个错误。我们现在使用的是 Jboss 6 的最终版本和 Seam Persistence Module 的 beta 版本,一切似乎都工作正常。

It turns out it was a bug with the versions and combination of technologies we were using. We are now using the final version of Jboss 6 and the beta version of the Seam Persistence Module and all seems to be working ok.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文