As the title says, how do I load the login-config.xml file under jboss-4.2.3.GA\server\default\conf\ using DeltaSpike?

The following gives a NullPointerException when trying to do properties.toString() (JBoss starts fine):

@InjectableResource(location="/login-config.xml")
private Properties properties;

I've also tried javax.annotation.Resource, which gives a NullPointerException with JndiUtil.lookup(), when JBoss starts up:

@Resource(mappedName="login-config.xml")
private Properties properties;

Exception:

2021-10-14 14:29:52,420 [http-127.0.0.1-8443-5] ERROR [STDERR] 0 more
Caused by: java.lang.NullPointerException
    at org.jboss.ejb3.JndiUtil.lookup(JndiUtil.java:49)
    at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:87)
    at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:112)
    at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:107)
    at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:65)

Thank you in advance.

0

There are 0 best solutions below