-1

Why do i get the below error

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

Before the error i get multiple

  Unknow type constant pool 0 at position65

The pool Number and Position Number changes.

When i deploy the ear file it works fine, the error come only after i restart the server (either system or glassfish).

Some help/tips on where to look for the problem will be very usefull.

Update Please find more detail from the log file

[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]]]
Kukeltje
  • 12,223
  • 4
  • 24
  • 47
user1433804
  • 657
  • 5
  • 17
  • 31
  • Please show a full stacktrace – Kukeltje May 20 '15 at 21:22
  • Why -1, what was wrong with my question.There has to be some reason for -ve, you better tell the reason and then give -ve. – user1433804 May 24 '15 at 19:35
  • I **gave** a reason… wow… and it still is -1 since there still is no stacktrace. It should now even be -2 – Kukeltje May 24 '15 at 21:18
  • Oh and the -1 was not from me. But I did add mine to now – Kukeltje May 24 '15 at 21:25
  • What kind of stack trace do you need, as per http://stackoverflow.com/questions/3988788/what-is-a-stack-trace-and-how-can-i-use-it-to-debug-my-application-errors i don't get any error in my code what it shows is something unknown to me (probably stuff from glassfish/java end), do you guys have time to go thru' the 1000's of line of code to find the issue. I think you don't even read what's i said, it works fine when deployed but error comes only after restart of glassfish but just want to -ve vote. – user1433804 May 25 '15 at 18:49
  • Good luck… hope someone takes the time to help you. (AND YES, I (WE?) DID READ YOUR QUESTION) . 3 -1 votes and all you dois complain. Counter effective. Good luck – Kukeltje May 25 '15 at 18:51
  • I am not complaining the same code works in another computer without all the above problem, so there is something missing or going wrong, maybe a depedency or ????. I even tried reinstalling glassfish, i was expecting some clues for looking into the problem, i don't mind getting another 1000 -ve but if you give -ve then you should either known what's the problem or correct me in what i have done wrong in my question. – user1433804 May 25 '15 at 19:07
  • I TRY to help you get to the problem, but as 99.999999% of the world, we are **not** clairvoyant. And downvoting happens if you post bad/incomplete/... questions. Helping you make it better is what I **did**. And no, I have no idea what caused this, since I'm not a GF user. But I'm 100% sure now it is not clearly jsf related (like you suspected because of your tag) and since I look at almost all jsf tagged questions, I tried to help. And the way you reacted does feel like complaining/whining, so please refrain from that if you do not want to scare others of. – Kukeltje May 25 '15 at 19:16
  • Possible duplicate of [JavaEE + Glassfish - BufferUnderflowException](http://stackoverflow.com/questions/28301584/javaee-glassfish-bufferunderflowexception) – flo Feb 06 '16 at 09:55

2 Answers2

1

I had the same problem while working on a Java EE / JSF application as well. While I am not sure of the exact cause, I narrowed it by gradually removing components of the EJB and WAR files and redeploying each time, until reaching a different error.

The problem turned out to be occurring inside one of my EJB classes. I made some minor changes to the class (eg. change loops to functional expressions), rebuilt and after that the deployment went through.

It seems like a bug in the application server because seemingly irrelevant changes to the code made the problem go away.

  • Thanks for your Suggestion, but i reinstalled the OS and glassfish again and configured all the stuffs to get it working. – user1433804 Jul 29 '15 at 19:54
1

When you get such a behaviour it does mean that you should not use higher Java syntax rather than what server environment could offer. For example, lambda expressions from Java 8 could down your deployment on Glassfish 4.1.1

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
rustem.russia
  • 575
  • 5
  • 6