javax.xml.bind.ContextFinder.find throwing NullPointerException when JAXWS EJB is trying to do JAXBContext.newInstance during deployment in JBoss EAP
Issue
Our JAXWS ear application is failing to deploy with the NullPointerException (NPE) shown below.
The example.ear/example-ws.jar has an ExampleWSEJB which when created creates a new ExampleObjectFactory which tries to load the package com.jboss.examples.services.data.generated package whose classes are contained in example.ear/lib/generated.jar. We are using JAXB directly in order to do validation against an xsd schema.
5071 Caused by: java.lang.NullPointerException
5072 at javax.xml.bind.ContextFinder.find(ContextFinder.java:280)
5073 at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:412)
5074 at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:375)
5075 at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:279)
5076 at com.jboss.examples.services.util.ExampleObjectFactory.<init>(ExampleObjectFactory.java:123)
5077 at com.jboss.examples.services.ExampleWSEJB.<init>(ExampleWSEJB.java:12)
5078 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
5079 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
5080 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
5081 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
5082 at java.lang.Class.newInstance(Class.java:442)
5083 at org.jboss.wsf.stack.cxf.configuration.BusHolder.newInstance(BusHolder.java:321)
5084 ... 10 more
Environment
Red Hat JBoss Enterprise Application Platform (EAP) 7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.