users@glassfish.java.net

Using CDI with ACC in a SE environment

From: Antonio Goncalves <antonio.mailing_at_gmail.com>
Date: Tue, 4 Jan 2011 22:09:18 +0100

Hi all,

I want to use CDI beans in a SE environment. Using the proprietary Weld API
works fine (the org.jboss.weld.environment.se.StartMain class). But now I
want to use the Application Client Container (ACC). Correct me if I'm wrong,
but the ACC implements CDI, so I shouldn't need to bootstrap the CDI
container with the Weld StartMain class, it should be out of the box, right
?

I have a simple Main class that injects a simple Hello bean. I package this
classes into a .jar with a MANIFEST file declaring Main as the main class
plus the famous bean.xml file. Then I run appclient -jar myCDI.jar but I get
a NullPointerException. I'm using GF 3.0.1.

Do I need to do something extra ?

Thanks,

--
Antonio Goncalves (antonio.goncalves_at_gmail.com)
Software architect
Web site : www.antoniogoncalves.org
Blog: agoncal.wordpress.com
Feed: feeds2.feedburner.com/AntonioGoncalves
Paris JUG leader : www.parisjug.org
LinkedIn: www.linkedin.com/in/agoncal