Can you please system.out the classloader (tccl)? Le 12 juil. 2012 18:42, "s0dz" <garrett.mct...@gmail.com> a écrit :
> We have been able to reproduce this problem by 3 different developers on 3 > different CentOS machines here. We are using Java 1.6.0_29, ActiveMQ > 5.5.1, > and OpenEJB 4.0.0. Here is code that reproduces the issue for us: > > package com.communitect.ejb.business: > > import java.io.IOException; > import java.io.InputStream; > import java.util.Properties; > import javax.ejb.MessageDriven; > import javax.jms.Message; > import javax.jms.MessageListener; > > @MessageDriven( mappedName = "business.DirectMessage" ) > public class DirectMessage implements MessageListener > { > @Override > public void onMessage( Message message ) > { > try > { > Properties p = new Properties(); > InputStream is = > Thread.currentThread().getContextClassLoader().getResourceAsStream( > "common.properties" ); > p.load(is); > System.out.println(p.getProperty( "myPropertyKey" )); > } > catch( IOException e ) > { > System.out.println( e ); > } > } > } > > And the properties file is in the lib directory with "common.properties" as > the title and simply contains: > > myPropertyKey=17 > > We are using a seperate application that is running on tomcat that is > actually placing Direct Messages in the queue. onMessage runs, but will > not > read in a .properties file in correctly. > > Any ideas? > > Thanks! > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656253.html > Sent from the OpenEJB User mailing list archive at Nabble.com. >