Payara 4.1自动部署WAR部署错误NullPointerException NCLS-CORE-00069 AS-WEB-CORE-00108

时间:2018-07-15 08:49:00

标签: java java-ee cdi web-deployment payara

经过一些代码更改后,我发现来自payara服务器的异常异常。问题在于,我无法查明它在抱怨什么。基本上我什至都不知道是什么问题。

任何可能出问题的主意都会受到赞赏。

启动期间日志中的异常:

{"Timestamp":"2018-07-14T11:31:34.430+0000","Level":"WARNING","Version":"Payara 4.1","LoggerName":"javax.enterprise.system.core","ThreadID":"58","ThreadName":"AutoDeployer","TimeMillis":"1531567894430","LevelValue":"900","MessageID":"NCLS-CORE-00069","LogMessage":{"Exception":"Exception while dispatching an event","StackTrace":"org.glassfish.api.invocation.InvocationException
    at org.glassfish.api.invocation.InvocationManagerImpl.postInvoke(InvocationManagerImpl.java:219)
    at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:310)
    at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
    at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:333)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:505)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:227)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:536)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:544)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:540)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:539)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:570)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:562)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:561)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1469)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:111)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1851)
    at org.glassfish
.deployment.autodeploy.AutoOperation.run(AutoOperation.java:164)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:597)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:484)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:412)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:403)
    at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:233)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
"}}

后跟-两次:

{"Timestamp":"2018-07-14T11:31:34.998+0000","Level":"SEVERE","Version":"Payara 4.1","LoggerName":"javax.enterprise.web.core","ThreadID":"58","ThreadName":"AutoDeployer","TimeMillis":"1531567894998","LevelValue":"1000","MessageID":"AS-WEB-CORE-00108","LogMessage":{"Exception":"ContainerBase.addChild: start: ","StackTrace":"org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.jboss.weld.servlet.WeldListener
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5523)
    at com.sun.enterprise.web.WebModule.start(WebModule.java:594)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:956)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:939)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:684)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2105)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1750)
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:294)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:357)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:509)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:227)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:536)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:544)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:540)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.e
xecute(CommandRunnerImpl.java:539)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:570)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:562)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:561)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1469)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:111)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1851)
    at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:164)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:597)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:484)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:412)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:403)
    at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:233)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.jboss.weld.servlet.WeldListener
    at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2884)
    at org.apache.catalina.core.StandardContext.addApplicationListener(StandardContext.java:2080)
    at com.sun.enterprise.web.TomcatDeploymentConfig.configureApplicationListener(TomcatDeploymentConfig.java:236)
    at com.sun.enterprise.web.TomcatDeploymentConfig.configureWebModule(TomcatDeploymentConfig.java:95)
    at com.sun.enterprise.web.WebModuleContextConfig.start(WebModuleContextConfig.java:239)
    at
 org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:336)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:163)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5520)
    ... 34 more
Caused by: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.jboss.weld.servlet.WeldListener
    at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:3005)
    at org.apache.catalina.core.StandardContext.loadListener(StandardContext.java:5043)
    at com.sun.enterprise.web.WebModule.loadListener(WebModule.java:1732)
    at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2882)
    ... 41 more
Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.jboss.weld.servlet.WeldListener
    at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:353)
    at com.sun.enterprise.web.WebContainer.createListenerInstance(WebContainer.java:808)
    at com.sun.enterprise.web.WebModule.createListenerInstance(WebModule.java:2102)
    at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:3003)
    ... 44 more
Caused by: java.lang.NullPointerException
    at org.glassfish.weld.services.JCDIServiceImpl.createManagedObject(JCDIServiceImpl.java:358)
    at org.glassfish.weld.services.JCDIServiceImpl.createManagedObject(JCDIServiceImpl.java:283)
    at com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBean(ManagedBeanManagerImpl.java:476)
    at com.sun.enterprise.container.common.impl.managedbean.ManagedBeanManagerImpl.createManagedBean(ManagedBeanManagerImpl.java:429)
    at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:337)
    ... 47 more
"}}

此警告稍后再出现

