tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s0dz <garrett.mct...@gmail.com>
Subject Re: Custom ".properties" file
Date Thu, 12 Jul 2012 16:41:42 GMT
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.

Mime
View raw message