One thing that seem to be happening is that it will not find any of the properties files.
the files are located in:
EARBASE\WEB-INF\classes
and the program is located in "EARBASE\EJB.jar"
here is a sample of the code:
public void onMessage(Message msg) {
Properties p = new Properties();
InputStream in = this.getClass().getClassLoader().getSystemResourceAsStream("log4j.properties");
try {
if (in != null) {
p.load(in);
} else {
System.out.println("Error Loading Properties file!");
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Enumeration en = p.propertyNames();
while (en.hasMoreElements())
{
System.out.println(p.getProperty((String)en.nextElement()));
}
}
as you can guess, in==null. I have tried all sorts of locations for the properties file and none of them seem to work. This is just the tip of the iceburg of my problems... basically none of the jars used by the EJB seem to be loading.
Originally I was using code that looked like:
public PropertyLoader()
{
ResourceBundle resBundle = ResourceBundle.getBundle("log4j");
props = new Properties();
String key;
String value;
for (Enumeration keys = resBundle.getKeys(); keys.hasMoreElements();) {
key = (String) keys.nextElement();
value = resBundle.getString(key);
props.put(key.toLowerCase(), value);
// log2File.info("Propertie: " + key.toLowerCase() + " = " + value);
//System.out.print("Propertie: " + key.toLowerCase() + " = " + value+ '\n');
}
}
This worked well in WebLogic. I could deploy the properties file inside the EAR, or in the class path for the app. Worked well under weblogic, but does not work under webshere. Throws an error about how it cannot find resource "log4j" (actually that is not the properties file that is really loaded, it just an example, please don't get caught up on the log4j thing).

New Topic/Question
Reply




MultiQuote




|