users@glassfish.java.net

Re: Problem using CXF on Glassfish 3.1.1: keep getting the Metro

From: <forums_at_java.net>
Date: Tue, 10 Jan 2012 17:00:02 -0600 (CST)

Andreas,

the structure of the EAR is:

- ejb.jar

- lib

- WAR

The lib directory contains all the necessary libraries, and also a common
application module called commons.jar.

The webapp uses a ServletContextListener to initialize a holder for the
properties read from a properties file. The class ConfigProperties holds the
properties via a static attribute, and both ConfigProperties and the
properties file are in JAR commons.jar in the EAR's lib directory. In the
webapp, the ServletContextListener does the following :

public class LoadPropertiesFiles implements ServletContextListener { public
void contextInitialized(ServletContextEvent arg0) { InputStream inputStream =
this.getClass().getClassLoader().getResourceAsStream("config.properties");
ConfigProperties.getConfigProperties().load(inputStream); }
The ConfigProperties class is then used throughout the application to
retrieve the values of the properties, including from the EJBs.

This works fine when we don't have delegate=false in the glassfish-web.xml
descriptor.

However, when I set delegate=false, a call made from within an EJB to
ConfigProperties.getConfigProperties().getProperty("myProperty") now returns
null, whereas it is working when we don't add the glassfish-web.xml
descriptor containing delegate=false.

 

 


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