当我在warcat上部署我的war文件时,可以,但是当我将其部署在glassfish上时,它给出了例外,我进行了搜索,但没有找到解决该问题的结果。
java.lang.ArrayIndexOutOfBoundsException: 9578
at org.objectweb.asm.ClassReader.readClass(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:363)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:171)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:133)
at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:348)
at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:70)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:307)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:296)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
...............
[#|2018-10-07T15:19:22.345+0330|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=84;_ThreadName=Thread-2;|Exception while loading the app|#]
[#|2018-10-07T15:19:25.182+0330|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=84;_ThreadName=Thread-2;|Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'TestController' defined in file [E:\glassfish3-Reservation\glassfish3\glassfish\domains\domain1\applications\myproject\WEB-INF\classes\com\company\controller\TestController.class]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
答案 0 :(得分:1)
您最好的选择是更新Glassfish服务器。您的版本3.1.2太旧了,当前版本是5.0。
另一种选择是在TestController类中查找Lambda表达式,然后用标准代码删除或替换它们。
当您使用Lambda表达式或版本为asm.jar
的较新Java字节码时,似乎会发生此异常。这与您的旧版Glassfish有关,该旧版Glassfish与Jersey 1.x捆绑在一起,而Jersey 1.x捆绑了asm.jar
3.1。此版本似乎与Java8或更高版本的字节码不完全兼容。
更多相关信息: