You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a resource class has static fields, the reflective resolution of the containing class seems to be incorrect, leading to java.lang.ClassNotFoundExceptions being thrown.
Could not access static property, reason: nl.promoir.roomer.pms2.resources.roomtypegroups.RoomTypeRatePlanDefaultsSubResource
java.lang.ClassNotFoundException: nl.promoir.roomer.pms2.resources.roomtypegroups.RoomTypeRatePlanDefaultsSubResource
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.sebastian_daschner.jaxrs_analyzer.analysis.bytecode.collection.InstructionBuilder.getStaticValue(InstructionBuilder.java:293)
at com.sebastian_daschner.jaxrs_analyzer.analysis.bytecode.collection.InstructionBuilder.buildFieldInstruction(InstructionBuilder.java:35)
at com.sebastian_daschner.jaxrs_analyzer.analysis.classes.ProjectMethodVisitor.visitFieldInsn(ProjectMethodVisitor.java:111)
at org.objectweb.asm.ClassReader.a(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.sebastian_daschner.jaxrs_analyzer.analysis.ProjectAnalyzer.analyzeClass(ProjectAnalyzer.java:134)
at com.sebastian_daschner.jaxrs_analyzer.analysis.ProjectAnalyzer.analyze(ProjectAnalyzer.java:105)
at com.sebastian_daschner.jaxrs_analyzer.JAXRSAnalyzer.analyze(JAXRSAnalyzer.java:69)
at com.sebastian_daschner.jaxrs_analyzer.Main.main(Main.java:94)
The CPATH environment variable contains all the jars in the lib dir of the exploded WAR that has been built, plus target/classes just for good measure (and trying to solve the problem).
Just to be clear, the classes that are reportedly not found, do exist:
$> echo nl.promoir.roomer.pms2.resources.roomtypegroups.RoomTypeRatePlanDefaultsSubResource | sed -e 's/\./\//g' | xargs -I{} ls target/classes/{}.class
When a resource class has static fields, the reflective resolution of the containing class seems to be incorrect, leading to java.lang.ClassNotFoundExceptions being thrown.
Example from my project, standalone run:
Could not access static property, reason: nl.promoir.roomer.pms2.resources.roomtypegroups.RoomTypeRatePlanDefaultsSubResource
java.lang.ClassNotFoundException: nl.promoir.roomer.pms2.resources.roomtypegroups.RoomTypeRatePlanDefaultsSubResource
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.sebastian_daschner.jaxrs_analyzer.analysis.bytecode.collection.InstructionBuilder.getStaticValue(InstructionBuilder.java:293)
at com.sebastian_daschner.jaxrs_analyzer.analysis.bytecode.collection.InstructionBuilder.buildFieldInstruction(InstructionBuilder.java:35)
at com.sebastian_daschner.jaxrs_analyzer.analysis.classes.ProjectMethodVisitor.visitFieldInsn(ProjectMethodVisitor.java:111)
at org.objectweb.asm.ClassReader.a(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.sebastian_daschner.jaxrs_analyzer.analysis.ProjectAnalyzer.analyzeClass(ProjectAnalyzer.java:134)
at com.sebastian_daschner.jaxrs_analyzer.analysis.ProjectAnalyzer.analyze(ProjectAnalyzer.java:105)
at com.sebastian_daschner.jaxrs_analyzer.JAXRSAnalyzer.analyze(JAXRSAnalyzer.java:69)
at com.sebastian_daschner.jaxrs_analyzer.Main.main(Main.java:94)
The CPATH environment variable contains all the jars in the lib dir of the exploded WAR that has been built, plus target/classes just for good measure (and trying to solve the problem).
Just to be clear, the classes that are reportedly not found, do exist:
$> echo nl.promoir.roomer.pms2.resources.roomtypegroups.RoomTypeRatePlanDefaultsSubResource | sed -e 's/\./\//g' | xargs -I{} ls target/classes/{}.class
target/classes/nl/promoir/roomer/pms2/resources/roomtypegroups/RoomTypeRatePlanDefaultsSubResource.class
The text was updated successfully, but these errors were encountered: