users@glassfish.java.net

Re: Using CDI with ACC in a SE environment

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Wed, 05 Jan 2011 16:13:52 +0530

On Wednesday 05 January 2011 02:39 AM, Antonio Goncalves wrote:
> 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.

As per the CDI specification (Section 12.1), a container is not required
to support application client bean archives and hence we haven't tried
and tested bean archives in application clients.

Could you share your application and the server.log error message?

Thanks
--Siva.

>
> Do I need to do something extra ?
>
> Thanks,
>
> --
> Antonio Goncalves (antonio.goncalves_at_gmail.com
> <mailto:antonio.goncalves_at_gmail.com>)
> Software architect
>
> Web site : www.antoniogoncalves.org <http://www.antoniogoncalves.org>
> Blog: agoncal.wordpress.com <http://agoncal.wordpress.com>
> Feed: feeds2.feedburner.com/AntonioGoncalves
> <http://feeds2.feedburner.com/AntonioGoncalves>
> Paris JUG leader : www.parisjug.org <http://www.parisjug.org>
> LinkedIn: www.linkedin.com/in/agoncal <http://www.linkedin.com/in/agoncal>