You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Kruntz <ca...@ottolina.net> on 2009/06/05 03:12:25 UTC

No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

I'm trying to implement a restful http binding service with cxf 2.2.2 and
jetty embedded.
This is what I'm doing:

JAXRSServerFactoryBean sfSoggetto;
sfSoggetto = new JAXRSServerFactoryBean();
sfSoggetto.setResourceClasses(SoggettoService.class);
sfSoggetto.setResourceProvider(SoggettoService.class, new
SingletonResourceProvider(new SoggettoService()));
sfSoggetto.setBindingId(JAXRSBindingFactory.JAXRS_BINDING_ID);
sfSoggetto.setAddress("http://localhost:9000/");
sfSoggetto.create();

I keep getting this error:
org.apache.cxf.BusException: No binding factory for namespace
http://apache.org/cxf/binding/jaxrs registered.

This is the stack trace:
	at
org.apache.cxf.binding.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:91)
	at
org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createBindingInfo(AbstractJAXRSFactoryBean.java:133)
	at
org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpointInfo(AbstractJAXRSFactoryBean.java:113)
	at
org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpoint(AbstractJAXRSFactoryBean.java:159)
	at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:83)

My code is almost identical to the "jax_rs/basic" sample, and I really don't
understand what I'm doing wrong...

Any takers?

Thanks in advance.
-- 
View this message in context: http://www.nabble.com/No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23880630.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Daniel Kulp <dk...@apache.org>.
On Tue June 9 2009 10:27:10 am Sergey Beryozkin wrote:
> Hi,
>
> so it looks like it's all sorted out then :-)
>
> > Do you think com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize applies
> > to my configuration only?

Possibly.   The "optimized" version basically generates some inner classes "in 
memory" using some byte code magic to access the fields and setters without 
the use of reflection.   That allows the GIT to compile them down and such 
which can be much faster.

HOWER, in some cases, a security manager can block that.   Also, since it has 
to end up calling defineClass on the classloader and such to add the classes 
to the classloader, if the classloader doesn't allow it, that can cause 
issues.    Thus, the flag to turn it off.

In CXF, we actually do similar things for JAX-WS/JAXB.   If you DON'T have 
wrapper types for you methods, we'll generate wrapper types in memory.   Also, 
we generate helpers to pull information in/out of wrapper types as needed 
without the reflections.     However, we also have Reflection based methods of 
doing it if the generation of the in memory classes fails.

Dan



>
> I honestly don't know. I think JAXB can be a very 'delicate' technology
> sometimes, despite being helpful often enough... May be some of the JAXB
> experts on this list can clarify, otherwise you might want to ping the JAXB
> users list.



>
> > (Should I add it to the small HowTo I'll write?)
>
> Yea, please do - it will be somewhat offtopic but in the context of your
> example it will fit well.
>
> cheers, Sergey
>
> > Sergey Beryozkin-2 wrote:
> >> I think it's a JAXB issue now. Can you post this class (as a similar
> >> sample class) ?
> >
> > Done. Attached.
> > Sorry for the italian...
> >
> > Sergey Beryozkin-2 wrote:
> >> May be setting
> >> -Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize
> >
> > This solved the issue.
> > Now it works perfectly.
> > Do you think com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize applies
> > to my configuration only?
> > (Should I add it to the small HowTo I'll write?)
> >
> > http://www.nabble.com/file/p23943842/Soggetto.java Soggetto.java
> > --
> > View this message in context:
> > http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace
> >-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23943842.htm
> >l Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

RE: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Sergey Beryozkin <se...@iona.com>.
Hi Carlo,

finally, after a month or so, I added a new section :-)

http://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS#JAX-RS-ConfiguringJAXRSservicesprogrammaticallywithoutSpring

I also updated a 'configuring JAXB provider' section with advice about using
'no optimize' property

cheers, Sergey


Sergey Beryozkin-2 wrote:
> 
> Hi Carlo
> 
> Thanks a lot, I will do
> Cheers, Sergey
> 
> -----Original Message-----
> From: Kruntz [mailto:carlo@ottolina.net] 
> Sent: 09 June 2009 17:38
> To: users@cxf.apache.org
> Subject: Re: [CXF-2.2.2][JAXRS] No binding factory for namespace
> http://apache.org/cxf/binding/jaxrs registered.
> 
> 
> Sergey,
> Since I don't have write privileges to
> http://cwiki.apache.org/CXF20DOC/jax-rs.html, I attached a small blob of
> text that could be added after the "Configuring JAX-RS services
> programmatically" paragraph.
> Would you add it?
> (Please, feel free to modify it as you like.)
> 
> Cheers.
> 
> ---
> Carlo Ottolina
> http://www.nabble.com/file/p23946702/JAXRS%2Bwith%2BJetty%2Bembedded
> JAXRS+with+Jetty+embedded 
> -- 
> View this message in context:
> http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespac
> e-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23946702.
> html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p24261525.html
Sent from the cxf-user mailing list archive at Nabble.com.


