Hello,
I was browsing through the logs the other day and noticed this:
WARN [main] cxf.jaxrs.utils.ResourceUtils (373) - Problem with
processing a user model at
classpath:/org/apache/cxf/systest/jaxrs/resources/resources2.xml
First, I assumed that I wasted your time since the error is that the
resources2.xml simply cannot be found on the classpath... but unfortunatelly
it could.
So I finally downloaded cxf sources and dug down along the stack.
This is what I found inside (cxf-common-utilities-2.2.6.jar,
cxf-rt-frontend-jaxrs-2.2.6.jar):
java.lang.NullPointerException
at java.lang.String.contains(String.java:2103)
at
org.apache.cxf.helpers.DOMUtils.findAllElementsByTagNameNS(DOMUtils.java:603)
at
org.apache.cxf.helpers.DOMUtils.findAllElementsByTagNameNS(DOMUtils.java:608)
at
org.apache.cxf.helpers.DOMUtils.findAllElementsByTagNameNS(DOMUtils.java:596)
at
org.apache.cxf.jaxrs.utils.ResourceUtils.getResourcesFromElement(ResourceUtils.java:401)
at
org.apache.cxf.jaxrs.utils.ResourceUtils.getUserResources(ResourceUtils.java:396)
at
org.apache.cxf.jaxrs.utils.ResourceUtils.getUserResources(ResourceUtils.java:371)
at
org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.setModelRefWithServiceClass(AbstractJAXRSFactoryBean.java:289)
The statement:
if (localName.equals(el.getLocalName()) &&
nameSpaceURI.contains(el.getNamespaceURI())) {
in
org.apache.cxf.helpers.DOMUtils.findAllElementsByTagNameNS(DOMUtils.java:603)
is causing this NullPointerException in the
nameSpaceURI.contains(el.getNamespaceURI()) because NamespaceURI of the el
(in my case that would be "resource" element from user model xml) is null.
I am sorry to bother you guys, but since last time I worked with DOM
directlly was like 8 years ago, am quite puzzled about this error. I
explicitelly set xlmns="http://cxf.apache.org/jaxrs" attribute of 'model'
element. Can someone point me to the reason why the namespace uri in the
parsed DOM Document instance is null?
cheers
reinis
--
View this message in context:
http://old.nabble.com/RESTful-services-without-annotations-tp27637811p27675688.html
Sent from the cxf-user mailing list archive at Nabble.com.