On 2/24/13 2:06 AM, c.whalley wrote:
> On 24/02/2013 05:49, Dan Ziegelbein wrote:
>> The reason you're getting NPE's is that your instances of APICommand are
>> not themselves injected by the container (you are instantiating them in
>> code somewhere...indicated by the fact that APICommand has a
>> non-injected parameterized constructor).
>>
>> Dan
> Hi Dan & thanks for this,
>
> I looked more at this and realised I need to do as you say, and it seems
> I need Webbeans and the @Component annotation, plus token
> META-INF/web-beans.xml to mark it as so? If that's right, I'm now
> struggling to even get the @Component to resolve - does the webbeans
> package come with Resin or is it an external download?

For Resin 4.0, it's CDI and all the names changed:

the magic file in META-INF/beans.xml in a jar or WEB-INF/beans.xml for 
the WEB-INF/classes. The smallest content of that file "<beans/>".

You don't need an annotation on the bean, but you can use something like 
@javax.inject.Singleton if you want it to be a single instance. The 
default behavior instantiates a new instance of your bean at each 
@Inject point.

-- Scott


>
> -- Carl Whalley
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>


_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to