RE: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi Carlo

Thanks a lot, I will do
Cheers, Sergey

-----Original Message-----
From: Kruntz [mailto:carlo@ottolina.net] 
Sent: 09 June 2009 17:38
To: users@cxf.apache.org
Subject: Re: [CXF-2.2.2][JAXRS] No binding factory for namespace
http://apache.org/cxf/binding/jaxrs registered.


Sergey,
Since I don't have write privileges to
http://cwiki.apache.org/CXF20DOC/jax-rs.html, I attached a small blob of
text that could be added after the "Configuring JAX-RS services
programmatically" paragraph.
Would you add it?
(Please, feel free to modify it as you like.)

Cheers.

---
Carlo Ottolina
http://www.nabble.com/file/p23946702/JAXRS%2Bwith%2BJetty%2Bembedded
JAXRS+with+Jetty+embedded 
-- 
View this message in context:
http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespac
e-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23946702.
html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Kruntz <ca...@ottolina.net>.
Sergey,
Since I don't have write privileges to
http://cwiki.apache.org/CXF20DOC/jax-rs.html, I attached a small blob of
text that could be added after the "Configuring JAX-RS services
programmatically" paragraph.
Would you add it?
(Please, feel free to modify it as you like.)

Cheers.

---
Carlo Ottolina
http://www.nabble.com/file/p23946702/JAXRS%2Bwith%2BJetty%2Bembedded
JAXRS+with+Jetty+embedded 
-- 
View this message in context: http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23946702.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi,

so it looks like it's all sorted out then :-)

> Do you think com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize applies to
> my configuration only?

I honestly don't know. I think JAXB can be a very 'delicate' technology sometimes, despite being helpful often enough...
May be some of the JAXB experts on this list can clarify, otherwise you might want to ping the JAXB users list.

> (Should I add it to the small HowTo I'll write?)

Yea, please do - it will be somewhat offtopic but in the context of your example it will fit well.

cheers, Sergey

>
>
> Sergey Beryozkin-2 wrote:
>>
>> I think it's a JAXB issue now. Can you post this class (as a similar
>> sample class) ?
>>
>
> Done. Attached.
> Sorry for the italian...
>
>
> Sergey Beryozkin-2 wrote:
>>
>> May be setting
>> -Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize
>>
>
> This solved the issue.
> Now it works perfectly.
> Do you think com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize applies to
> my configuration only?
> (Should I add it to the small HowTo I'll write?)
>
> http://www.nabble.com/file/p23943842/Soggetto.java Soggetto.java
> -- 
> View this message in context: 
> http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23943842.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Kruntz <ca...@ottolina.net>.

Sergey Beryozkin-2 wrote:
> 
> I think it's a JAXB issue now. Can you post this class (as a similar
> sample class) ?
> 

Done. Attached.
Sorry for the italian...


Sergey Beryozkin-2 wrote:
> 
> May be setting
> -Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize
> 

This solved the issue.
Now it works perfectly.
Do you think com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize applies to
my configuration only?
(Should I add it to the small HowTo I'll write?)

http://www.nabble.com/file/p23943842/Soggetto.java Soggetto.java 
-- 
View this message in context: http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23943842.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi

>>
>> and NPE went away - please try it.
>>
>
> Done, it works, another step beyond...

great

> Now, I get an error while unmarshalling:
> java.lang.IllegalAccessError: tried to access class
> com.sun.xml.bind.v2.runtime.reflect.opt.Const from class
> it.exadata.gr.ws.Soggetto$JaxbAccessorM_isProduttore_setProduttore_boolean
>
> (it.exadata.gr.Soggetto is my XmlRootElement class...)

I think it's a JAXB issue now. Can you post this class (as a similar sample class) ?
May be setting

-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize

can help ? (I'm just really guessing here)
thanks, Sergey

> Stack trace follows.
>
>
> Sergey Beryozkin-2 wrote:
>>
>>> > If I can solve this, I could try to write a small howto...
>>
>> Please do - would you like to add a section to
>> http://cwiki.apache.org/CXF20DOC/jax-rs.html ?
>>
>
> I'll do it.
> Thanks for your invaluable support!
>
> -------------- Stack trace:
> at
> it.exadata.gr.ws.Soggetto$JaxbAccessorM_isProduttore_setProduttore_boolean.set(MethodAccessor_Boolean.java:59)
> at com.sun.xml.bind.v2.runtime.reflect.Accessor.receive(Accessor.java:171)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(UnmarshallingContext.java:492)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.endElement(SAXConnector.java:145)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
> at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:211)
> at
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:184)
> at
> javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
> at
> javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
> at
> org.apache.cxf.jaxrs.provider.JAXBElementProvider.unmarshalFromInputStream(JAXBElementProvider.java:156)
> at
> org.apache.cxf.jaxrs.provider.JAXBElementProvider.doUnmarshal(JAXBElementProvider.java:151)
> at
> org.apache.cxf.jaxrs.provider.JAXBElementProvider.readFrom(JAXBElementProvider.java:126)
> at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:827)
> at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:470)
> at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:435)
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:194)
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:65)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:265)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:324)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>
> -- 
> View this message in context: 
> http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23942984.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Kruntz <ca...@ottolina.net>.

