【问题标题】:Glassfish error Exception during lifecycle processing java.nio.BufferUnderflowException生命周期处理期间的 Glassfish 错误异常 java.nio.BufferUnderflowException
【发布时间】:2018-01-09 17:11:34
【问题描述】:

为什么会出现以下错误

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]]]

【问题讨论】:

  • 请显示完整的堆栈跟踪
  • 为什么-1,我的问题出了什么问题。-ve 一定有原因,你最好说出原因然后给-ve。
  • 给了一个理由......哇......它仍然是-1,因为仍然没有堆栈跟踪。它现在甚至应该是 -2
  • 哦,-1 不是我的。但我现在确实添加了我的
  • 你需要什么样的堆栈跟踪,根据stackoverflow.com/questions/3988788/…,我的代码中没有任何错误,它显示的是我不知道的东西(可能来自 glassfish/java 端的东西),你们有时间通过​​ 1000 行代码来找到问题吗?我认为您甚至没有阅读我所说的内容,它在部署时工作正常,但仅在 glassfish 重新启动后才会出现错误,但只想 -ve 投票。

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


【解决方案1】:

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

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

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

【讨论】:

  • 感谢您的建议,但我重新安装了操作系统和 glassfish 并配置了所有东西以使其正常工作。
【解决方案2】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-10
    • 2017-12-25
    • 1970-01-01
    • 1970-01-01
    • 2022-08-06
    相关资源
    最近更新 更多