Reputation: 269
Getting the bellow error when launching my application using websphere 8.5.5.9
W com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource org/hibernate/proxy/pojo/javassist/JavassistProxyFactory$2.class in archive WEB-INF/lib/hibernate-core-5.1.0.Final.jar
java.lang.RuntimeException
at org.objectweb.asm.MethodVisitor.visitParameter(Unknown Source)
at org.objectweb.asm.ClassReader.b(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
W com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource org/hibernate/bytecode/enhance/spi/Enhancer$1.class in archive WEB-INF/lib/hibernate-core-5.1.0.Final.jar
java.lang.RuntimeException
at org.objectweb.asm.MethodVisitor.visitParameter(Unknown Source)
at org.objectweb.asm.ClassReader.b(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at com.ibm.ws.ecs.internal.scan.impl.ClassScanner.scanInputStream(ClassScanner.java:149)
Java version set up as server jdk is 1.8
Upvotes: 0
Views: 6698
Reputation: 21
I had the similar issue with log4j2 jar files log4j-core-2.19.0.jar & log4j-slf4j-impl-2.19.0.jar etc.
Upgrading the WebSphere version from 8.5.5.9 to 8.5.5.18 resolved the issue. The scanJAR runtime error never appeared again.
Upvotes: 1
Reputation: 373
This is a known problem that is fixed in PI60902. Though your description of the problem is not an exact match, the ifix should fix the problem. The ifix is included in 8.5.5.11.
WAS added JDK 8 in 8.5.5.9 and also added a new ASM 5 library that supports reading Java 8 classes. However, WAS did not update its ASM API calls to include the Opcodes.ASM5 setting until 8.5.5.11. This means that you cannot include a Java-8-compiled class in your application until you upgrade to 8.5.5.11.
However, the exception you are showing is complaining about the JavassistProxyFactory$2.class in archive WEB-INF/lib/hibernate-core-5.1.0.Final.jar which is not compiled in Java 8. So that is not exactly the problem.
The problem seems to be that the ASM 5 library is not completely backward compatible. See the visitParameter method:
public void visitParameter(String name, int access) {
if (api < Opcodes.ASM5) {
throw new RuntimeException();
}
if (mv != null) {
mv.visitParameter(name, access);
}
}
So if you fall into that code, then it doesn't matter if you have a Java-8-compiled class in your app.
Prior to PI60902 (included in WAS 8.5.5.11), WAS used the “Opcodes.ASM4” setting. So this problem could potentially occur in 8.5.5.9 or 8.5.5.10. PI60902 upgraded the setting to use “Opcodes.ASM5”. This allows ASM to read Java 8 classes and also avoids the RuntimeException in the MethodVisitor.visitParameter(...) method shown above.
Upvotes: 3