Sergey Beryozkin-2 wrote:
> 
> I updated the code like this :
> 
> JAXRSBindingFactory factory = new JAXRSBindingFactory();
> factory.setBus(bean.getBus());
> manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID,
> factory);
> 
> and NPE went away - please try it.
> 

Done, it works, another step beyond...
Now, I get an error while unmarshalling:
java.lang.IllegalAccessError: tried to access class
com.sun.xml.bind.v2.runtime.reflect.opt.Const from class
it.exadata.gr.ws.Soggetto$JaxbAccessorM_isProduttore_setProduttore_boolean

(it.exadata.gr.Soggetto is my XmlRootElement class...)
Stack trace follows.


Sergey Beryozkin-2 wrote:
> 
>> > If I can solve this, I could try to write a small howto...
> 
> Please do - would you like to add a section to
> http://cwiki.apache.org/CXF20DOC/jax-rs.html ?
> 

I'll do it.
Thanks for your invaluable support!

-------------- Stack trace:
	at
it.exadata.gr.ws.Soggetto$JaxbAccessorM_isProduttore_setProduttore_boolean.set(MethodAccessor_Boolean.java:59)
	at com.sun.xml.bind.v2.runtime.reflect.Accessor.receive(Accessor.java:171)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(UnmarshallingContext.java:492)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.endElement(SAXConnector.java:145)
	at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
	at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
	at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
	at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
	at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
	at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
	at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
	at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:211)
	at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:184)
	at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
	at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
	at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.unmarshalFromInputStream(JAXBElementProvider.java:156)
	at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.doUnmarshal(JAXBElementProvider.java:151)
	at
org.apache.cxf.jaxrs.provider.JAXBElementProvider.readFrom(JAXBElementProvider.java:126)
	at
org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:827)
	at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:470)
	at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:435)
	at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:194)
	at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:65)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:89)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:265)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
	at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
	at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
	at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)

-- 
View this message in context: http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23942984.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi

I updated the code like this :

>> manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID, new
>> JAXRSBindingFactory())

JAXRSBindingFactory factory = new JAXRSBindingFactory();
factory.setBus(bean.getBus());
manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID, factory);

and NPE went away - please try it.

> > If I can solve this, I could try to write a small howto...

Please do - would you like to add a section to

http://cwiki.apache.org/CXF20DOC/jax-rs.html ?

or will you send a link once you publish it elsewhere ?

thanks, Sergey

>
>
> Sergey Beryozkin wrote:
>>
>> I think you may be able to overcome it like this, before calling
>> bean.create() :
>>
>> BindingFactoryManager manager =
>> bean.getBus().getExtension(BindingFactoryManager.class);
>> manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID, new
>> JAXRSBindingFactory())
>>
>> give it a try please...
>>
>
> Yeah, the WS now is up.
> Still, I get a java.lang.NullPointerException in method
> ChainInitiationObserver.onMessage(), since "bus" is null.
>
> This is the stacktrace:
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:265)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
> at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:324)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>
> If I can solve this, I could try to write a small howto...
>
> Thanks in advance.
> -- 
> View this message in context: 
> http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23939344.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Kruntz <ca...@ottolina.net>.

Sergey Beryozkin wrote:
> 
> I think you may be able to overcome it like this, before calling
> bean.create() :
> 
> BindingFactoryManager manager =
> bean.getBus().getExtension(BindingFactoryManager.class);
> manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID, new
> JAXRSBindingFactory())
> 
> give it a try please...
> 

Yeah, the WS now is up.
Still, I get a java.lang.NullPointerException in method
ChainInitiationObserver.onMessage(), since "bus" is null.

This is the stacktrace:
	at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:302)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:265)
	at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
	at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
	at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
	at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)

If I can solve this, I could try to write a small howto...

Thanks in advance.
-- 
View this message in context: http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23939344.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Sergey Beryozkin <se...@iona.com>.
Hi,

