I love you OC4J
Recently our team found out that our deployment environment would use Oracle's OC4J App Server. So, after getting it up and going, I finally started working with it locally; deploying and testing our application.
One of the rest services in our application was returning a 500 response code. To investigate, I navigated to this WAR's application log for a look. I couldn't believe what I found....
The 500 was a result of an everyday NoClassDefFoundError. What blew me away was what OC4J had put in the log. Check it out...
08/04/18 13:41:16.484 10.1.3.1.0 Started
08/04/18 13:41:16.828 safxc-test: 10.1.3.1.0 Started
08/04/18 13:50:43.546 safxc-test: Servlet error
oracle.classloader.util.AnnotatedNoClassDefFoundError:
Missing class: javax.xml.bind.annotation.XmlRootElement
Dependent class: com.sun.ws.rest.impl.streaming.JAXBElementProvider
Loader: safxc-test.web.safxc-test:0.0.0
Code-Source: /C:/JEE/AppServers/oc4j/j2ee/home/applications/safxc-test/safxc-test/WEB-INF/lib/restbeans-impl-R2.jar
Configuration: WEB-INF/lib/ directory in C:\JEE\AppServers\oc4j\j2ee\home\applications\safxc-test\safxc-test\WEB-INF\lib
The missing class is available from the following locations:
1. Code-Source: /C:/JEE/AppServers/oc4j/j2ee/home/applications/safxc/safxc/WEB-INF/lib/jaxb-api-2.0.jar (from WEB-INF/lib/ directory in C:\JEE\AppServers\oc4j\j2ee\home\applications\safxc\safxc\WEB-INF\lib)
This code-source is available in loader safxc.web.safxc:0.0.0.
2. Code-Source: /C:/JEE/AppServers/oc4j/j2ee/home/applications/dashboard/dashboard/WEB-INF/lib/jaxb-api-2.0.jar (from WEB-INF/lib/ directory in C:\JEE\AppServers\oc4j\j2ee\home\applications\dashboard\dashboard\WEB-INF\lib)
This code-source is available in loader dashboard.web.dashboard:0.0.0.
3. Code-Source: /C:/JEE/AppServers/oc4j/j2ee/home/applications/cop/cop/WEB-INF/lib/jaxb-api-2.0.jar (from WEB-INF/lib/ directory in C:\JEE\AppServers\oc4j\j2ee\home\applications\cop\cop\WEB-INF\lib)
This code-source is available in loader cop.web.cop:0.0.0.
4. Code-Source: /C:/JEE/AppServers/oc4j/j2ee/home/applications/resource-discovery-widget-service/resource-discovery-widget-service/WEB-INF/lib/jaxb-api-2.0.jar (from WEB-INF/lib/ directory in C:\JEE\AppServers\oc4j\j2ee\home\applications\resource-discovery-widget-service\resource-discovery-widget-service\WEB-INF\lib)
This code-source is available in loader resource-discovery-widget-service.web.resource-discovery-widget-service:0.0.0.
at .... STACK TRACE WAS HERE ....
That's right! Unreal! In some beautiful, very readable output, it ...
- Tells you the exact class that is missing (outside of the stack trace)
- Tells you the dependent class
- Tells you what artifact contains the dependent class
- Tells you where you can go find the missing class !!!!
If I haven't said it already ... this is awesome. I can't wait to see what else is in store for me.