users@glassfish.java.net

Can't inject RecourceAdapter into JSF Bean

From: <glassfish_at_javadesktop.org>
Date: Sat, 18 Aug 2007 11:40:22 PDT

Hi all,

I'm moving from Servlets to JSF. I can injects EJBs into my JSF beans but no resource adaptors.

In my old servlets I used
@Resource(name="LeechRedda")
private LeechReddaConnectionFactory lrf;

to inject my resource adaptor. Unfortunately when I use that code in my managed bean I get the error message:

Caused by: com.sun.enterprise.InjectionException: Exception attempting to inject Env-Prop: LeechRedda_at_Field-Injectable Resource. Class name = ch.skalender.web.admin.gui.model.page.leech.LeechReddaPage Field name=lrf_at_java.lang.String@@@ into class ch.skalender.web.admin.gui.model.page.leech.LeechReddaPage
        at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:387)
        at com.sun.enterprise.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:206)
        at com.sun.enterprise.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:127)
        at com.sun.faces.vendor.GlassFishInjectionProvider.inject(GlassFishInjectionProvider.java:79)
        at com.sun.faces.config.ManagedBeanFactoryImpl.newInstance(ManagedBeanFactoryImpl.java:298)
        ... 77 more
Caused by: java.lang.IllegalArgumentException
        at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
        at java.lang.reflect.Field.set(Field.java:656)
        at com.sun.enterprise.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:338)
        ... 81 more
|#]

As I said before, EJB injection works find and my code above is in use in other webapps. Therefore the configuration must be ok.

Does anyone has any experience on that topic?

Thanks
Thomas
[Message sent by forum member 'tigarr' (tigarr)]

http://forums.java.net/jive/thread.jspa?messageID=231495