I think the reason these extensions are not picked up is that you prefer not
to use Spring libraries. I believe spring libraries are pulled in indirectly
in the demo case.

I think you may be able to overcome it like this, before calling
bean.create() :

BindingFactoryManager manager =
bean.getBus().getExtension(BindingFactoryManager.class);
manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID, new
JAXRSBindingFactory())

give it a try please...

cheers, Sergey



Kruntz wrote:
> 
> 
> Sergey Beryozkin wrote:
>> 
>> Did you get it working ? For some reasons the extensions located on
>> META-INF/cxf are not picked up in your case.
>> Are you using Maven ?
>> 
> 
> No, I'm not using Maven.
> I set up a project in Eclipse whith Jetty embedded and put cxf jars into
> it.
> This is the list of cxf jars I'm using:
> 
> cxf-2.2.2.jar
> jra-1.0-alpha-4.jar
> xml-resolver-1.2.jar
> XmlSchema-1.4.5.jar
> jaxb-impl-2.1.9.jar
> neethi-2.0.4.jar
> wsdl4j-1.6.2.jar
> jsr311-api-1.0.jar
> commons-codec-1.3.jar
> commons-httpclient-3.1.jar
> 
> Using Eclipse plugin "Classpath Helper", I can confirm that META-INF/cxf
> *is* in the classpath of my project.
> 
> Which are the classes and methods where the extensions are loaded? I could
> try to trace it...
> 
> Many thanks for your interest in my problem...
> 
> 

-- 
View this message in context: http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23924981.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Kruntz <ca...@ottolina.net>.

Sergey Beryozkin wrote:
> 
> Did you get it working ? For some reasons the extensions located on
> META-INF/cxf are not picked up in your case.
> Are you using Maven ?
> 

No, I'm not using Maven.
I set up a project in Eclipse whith Jetty embedded and put cxf jars into it.
This is the list of cxf jars I'm using:

cxf-2.2.2.jar
jra-1.0-alpha-4.jar
xml-resolver-1.2.jar
XmlSchema-1.4.5.jar
jaxb-impl-2.1.9.jar
neethi-2.0.4.jar
wsdl4j-1.6.2.jar
jsr311-api-1.0.jar
commons-codec-1.3.jar
commons-httpclient-3.1.jar

Using Eclipse plugin "Classpath Helper", I can confirm that META-INF/cxf
*is* in the classpath of my project.

Which are the classes and methods where the extensions are loaded? I could
try to trace it...

Many thanks for your interest in my problem...

-- 
View this message in context: http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23924351.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: [CXF-2.2.2][JAXRS] No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered.

Posted by Sergey Beryozkin <se...@iona.com>.
Hi,

sorry for a delay, I was on a break for 2 weeks and though I did check
emails, I missed this one. Did you get it working ? For some reasons the
extensions located on META-INF/cxf are not picked up in your case.

Are you using Maven ? If yes then may be you can check if there's any
difference in your own pom and the one shipped with the demo ?

cheers, Sergey



Kruntz wrote:
> 
> I'm trying to implement a restful http binding service with cxf 2.2.2 and
> jetty embedded.
> This is what I'm doing:
> 
> JAXRSServerFactoryBean sfSoggetto;
> sfSoggetto = new JAXRSServerFactoryBean();
> sfSoggetto.setResourceClasses(SoggettoService.class);
> sfSoggetto.setResourceProvider(SoggettoService.class, new
> SingletonResourceProvider(new SoggettoService()));
> sfSoggetto.setBindingId(JAXRSBindingFactory.JAXRS_BINDING_ID);
> sfSoggetto.setAddress("http://localhost:9000/");
> sfSoggetto.create();
> 
> I keep getting this error:
> org.apache.cxf.BusException: No binding factory for namespace
> http://apache.org/cxf/binding/jaxrs registered.
> 
> This is the stack trace:
> 	at
> org.apache.cxf.binding.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:91)
> 	at
> org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createBindingInfo(AbstractJAXRSFactoryBean.java:133)
> 	at
> org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpointInfo(AbstractJAXRSFactoryBean.java:113)
> 	at
> org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.createEndpoint(AbstractJAXRSFactoryBean.java:159)
> 	at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:83)
> 
> My code is almost identical to the "jax_rs/basic" sample, and I really
> don't understand what I'm doing wrong...
> 
> Any takers?
> 
> Thanks in advance.
> 

-- 
View this message in context: http://www.nabble.com/-CXF-2.2.2--JAXRS--No-binding-factory-for-namespace-http%3A--apache.org-cxf-binding-jaxrs-registered.-tp23880630p23923551.html
Sent from the cxf-user mailing list archive at Nabble.com.