users@glassfish.java.net

How to inject a resource-env-rev using PrimitivesAndStringFactory

From: <forums_at_java.net>
Date: Thu, 5 Jan 2012 15:13:05 -0600 (CST)

In the GlassFish console, you can create a custom JNDI resource using the
factory called
"org.glassfish.resources.custom.factory.PrimitivesAndStringFactory". I'd like
to inject this into my EJB using a @Resource annotation:
@Resource(name="config/injectMe") String injectMe; According to the JSR-250
spec, primitives are injected as resource-env-ref. If I create a custom JNDI
resource called "config/injectMe" using the PrimitivesAndStringFactory, I
will not get injection on the above code. What am I doing wrong?

--
[Message sent by forum member 'exabrial']
View Post: http://forums.java.net/node/880498