Glassfish错误生命周期处理java.nio.BufferUnderflowException期间的异常

时间:2015-05-20 21:20:27

标签: java-ee jsf-2.2 glassfish-4.1

为什么我会收到以下错误

Exception during lifecycle processing
java.nio.BufferUnderflowException
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:151)
.....

在错误之前我得到多个

  Unknow type constant pool 0 at position65

池编号和位置编号更改。

当我部署ear文件时,它工作正常,只有在我重新启动服务器(系统或glassfish)后才会出现错误。

有关在何处查找问题的一些帮助/提示非常有用。

更新 请从日志文件中找到更多详细信息

[2015-05-21T02:37:14.427+0530] [glassfish 4.1] [SEVERE] [] [javax.enterprise.system.tools.deployment.dol] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1432156029153] [timeMillis: 1432156034427] [levelValue: 1000] [[
Unknow type constant pool 0 at position63]]

[2015-05-21T02:37:14.427+0530] [glassfish 4.1] [SEVERE] [] [javax.enterprise.system.tools.deployment.dol] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1432156029153] [timeMillis: 1432156034427] [levelValue: 1000] [[
 Unknow type constant pool 0 at position65]]

[2015-05-21T02:37:14.427+0530] [glassfish 4.1] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1432156029153] [timeMillis: 1432156034427] [levelValue: 1000] [[
 Exception while deploying the app [TEST_APP]]]

[2015-05-21T02:37:14.428+0530] [glassfish 4.1] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1432156029153] [timeMillis: 1432156034428] [levelValue: 1000] [[
  Exception during lifecycle processing
java.nio.BufferUnderflowException
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:151)
at com.sun.enterprise.deployment.annotation.introspection.ConstantPoolInfo.containsAnnotation(ConstantPoolInfo.java:86)
at com.sun.enterprise.deployment.annotation.introspection.ClassFile.containsAnnotation(ClassFile.java:133)
at com.sun.enterprise.deployment.annotation.introspection.ClassFile.containsAnnotation(ClassFile.java:87)
at com.sun.enterprise.deployment.util.AnnotationDetector.containsAnnotation(AnnotationDetector.java:157)
at com.sun.enterprise.deployment.util.AnnotationDetector.containsAnnotation(AnnotationDetector.java:146)
at com.sun.enterprise.deployment.util.AnnotationDetector.hasAnnotationInArchive(AnnotationDetector.java:137)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.getApplicationFromIntrospection(ApplicationArchivist.java:393)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.createApplication(ApplicationArchivist.java:264)
at org.glassfish.javaee.full.deployment.EarHandler.getApplicationHolder(EarHandler.java:578)
at org.glassfish.javaee.full.deployment.EarHandler.initCompositeMetaData(EarHandler.java:555)
at com.sun.enterprise.v3.server.ApplicationLifecycle.getSniffers(ApplicationLifecycle.java:655)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:358)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:243)
at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:329)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:377)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:461)
at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:227)
at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:84)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2258)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:105)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1162)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1147)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
]]

[2015-05-21T02:37:14.437+0530] [glassfish 4.1] [SEVERE] [NCLS-CORE-00041] [javax.enterprise.system.core] [tid: _ThreadID=16 _ThreadName=RunLevelControllerThread-1432156029153] [timeMillis: 1432156034437] [levelValue: 1000] [[
  Application deployment failed: Exception while deploying the app [TEST_APP]]]

2 个答案:

答案 0 :(得分:1)

我在处理Java EE / JSF应用程序时遇到了同样的问题。虽然我不确定确切的原因,但我通过逐渐删除EJB和WAR文件的组件并每次重新部署来缩小它,直到达到不同的错误。

问题结果发生在我的一个EJB类中。我对类进行了一些小的更改(例如,将循环更改为函数表达式),重新构建,然后部署完成。

这似乎是应用程序服务器中的一个错误,因为看似无关的代码更改使问题消失了。

答案 1 :(得分:0)

当你遇到这样的行为时,它确实意味着你不应该使用更高级的Java语法而不是服务器环境可以提供的语法。例如,Java 8中的lambda表达式可能会降低您在Glassfish 4.1.1上的部署