Just noticed custom.properties != common.properties, in case that is the
issue :-)

R. A.
On Jul 13, 2012 12:36 AM, "Romain Manni-Bucau" <rmannibu...@gmail.com>
wrote:

> hmm,
>
> can you print getParent() and getURLs() too please?
>
> the appclassloader surprises me a bit, means you are in embedded mode and
> the class is already loaded in appclassloader
>
> - Romain
>
>
> 2012/7/12 s0dz <garrett.mct...@gmail.com>
>
> > Depending on where the
> > "System.out.println(Thread.currentThread().getContextClassLoader());" was
> > affected the output.  Here is the code used:
> >
> > 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
> > {
> >         static
> >         {
> >                 System.out.println("TCCL: ");
> >
> > System.out.println("********************************************");
> >
> > System.out.println(Thread.currentThread().getContextClassLoader());
> >
> > System.out.println("********************************************");
> >         }
> >
> >     @Override
> >     public void onMessage( Message message )
> >     {
> >                         try
> >                         {
> >                                 System.out.println("TCCL: ");
> >
> > System.out.println("********************************************");
> >
> > System.out.println(Thread.currentThread().getContextClassLoader());
> >
> > System.out.println("********************************************");
> >
> >         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 );
> >                         }
> >     }
> > }
> >
> > From the static block:
> >
> > TCCL:
> > ********************************************
> > *sun.misc.Launcher$AppClassLoader@5acac268*
> > ********************************************
> >
> > From the onMessage():
> >
> > TCCL:
> > ********************************************
> > *java.net.URLClassLoader@2ecc5436*
> > ********************************************
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656258.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>

Reply via email to