Hi,
I created a JNDI custom java.lang.String resource named "jndiTest" using the
built-in PrimitivesAndStringFactory. Accessing the resource with the
following code works as expected:
Context ctx = new InitialContext(); String jndiTest = (String)
ctx.lookup("jndiTest"); // prints "jndiTestValue" to log
System.out.println(jndiTest);
However, trying to access the resource via @Resource annotation does not
work, but only for strings and primitives:
@Resource(name="jndiTest") private String jndiTest; private void test() { //
prints "null" to log System.out.println(jndiTest); }
Now comes the weird part: if I change the resource type and the variable type
to Properties (and thus to PropertiesFactory) I can access the resource
without any problems:
@Resource(name="jndiTest") private Properties jndiTest; private void test() {
// prints "{value=jndiTestValue}" to log System.out.println(jndiTest); }
Any ideas how to fix that?
-Marian
--
[Message sent by forum member 'tamm0r']
View Post: http://forums.java.net/node/793961