[Resteasy-users] How to setup RESTEasy with CDI and Netty?

2013-11-25 Thread Christian Helmbold
Hi!


How can I setup RESTEasy (3.0.5) with CDI and Netty in a Java SE environment?

Simply putting the resteasy-cdi module on the class path doesn't work (as 
suggested in 
http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html_single/index.html#d4e2034).

Here is my startup class:

@Singleton
public class App {

  public void printHello(
  @Observes ContainerInitialized event, @Parameters ListString 
parameters) 
  throws Exception {
    NettyJaxrsServer netty = new NettyJaxrsServer();
    netty.setDeployment(new ResteasyDeployment());
    netty.setPort(8000);
    netty.setRootResourcePath();
    netty.setSecurityDomain(null);
    netty.start();
  }
}

I have a root resource in my example project which should be discovered by weld 
automatically. But if I load the resource I get:
javax.ws.rs.NotFoundException: Could not find resource for full path: 
http://localhost:8000/

I'm using the following libs:


What do I have to do to setup RESTEasy with CDI and Netty (or Undertow would be 
fine too)?


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


Re: [Resteasy-users] How to setup RESTEasy with CDI and Netty?

2013-11-25 Thread Bill Burke
I've never tried using CDI in Java SE.  Really depend on the 
implementation of CDI I suppose.  You'd have to manually set up CDI, 
then set the 
deployment.setInjectorFactoryClass(org.jboss.resteasy.cdi.CdiInjectoryFactory.class.getName());

Also, our impl only works with Weld.

On 11/25/2013 3:49 PM, Christian Helmbold wrote:
 Hi!


 How can I setup RESTEasy (3.0.5) with CDI and Netty in a Java SE environment?

 Simply putting the resteasy-cdi module on the class path doesn't work (as 
 suggested in 
 http://docs.jboss.org/resteasy/docs/3.0.5.Final/userguide/html_single/index.html#d4e2034).

 Here is my startup class:

 @Singleton
 public class App {

public void printHello(
@Observes ContainerInitialized event, @Parameters ListString 
 parameters)
throws Exception {
  NettyJaxrsServer netty = new NettyJaxrsServer();
  netty.setDeployment(new ResteasyDeployment());
  netty.setPort(8000);
  netty.setRootResourcePath();
  netty.setSecurityDomain(null);
  netty.start();
}
 }

 I have a root resource in my example project which should be discovered by 
 weld automatically. But if I load the resource I get:
 javax.ws.rs.NotFoundException: Could not find resource for full path: 
 http://localhost:8000/

 I'm using the following libs:


 What do I have to do to setup RESTEasy with CDI and Netty (or Undertow would 
 be fine too)?


 --
 Shape the Mobile Experience: Free Subscription
 Software experts and developers: Be at the forefront of tech innovation.
 Intel(R) Software Adrenaline delivers strategic insight and game-changing
 conversations that shape the rapidly evolving mobile landscape. Sign up now.
 http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
 ___
 Resteasy-users mailing list
 Resteasy-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/resteasy-users


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com

--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users