My interface and implementation class are following somehow this schema,
especially about the JAX-RS annotations. I have @Path @GET @Produces in the
interface and this lead to the NPE inside the impl class

http://extreme-java.blogspot.it/2011/04/rest-webservice-using-cxf-first.html

If I move the annotations to the impl class I get the "415 Unsupported
Media Type"

On Fri, Sep 14, 2012 at 6:17 PM, Luca Merolla <[email protected]>wrote:

> Now the request doesn't reach the method and I get:
>
> No message body reader has been found for request class SecurityContext,
> ContentType : application/json
>
>
> On Fri, Sep 14, 2012 at 6:00 PM, Romain Manni-Bucau <[email protected]
> > wrote:
>
>> did it already work?
>>
>> honestly i'm not sure you can do it this way, cxf seems to expect the impl
>> to be decorated by jaxrs annotations
>>
>> *Romain Manni-Bucau*
>> *Twitter: @rmannibucau*
>> *Blog: http://rmannibucau.wordpress.com*
>>
>>
>>
>>
>> 2012/9/14 Luca Merolla <[email protected]>
>>
>> > I have the @Path on the interface implemented by the class. Anyway I'll
>> > give a try with it, but the NPE is getting at
>> >
>> > Caused by: java.lang.NullPointerException at
>> >
>> >
>> org.pokernuvola.portone.service.LobbyResourceImpl.getUserCash(LobbyResourceImpl.java:35
>> >
>> > where I have:
>> >
>> > userBO.getUserCash(sec.getUserPrincipal().getName());
>> >
>> > and userBO is injected in this way:
>> >
>> > @Inject private UserBO userBO;
>> >
>> > On Fri, Sep 14, 2012 at 5:28 PM, Romain Manni-Bucau
>> > <[email protected]>wrote:
>> >
>> > > BTW you didnt put @Path on the class (impl), i think that's the issue
>> (i
>> > > currently have some envrt issues but will try to test asap)
>> > >
>> > >
>> > > *Romain Manni-Bucau*
>> > > *Twitter: @rmannibucau*
>> > > *Blog: http://rmannibucau.wordpress.com*
>> > >
>> > >
>> > >
>> > >
>> > > 2012/9/14 Luca Merolla <[email protected]>
>> > >
>> > > > Tested on a "vanilla" tomee, sorry again.
>> > > >
>> > > > *
>> > > >
>> > > >
>> > >
>> >
>> http://www.fileconvoy.com/dfl.php?id=g99869b3ea67bb42614697354a49a4dafb6f061
>> > > > *
>> > > >
>> > > >
>> > > > On Fri, Sep 14, 2012 at 4:55 PM, Romain Manni-Bucau
>> > > > <[email protected]>wrote:
>> > > >
>> > > > > no big luck neither : java.lang.ClassNotFoundException:
>> > > > > org.pokernuvola.common.exceptions.WebException
>> > > > >
>> > > > > *Romain Manni-Bucau*
>> > > > > *Twitter: @rmannibucau*
>> > > > > *Blog: http://rmannibucau.wordpress.com*
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > 2012/9/14 Luca Merolla <[email protected]>
>> > > > >
>> > > > > > Sorry, I forgot to remove the dependecy from an external
>> library.
>> > > > > > This will work:
>> > > > > >
>> > > > > > *
>> > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://www.fileconvoy.com/dfl.php?id=g171e46e07f233f55146959737bf1b4b313d9ab
>> > > > > > *
>> > > > > >
>> > > > > > On Fri, Sep 14, 2012 at 4:25 PM, Romain Manni-Bucau
>> > > > > > <[email protected]>wrote:
>> > > > > >
>> > > > > > > i get a java.lang.ClassNotFoundException:
>> > > > > > > org.pokernuvola.remote.dto.UserDTO
>> > > > > > >
>> > > > > > > *Romain Manni-Bucau*
>> > > > > > > *Twitter: @rmannibucau*
>> > > > > > > *Blog: http://rmannibucau.wordpress.com*
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > > 2012/9/14 Luca Merolla <[email protected]>
>> > > > > > >
>> > > > > > > > This is the war I'm using to test it:
>> > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> http://www.fileconvoy.com/dfl.php?id=gcb83703dbc6be56814694269bb1ac6942c58de
>> > > > > > > >
>> > > > > > > > the URI is GET -
>> > > > > http://localhost:8080/pn-portone/rest/lobby/usercash
>> > > > > > > >
>> > > > > > > > On Fri, Sep 14, 2012 at 3:16 PM, Romain Manni-Bucau
>> > > > > > > > <[email protected]>wrote:
>> > > > > > > >
>> > > > > > > > > do you have binary to share to make it easy to reproduce?
>> > > > > > > > >
>> > > > > > > > > *Romain Manni-Bucau*
>> > > > > > > > > *Twitter: @rmannibucau*
>> > > > > > > > > *Blog: http://rmannibucau.wordpress.com*
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > > 2012/9/14 Luca Merolla <[email protected]>
>> > > > > > > > >
>> > > > > > > > > > Tried with apache-tomee-1.1.0-20120914.040953-134-plus
>> and
>> > I
>> > > > was
>> > > > > > > still
>> > > > > > > > > get
>> > > > > > > > > > the same exception.
>> > > > > > > > > >
>> > > > > > > > > > I had to put it back
>> > > > > > > > > > the
>> org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet
>> > > > > > > configuration
>> > > > > > > > > in
>> > > > > > > > > > the web.xml to make it work.
>> > > > > > > > > >
>> > > > > > > > > > Anyway, injection does not still work. :(
>> > > > > > > > > >
>> > > > > > > > > > On Fri, Sep 14, 2012 at 12:03 PM, Romain Manni-Bucau
>> > > > > > > > > > <[email protected]>wrote:
>> > > > > > > > > >
>> > > > > > > > > > > just redeployed a snapshot,
>> > > > > > > > > > >
>> > > > > > > > > > > maybe you can give it a try
>> > > > > > > > > > >
>> > > > > > > > > > > *Romain Manni-Bucau*
>> > > > > > > > > > > *Twitter: @rmannibucau*
>> > > > > > > > > > > *Blog: http://rmannibucau.wordpress.com*
>> > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > > > 2012/9/14 Luca Merolla <[email protected]>
>> > > > > > > > > > >
>> > > > > > > > > > > > Sorry I forgot to add the servlet that extends
>> > > Application
>> > > > in
>> > > > > > the
>> > > > > > > > > > > web.xml.
>> > > > > > > > > > > >
>> > > > > > > > > > > > Now I dont get the 404 anymore but I get a 500
>> error.
>> > > > > > > > > > > >
>> > > > > > > > > > > > java.lang.NullPointerException
>> > > > > > > > > > > >
>> > > > > > > >
>> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
>> > > > > > > > > > > >
>> > > > java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1629)
>> > > > > > > > > > > >
>> > > > java.lang.ClassLoader.loadClass(ClassLoader.java:295)
>> > > > > > > > > > > >
>> > > > java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:461)
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > >
>> > > > > >
>> > > >
>> >
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>> > > > > > > > > > > >         java.lang.Thread.run(Thread.java:662)
>> > > > > > > > > > > >
>> > > > > > > > > > > > On Fri, Sep 14, 2012 at 11:07 AM, Romain Manni-Bucau
>> > > > > > > > > > > > <[email protected]>wrote:
>> > > > > > > > > > > >
>> > > > > > > > > > > > > hmm
>> > > > > > > > > > > > >
>> > > > > > > > > > > > > we had some regressions last few days. It is fixed
>> > now,
>> > > > > maybe
>> > > > > > > the
>> > > > > > > > > > > > snapshot
>> > > > > > > > > > > > > didnt get the fixes (surely BTW, we don't compile
>> > > anymore
>> > > > > > > because
>> > > > > > > > > we
>> > > > > > > > > > > need
>> > > > > > > > > > > > > an openwebbeans snapshot to get deployed).
>> > > > > > > > > > > > >
>> > > > > > > > > > > > > *Romain Manni-Bucau*
>> > > > > > > > > > > > > *Twitter: @rmannibucau*
>> > > > > > > > > > > > > *Blog: http://rmannibucau.wordpress.com*
>> > > > > > > > > > > > >
>> > > > > > > > > > > > >
>> > > > > > > > > > > > >
>> > > > > > > > > > > > >
>> > > > > > > > > > > > > 2012/9/14 Luca Merolla <[email protected]>
>> > > > > > > > > > > > >
>> > > > > > > > > > > > > > I have downloaded the snapshots from the 13th of
>> > > > > September.
>> > > > > > > > > > > > > >
>> > > > > > > > > > > > > > I have changed the web.xml. Basically I have
>> > removed
>> > > > > > > everything
>> > > > > > > > > > > except
>> > > > > > > > > > > > > > the security-constraint tag where I have set the
>> > > BASIC
>> > > > > > > > > auth-method.
>> > > > > > > > > > > > > >
>> > > > > > > > > > > > > > I have the classes which extends Appplication
>> where
>> > > I'm
>> > > > > > > adding
>> > > > > > > > > the
>> > > > > > > > > > > > > resource
>> > > > > > > > > > > > > > classes
>> > > > > > > > > > > > > >
>> > > > > > > > > > > > > > public class PortoneApplication extends
>> > Application {
>> > > > > > > > > > > > > > @Override
>> > > > > > > > > > > > > > public Set<Class<?>> getClasses() {
>> > > > > > > > > > > > > > Set<Class<?>> classes = new HashSet<Class<?>>();
>> > > > > > > > > > > > > > classes.add(UserResourceImpl.class);
>> > > > > > > > > > > > > > classes.add(AccountResourceImpl.class);
>> > > > > > > > > > > > > > return classes;
>> > > > > > > > > > > > > > }
>> > > > > > > > > > > > > > }
>> > > > > > > > > > > > > >
>> > > > > > > > > > > > > > But now I get 404 for every request. Am I
>> missing
>> > > > > something
>> > > > > > > in
>> > > > > > > > > the
>> > > > > > > > > > > > > > configuration?
>> > > > > > > > > > > > > >
>> > > > > > > > > > > > > > On Mon, Sep 10, 2012 at 8:28 AM, Romain
>> Manni-Bucau
>> > > > > > > > > > > > > > <[email protected]>wrote:
>> > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > ok so first you shouldn't need
>> > > > >  CXFNonSpringJaxrsServlet
>> > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > then i'll fix an issue we have with jaxrs
>> (due to
>> > > > > jersey
>> > > > > > > > work)
>> > > > > > > > > in
>> > > > > > > > > > > the
>> > > > > > > > > > > > > > > following minutes (should be done @ 9am)
>> > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > *Romain Manni-Bucau*
>> > > > > > > > > > > > > > > *Twitter: @rmannibucau*
>> > > > > > > > > > > > > > > *Blog: http://rmannibucau.wordpress.com*
>> > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > 2012/9/10 Luca Merolla <
>> [email protected]>
>> > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > > I'm using the 1.1.0-SNAPSHOT from the 3rd of
>> > > > > September.
>> > > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > > In my web.xml configuration I'm using the
>> > > > > > > > > > > > > > > >
>> > > > org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet
>> > > > > > > > > > > > > > > > class and I have defined a
>> > > javax.ws.rs.Application
>> > > > > > > subclass
>> > > > > > > > > > > where I
>> > > > > > > > > > > > > > > > register the service classes.
>> > > > > > > > > > > > > > > > I have the beans.xml under my WEB-INF
>> folder.
>> > > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > > Then I have an @Inject annotation inside the
>> > > > service
>> > > > > > > > > > > implementation
>> > > > > > > > > > > > > > class
>> > > > > > > > > > > > > > > > which returns a null.
>> > > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > > On Mon, Sep 10, 2012 at 12:06 AM, Romain
>> > > > Manni-Bucau
>> > > > > > > > > > > > > > > > <[email protected]>wrote:
>> > > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > > > Did you try the snapshot?
>> > > > > > > > > > > > > > > > > Le 9 sept. 2012 23:22, "Luca Merolla" <
>> > > > > > > > > > [email protected]>
>> > > > > > > > > > > a
>> > > > > > > > > > > > > > > écrit :
>> > > > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > > > > Hello,
>> > > > > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > > > > I have a REST application that I'm
>> trying
>> > to
>> > > > > > > configure
>> > > > > > > > to
>> > > > > > > > > > > work
>> > > > > > > > > > > > > with
>> > > > > > > > > > > > > > > > CXF.
>> > > > > > > > > > > > > > > > > Is
>> > > > > > > > > > > > > > > > > > it possible that CDI inject is not
>> > supported
>> > > on
>> > > > > the
>> > > > > > > > REST
>> > > > > > > > > > > > service
>> > > > > > > > > > > > > > > > classes
>> > > > > > > > > > > > > > > > > or
>> > > > > > > > > > > > > > > > > > I'm missing something?
>> > > > > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > > > > Luca
>> > > > > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > > > >
>> > > > > > > > > > > > > > >
>> > > > > > > > > > > > > >
>> > > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > > > --
>> > > > > > > > > > > >    *Luca Merolla*
>> > > > > > > > > > > > Management, Business & Technology Consultant
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > > >  <http://maps.google.com/maps?q=&hl=en>  *Mobile:*
>> > > > > > +393774569974
>> > > > > > > > > > > > *Email:* [email protected]
>> > > > > > > > > > > >  *http://nl.linkedin.com/in/lucamerolla*
>> > > > > > > > > > > > *Blog <http://lucamerolla.wordpress.com>*
>> > > > > > > > > > > >
>> > > > > > > > > > > >
>> > > > > > > > > > > > Merolla Consulting Limited
>> > > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > >
>> > > >
>>
>


-- 
   *Luca Merolla*
Management, Business & Technology Consultant


 <http://maps.google.com/maps?q=&hl=en>  *Mobile:* +393774569974
*Email:* [email protected]
 *http://nl.linkedin.com/in/lucamerolla*
*Blog <http://lucamerolla.wordpress.com>*


Merolla Consulting Limited

Reply via email to