{"Timestamp":"2018-07-14T11:31:35.079+0000","Level":"WARNING","Version":"Payara 4.1","LoggerName":"javax.enterprise.web","ThreadID":"58","ThreadName":"AutoDeployer","TimeMillis":"1531567895079","LevelValue":"900","LogMessage":{"Exception":"java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.jboss.weld.servlet.WeldListener","StackTrace":"java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.jboss.weld.servlet.WeldListener
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:960)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:939)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:684)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2105)
    at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1750)
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:294)
    at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:357)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:509)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:227)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:536)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:544)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:540)
    at j
ava.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:539)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:570)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:562)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:561)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1469)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:111)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1851)
    at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:164)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:597)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:484)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:412)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:403)
    at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:233)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
"}}

这些异常现在会重复多次,然后容器尚未启动异常,最后,旧的“自动部署失败”

它在本地部署良好,仅在失败的服务器(OpenShift Linux Pod)上。 这是我在本地成功部署(应用运行)时收到的唯一警告:

WARNUNG:   Could not load service class fish.payara.appserver.roles.api.extension.RolesCDIExtension
WARNUNG:   Could not load service class fish.payara.appserver.roles.api.extension.RolesCDIExtension
WARNUNG:   Could not load service class fish.payara.appserver.roles.api.extension.RolesCDIExtension
Information:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Information:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Information:   WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@Observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
WARNUNG:   The following warnings have been detected: WARNING: Parameter interceptedBean of type javax.enterprise.inject.spi.Bean from private javax.enterprise.inject.spi.Bean org.glassfish.soteria.cdi.LoginToContinueInterceptor.interceptedBean is not resolvable to a concrete type.

WARNUNG:   The following warnings have been detected: WARNING: Parameter interceptedBean of type javax.enterprise.inject.spi.Bean from private javax.enterprise.inject.spi.Bean org.glassfish.soteria.cdi.RememberMeInterceptor.interceptedBean is not resolvable to a concrete type.

WARNUNG:   Class class [Ljava.lang.String; has null package
INFORMATION:   Initializing Soteria 1.1-b01 for context ''
INFORMATION:   Mojarra 2.2.14 (-SNAPSHOT 20170628-1326 unable to get svn info) für Kontext '' wird initialisiert.
WARN:   WELD-000718: No EEModuleDescriptor defined for bean archive with ID: XXXXXXXXX_war.war. @Initialized and @Destroyed events for ApplicationScoped may be fired twice.

我尝试了什么:

  • 还原了任何库的所有版本更新
  • 删除了所有启动EJB,最后显示了上述错误
  • 验证配置

预先感谢

保罗

2 个答案:

答案 0 :(得分:0)

该异常很可能是由您的应用程序或配置引起的部署错误。 Payara Server有一个错误,它不会记录原始异常,而只会引发后续异常,因此您无法从日志消息中看到应用程序中的错误。

https://github.com/payara/Payara/issues/2332中描述了记录原始消息的问题。在Payara 5.182中已修复,用户还报告说5.182中的新焊接版本消除了其部署错误。

您可以尝试升级到Payara 5.182。如果不可能,则可以通过调试服务器,在 @Query(value="SELECT SUM(b.transaction_amount)as sum_num FROM bank_copy b WHERE b.copy_order_status=:copy_order_status",nativeQuery=true) double getSumAmountByStatus(@Param("copy_order_status") int copy_order_status); 上放置异常断点并检查异常消息来找出导致部署问题的原因。

答案 1 :(得分:0)

我可以将其固定为Payara版本(docker镜像)。似乎两者之间的更大区别是

sh-4.2$ ./asadmin version
Version = Payara Server  4.1.2.181 #badassfish (build 220)
Command version executed successfully.

哪个工作正常,并且:

sh-4.2$ ./asadmin version
Version = Payara Server  4.1.2.182.1 #badassfish (build 308)
Command version executed successfully.

导致上述错误的原因。到目前为止,我还没有研究细节,只是再次将Payara的版本恢复为4.1.2.181。

免责声明:由于这是docker映像,因此有可能对payara进行了修改,而与payara本身无关。如上所述,我尚未验证。