You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by s0dz <ga...@gmail.com> on 2012/07/10 00:03:29 UTC

Custom ".properties" file

I am working on replacing my company's old school framework with an
ActiveMQ/OpenEJB solution.  It has been going smoothly with re-factoring
code and implementing OpenEJB.  This was until I ran into a slight problem:

I cannot figure out how to load in a "custom.properties" that contains
various important properties custom to my company's software.  The .jar that
actually does the accessing is working.  But it appears the classloader is
not finding "custom.properties." 

Any ideas?

Thanks!
Garrett

--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
Ok, thanks!

Is there any idea when 4.1.0 will be released?

I was able to add the properties file to the .jars that needed it for
accessing, but obviously this is not ideal.

Thanks for looking into this!

--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656271.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
https://issues.apache.org/jira/browse/OPENEJB-1865

- Romain


2012/7/13 s0dz <ga...@gmail.com>

> srEJB.jar contains the MDBs we are using.  We are placing that inside the
> apps directory.
>
> Since we have placed the common.properties file in the lib directory,
> should
> the sun.misc.Launcher$AppClassLoader have found that file when we call
> getResourceAsStream()?
>
> Is there any setting in standalone OpenEJB that is preventing this loader
> from loading files named other than  *.jar ( and *.zip)?
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656267.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
srEJB.jar contains the MDBs we are using.  We are placing that inside the
apps directory.

Since we have placed the common.properties file in the lib directory, should
the sun.misc.Launcher$AppClassLoader have found that file when we call
getResourceAsStream()?

Is there any setting in standalone OpenEJB that is preventing this loader
from loading files named other than  *.jar ( and *.zip)?

--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656267.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
appclassloader has lib/*.jar and lib/*.zip, so you see your jar in?

can really get why getResource doesn't work then, classloaders seems fine

- Romain


2012/7/12 s0dz <ga...@gmail.com>

> Static block:
>
> TCCL:
> ********************************************
> sun.misc.Launcher$AppClassLoader@5acac268
> ********************************************
> PARENT:
> ********************************************
> sun.misc.Launcher$ExtClassLoader@35a16869
> ********************************************
> URLs:
> ********************************************
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-core-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-javaagent-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/commons-lang-2.6.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/mbean-annotation-api-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xercesImpl-2.9.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/swizzle-stream-1.6.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/howl-1.0.1-1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xbean-naming-3.10.jar
>
> file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-ee-common-1.1.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/jaxb-impl-2.2.5.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openws-1.4.2-1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/mail.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-web-1.1.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xml-resolver-1.2.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xbean-asm-shaded-3.10.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-cxf-transport-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/commons-pool-1.5.7.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/commons-collections-3.2.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/stax2-api-3.0.2.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/stax-api-1.0-2.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-impl-1.1.4.jar
>
> file:/home/gmctear/apache-openejb-4.0.0/lib/commons-beanutils-core-1.8.3.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/bval-jsr303-0.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/serializer-2.7.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-daemon-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/geronimo-transaction-3.1.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-cxf-bundle-2.5.2.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/serp-1.13.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-multicast-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/postgresql-8.3-607.jdbc4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/quartz-2.1.3.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openjpa-asm-shaded-2.2.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/commons-cli-1.2.jar
>
> file:/home/gmctear/apache-openejb-4.0.0/lib/geronimo-j2ee-connector_1.6_spec-1.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/activemq-protobuf-1.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xbean-finder-shaded-3.10.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-loader-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/saaj-impl-1.3.12.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/mimepull-1.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/activemq-core-5.5.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-ejb-1.1.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/commons-lang3-3.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-ee-1.1.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xmlschema-core-2.0.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xbean-bundleutils-3.10.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/commons-net-3.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/wss4j-1.6.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/slf4j-jdk14-1.6.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xbean-reflect-3.10.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/activemq-ra-5.5.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/srJMSMessages.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/jettison-1.3.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/srbiz.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/log4j-1.2.16.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/wsdl4j-1.6.2.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-cxf-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/scannotation-1.0.2.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xmlsec-1.4.6.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xalan-2.7.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/opensaml-2.5.1-1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-ejbd-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/neethi-3.0.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/commons-logging-1.1.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/kahadb-5.5.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-hsql-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/activeio-core-3.1.2.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/geronimo-connector-3.1.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/javaee-api-6.0-3.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-server-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-client-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-http-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-api-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-jee-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-webservices-4.0.0.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/commons-dbcp-1.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-spi-1.1.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/bval-core-0.4.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/slf4j-api-1.6.4.jar
>
> file:/home/gmctear/apache-openejb-4.0.0/lib/geronimo-javamail_1.4_mail-1.8.2.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/xmltooling-1.3.2-1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/javassist-3.15.0-GA.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/bcprov-jdk15-146.jar
>
> file:/home/gmctear/apache-openejb-4.0.0/lib/geronimo-j2ee-management_1.1_spec-1.0.1.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/woodstox-core-asl-4.0.8.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/joda-time-1.6.2.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/JavaPNS_2.2.jar
> file:/home/gmctear/apache-openejb-4.0.0/lib/hsqldb-2.2.4.jar
> ********************************************
>
> onMessage():
>
> TCCL:
> ********************************************
> java.net.URLClassLoader@207e5619
> ********************************************
> PARENT:
> ********************************************
> sun.misc.Launcher$AppClassLoader@5acac268
> ********************************************
> URLs:
> ********************************************
> file:/home/gmctear/apache-openejb-4.0.0/apps/srEJB.jar
> ********************************************
>
>
> I drop the srEJB.jar into the apps directory and start OpenEJB from the
> command line to deploy.
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656265.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
Static block:

TCCL: 
********************************************
sun.misc.Launcher$AppClassLoader@5acac268
********************************************
PARENT: 
********************************************
sun.misc.Launcher$ExtClassLoader@35a16869
********************************************
URLs: 
********************************************
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-core-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-javaagent-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/commons-lang-2.6.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/mbean-annotation-api-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xercesImpl-2.9.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/swizzle-stream-1.6.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/howl-1.0.1-1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xbean-naming-3.10.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-ee-common-1.1.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/jaxb-impl-2.2.5.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openws-1.4.2-1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/mail.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-web-1.1.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xml-resolver-1.2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xbean-asm-shaded-3.10.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-cxf-transport-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/commons-pool-1.5.7.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/commons-collections-3.2.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/stax2-api-3.0.2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/stax-api-1.0-2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-impl-1.1.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/commons-beanutils-core-1.8.3.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/bval-jsr303-0.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/serializer-2.7.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-daemon-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/geronimo-transaction-3.1.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-cxf-bundle-2.5.2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/serp-1.13.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-multicast-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/postgresql-8.3-607.jdbc4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/quartz-2.1.3.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openjpa-asm-shaded-2.2.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/commons-cli-1.2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/geronimo-j2ee-connector_1.6_spec-1.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/activemq-protobuf-1.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xbean-finder-shaded-3.10.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-loader-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/saaj-impl-1.3.12.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/mimepull-1.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/activemq-core-5.5.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-ejb-1.1.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/commons-lang3-3.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-ee-1.1.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xmlschema-core-2.0.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xbean-bundleutils-3.10.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/commons-net-3.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/wss4j-1.6.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/slf4j-jdk14-1.6.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xbean-reflect-3.10.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/activemq-ra-5.5.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/srJMSMessages.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/jettison-1.3.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/srbiz.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/log4j-1.2.16.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/wsdl4j-1.6.2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-cxf-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/scannotation-1.0.2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xmlsec-1.4.6.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xalan-2.7.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/opensaml-2.5.1-1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-ejbd-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/neethi-3.0.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/commons-logging-1.1.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/kahadb-5.5.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-hsql-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/activeio-core-3.1.2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/geronimo-connector-3.1.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/javaee-api-6.0-3.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-server-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-client-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-http-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-api-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-jee-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openejb-webservices-4.0.0.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/commons-dbcp-1.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/openwebbeans-spi-1.1.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/bval-core-0.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/slf4j-api-1.6.4.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/geronimo-javamail_1.4_mail-1.8.2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/xmltooling-1.3.2-1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/javassist-3.15.0-GA.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/bcprov-jdk15-146.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/geronimo-j2ee-management_1.1_spec-1.0.1.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/woodstox-core-asl-4.0.8.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/joda-time-1.6.2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/JavaPNS_2.2.jar
file:/home/gmctear/apache-openejb-4.0.0/lib/hsqldb-2.2.4.jar
********************************************

onMessage():

TCCL: 
********************************************
java.net.URLClassLoader@207e5619
********************************************
PARENT: 
********************************************
sun.misc.Launcher$AppClassLoader@5acac268
********************************************
URLs: 
********************************************
file:/home/gmctear/apache-openejb-4.0.0/apps/srEJB.jar
********************************************


I drop the srEJB.jar into the apps directory and start OpenEJB from the
command line to deploy.


--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656265.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
hmm is it possible to show urls plz?

Arrays.asList() can help ;)

once again please explain the way you deploy, it seems you are not in tomee
:s

(a sample project can help a lot)

- Romain


2012/7/12 s0dz <ga...@gmail.com>

> Thanks for pointing out about the mixup between custom.properties and
> common.properties.  I was actually testing both at one point.  Niether
> worked.
>
> Here is the other info you requested:
>
> static block:
>
> TCCL:
> ********************************************
> *sun.misc.Launcher$AppClassLoader@5acac268*
> ********************************************
> PARENT:
> ********************************************
> *sun.misc.Launcher$ExtClassLoader@35a16869*
> ********************************************
> URLs:
> ********************************************
> *[Ljava.net.URL;@2a313170*
> ********************************************
>
>
> onMessage():
> TCCL:
> ********************************************
> *java.net.URLClassLoader@595780d9*
> ********************************************
> PARENT:
> ********************************************
> *sun.misc.Launcher$AppClassLoader@5acac268*
> ********************************************
> URLs:
> ********************************************
> *[Ljava.net.URL;@7ec71c00*
> ********************************************
> *java.rmi.RemoteException: The bean encountered a non-application
> exception;
> nested exception is:
>         java.lang.NullPointerException*
>         at
>
> org.apache.openejb.core.transaction.EjbTransactionUtil.handleSystemException(EjbTransactionUtil.java:151)
>         at
> org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:428)
>         at
> org.apache.openejb.core.mdb.MdbContainer.invoke(MdbContainer.java:381)
>         at
>
> org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:227)
>         at
>
> org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.java:168)
>         at $Proxy57.onMessage(Unknown Source)
>         at
>
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
>         at
>
> org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
>         at
> org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:833)
>         at
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
>         at
>
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:366)
>         at
>
> org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656262.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
We are running OpenEJB in standalone mode using this from command line:

./bin/openejb start

--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656263.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
Thanks for pointing out about the mixup between custom.properties and
common.properties.  I was actually testing both at one point.  Niether
worked.

Here is the other info you requested:

static block:

TCCL: 
********************************************
*sun.misc.Launcher$AppClassLoader@5acac268*
********************************************
PARENT: 
********************************************
*sun.misc.Launcher$ExtClassLoader@35a16869*
********************************************
URLs: 
********************************************
*[Ljava.net.URL;@2a313170*
********************************************


onMessage():
TCCL: 
********************************************
*java.net.URLClassLoader@595780d9*
********************************************
PARENT: 
********************************************
*sun.misc.Launcher$AppClassLoader@5acac268*
********************************************
URLs: 
********************************************
*[Ljava.net.URL;@7ec71c00*
********************************************
*java.rmi.RemoteException: The bean encountered a non-application exception;
nested exception is: 
	java.lang.NullPointerException*
	at
org.apache.openejb.core.transaction.EjbTransactionUtil.handleSystemException(EjbTransactionUtil.java:151)
	at org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:428)
	at org.apache.openejb.core.mdb.MdbContainer.invoke(MdbContainer.java:381)
	at
org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:227)
	at
org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.java:168)
	at $Proxy57.onMessage(Unknown Source)
	at
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
	at
org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
	at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:833)
	at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
	at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:366)
	at
org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)

--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656262.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
great ;)

- Romain


2012/7/12 Ravindranath Akila <ra...@gmail.com>

> Just noticed custom.properties != common.properties, in case that is the
> issue :-)
>
> R. A.
> On Jul 13, 2012 12:36 AM, "Romain Manni-Bucau" <rm...@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 <ga...@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.
> > >
> >
>

Re: Custom ".properties" file

Posted by Ravindranath Akila <ra...@gmail.com>.
Just noticed custom.properties != common.properties, in case that is the
issue :-)

R. A.
On Jul 13, 2012 12:36 AM, "Romain Manni-Bucau" <rm...@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 <ga...@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.
> >
>

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
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 <ga...@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.
>

Re: Custom ".properties" file

Posted by s0dz <ga...@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.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Can you please system.out the classloader (tccl)?
Le 12 juil. 2012 18:42, "s0dz" <ga...@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.
>

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
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.

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
Hmmm... I am going to spend most of the day playing with this, I will
report if I discover anything.

Thanks for trying to help me! :D

On Tue, Jul 10, 2012 at 10:40 AM, Romain Manni-Bucau [via OpenEJB] <
ml-node+s979440n4656214h44@n4.nabble.com> wrote:

> All you said works fine for me on the snapshot
> Le 10 juil. 2012 18:03, "s0dz" <[hidden email]<http://user/SendEmail.jtp?type=node&node=4656214&i=0>>
> a écrit :
>
> > We made a brand new, empty class to see if the problem was accessing the
> > resources from inside that particular JAR (srbiz).
> >
> > But it still didn't work.  getResource(".") *should* return at *least* a
> > URL/path but it's just null.
> >
> > On Tue, Jul 10, 2012 at 9:53 AM, Romain Manni-Bucau [via OpenEJB] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4656214&i=1>>
> wrote:
> >
> > > hmm think i missed sthg
> > >
> > > basically here the info i'm not sure re-reading the thread: what does
> > mean
> > > "It
> > > is a static class that loads it on OpenEJB startup."?
> > >
> > > - Romain
> > >
> > >
> > > 2012/7/10 s0dz <[hidden email]<
> > http://user/SendEmail.jtp?type=node&node=4656212&i=0>>
> > >
> > >
> > > > Putting it in the lib directory does not work either.
> > > >
> > > > On Tue, Jul 10, 2012 at 9:44 AM, Romain Manni-Bucau [via OpenEJB] <
> > > > [hidden email] <http://user/SendEmail.jtp?type=node&node=4656212&i=1>>
>
> > > wrote:
> > > >
> > > > > can you just check putting the properties file in lib directly
> (not
> > in
> > > a
> > > > > jar) it works?
> > > > >
> > > > > - Romain
> > > > >
> > > > >
> > > > > 2012/7/10 s0dz <[hidden email]<
> > > > http://user/SendEmail.jtp?type=node&node=4656210&i=0>>
> > > > >
> > > > >
> > > > > > I tried to create a different class inside of a different jar
> > inside
> > > > > > OpenEJB just to test with:
> > > > > >
> > > > > > static
> > > > > >     {
> > > > > >         System.out.println( "PLAYTIME: ");
> > > > > >         System.out.println(
> > > > > > Thread.currentThread().getContextClassLoader().getResource( "."
> )
> > );
> > > > > >     }
> > > > > >
> > > > > > The system.out is:
> > > > > >
> > > > > > PLAYTIME:
> > > > > > null
> > > > > >
> > > > > > On Tue, Jul 10, 2012 at 9:14 AM, Romain Manni-Bucau [via
> OpenEJB] <
> > > > > > [hidden email] <
> > http://user/SendEmail.jtp?type=node&node=4656210&i=1>>
> > >
> > > > > wrote:
> > > > > >
> > > > > > > hmm
> > > > > > >
> > > > > > > didnt try to package it, did you check our default exclusions
> > > > > prefixes?
> > > > > > >
> > > > > > > - Romain
> > > > > > >
> > > > > > >
> > > > > > > 2012/7/10 s0dz <[hidden email]<
> > > > > > http://user/SendEmail.jtp?type=node&node=4656208&i=0>>
> > > > > > >
> > > > > > >
> > > > > > > > Sry for the delayed response.  I am doing something similar.
> > > > > > > >
> > > > > > > > InputStream is = null;
> > > > > > > > Properties properties = new Properties();
> > > > > > > >
> > > > > > > > is =
> > > > > >
> Thread.currentThread().getContextClassLoader().getResourceAsStream(
> > > > > > > > "common.properties" );
> > > > > > > >
> > > > > > > > properties.load( is );
> > > > > > > >
> > > > > > > > But I get this:
> > > > > > > >
> > > > > > > > Exception occurred in target VM:
> > > > > > > > java.lang.NullPointerException
> > > > > > > >     at
> > > > java.util.Properties$LineReader.readLine(Properties.java:418)
> > > > > > > >     at java.util.Properties.load0(Properties.java:337)
> > > > > > > >     at java.util.Properties.load(Properties.java:325)
> > > > > > > >     *at
> > > > > > > >
> > > > com.communitect.framework.PropertyMgr.<clinit>(PropertyMgr.java:82)*
> > > > > > > >     at
> com.communitect.ejb.protocol.SMTP.<clinit>(SMTP.java:44)
> > > > > > > >     at java.lang.Class.forName0(Native Method)
> > > > > > > >     at java.lang.Class.forName(Class.java:247)
> > > > > > > >     at
> org.apache.openejb.util.Classes.forName(Classes.java:62)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:139)
>
> > >
> > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.CheckCallbacks.validate(CheckCallbacks.java:65)
>
> > >
> > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:45)
>
> > >
> > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > >
> org.apache.openejb.config.AppValidator.validate(AppValidator.java:96)
> > > > > > > >     at
> > > > > > > >
> > > > > > >
> > > > >
> > >
> org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:37)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:321)
>
> > >
> > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:792)
>
> > >
> > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:668)
>
> > >
> > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:437)
>
> > >
> > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:345)
>
> > >
> > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > >
> > > >
> > org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:324)
> > > > > > > >     at
> > > org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
> > > > > > > >     at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
> > > > > > > >     at org.apache.openejb.server.Server.init(Server.java:64)
> > > > > > > >     at
> org.apache.openejb.server.Main.initServer(Main.java:154)
> > > > > > > >     at org.apache.openejb.server.Main.main(Main.java:128)
> > > > > > > >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > Method)
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> > >
> > > > >
> > > > > > >
> > > > > > > >     at
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> > >
> > > > >
> > > > > > >
> > > > > > > >     at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > > > >     at
> org.apache.openejb.cli.MainImpl.main(MainImpl.java:148)
> > > > > > > >     at
> > org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
> > > > > > > >
> > > > > > > >
> > > > > > > > Line 82:
> > > > > > > >
> > > > > > > > properties.load( is );
> > > > > > > >
> > > > > > > > The PropertyMgr.java is in a utility jar we use that
> contains
> > > > > business
> > > > > > > > rules and database classes.
> > > > > > > >
> > > > > > > > This works when deployed in Tomcat, but not in OpenEJB.
> > > > > > > >
> > > > > > > >
> > > > > > > > On Tue, Jul 10, 2012 at 3:01 AM, Romain Manni-Bucau [via
> > > OpenEJB] <
> > > > > > > > [hidden email] <
> > > > http://user/SendEmail.jtp?type=node&node=4656208&i=1>>
> > > > >
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > > just tried:
> > > > > > > > >
> > > > > > > > > final Properties p = new Properties();
> > > > > > > > > final InputStream is =
> > > > > > > > > getClassLoader().getResourceAsStream("common.properties");
> > > > > > > > > p.load(is);
> > > > > > > > >
> > > > > > > > > and it works
> > > > > > > > >
> > > > > > > > > i just did: echo "foo=bar" > lib/common.properties
> > > > > > > > >
> > > > > > > > > - Romain
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > 2012/7/10 Romain Manni-Bucau <[hidden email]<
> > > > > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=0>>
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > > can you share the way you load it (to avoid us to try
> > > several
> > > > > > things
> > > > > > > > > > before reproducing)?
> > > > > > > > > >
> > > > > > > > > > - Romain
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > 2012/7/10 s0dz <[hidden email]<
> > > > > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=1>>
> > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >> I placed it in the /lib directory.
> > > > > > > > > >>
> > > > > > > > > >> It is a static class that loads it on OpenEJB startup.
>  It
> > > > > works
> > > > > > in
> > > > > > > > > tomcat
> > > > > > > > > >> in this location, but not in OpenEJB.
> > > > > > > > > >>
> > > > > > > > > >> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via
> > > > > OpenEJB] <
> > > > > > > > > >> [hidden email] <
> > > > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=2
> > > > > > >
> > > > > > > > >>
> > > > > > > > > wrote:
> > > > > > > > > >>
> > > > > > > > > >> > Hi,
> > > > > > > > > >> >
> > > > > > > > > >> > where is the file? when do you load it?
> > > > > > > > > >> >
> > > > > > > > > >> > - Romain
> > > > > > > > > >> >
> > > > > > > > > >> >
> > > > > > > > > >> > 2012/7/10 s0dz <[hidden email]<
> > > > > > > > > >> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
> > > > > > > > > >> >
> > > > > > > > > >> >
> > > > > > > > > >> > > I am working on replacing my company's old school
> > > > framework
> > > > > > > with
> > > > > > > > an
> > > > > > > > > >> > > ActiveMQ/OpenEJB solution.  It has been going
> smoothly
> > > > with
> > > > > > > > > >> re-factoring
> > > > > > > > > >> > > code and implementing OpenEJB.  This was until I
> ran
> > > into
> > > > a
> > > > > > > slight
> > > > > > > > > >> > problem:
> > > > > > > > > >> > >
> > > > > > > > > >> > > I cannot figure out how to load in a
> > > "custom.properties"
> > > > > that
> > > > > > > > > contains
> > > > > > > > > >> > > various important properties custom to my company's
> > > > > software.
> > > > > > >  The
> > > > > > > > > >> .jar
> > > > > > > > > >> > > that
> > > > > > > > > >> > > actually does the accessing is working.  But it
> > appears
> > > > the
> > > > > > > > > >> classloader
> > > > > > > > > >> > is
> > > > > > > > > >> > > not finding "custom.properties."
> > > > > > > > > >> > >
> > > > > > > > > >> > > Any ideas?
> > > > > > > > > >> > >
> > > > > > > > > >> > > Thanks!
> > > > > > > > > >> > > Garrett
> > > > > > > > > >> > >
> > > > > > > > > >> > > --
> > > > > > > > > >> > > View this message in context:
> > > > > > > > > >> > >
> > > > > > > > > >> >
> > > > > > > > > >>
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> > > > > > > > > >> > > Sent from the OpenEJB User mailing list archive at
> > > > > Nabble.com.
> > > > > > > > > >> > >
> > > > > > > > > >> >
> > > > > > > > > >> >
> > > > > > > > > >> > ------------------------------
> > > > > > > > > >> >  If you reply to this email, your message will be
> added
> > > to
> > > > > the
> > > > > > > > > >> discussion
> > > > > > > > > >> > below:
> > > > > > > > > >> >
> > > > > > > > > >> >
> > > > > > > > > >>
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
> > > > > > > > > >> >  To unsubscribe from Custom ".properties" file, click
> > > here<
> > > > > > > > > >> >
> > > > > > > > > >> > .
> > > > > > > > > >> > NAML<
> > > > > > > > > >>
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > > > > > >> >
> > > > > > > > > >> >
> > > > > > > > > >>
> > > > > > > > > >>
> > > > > > > > > >> --
> > > > > > > > > >> View this message in context:
> > > > > > > > > >>
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
> > > > > > > > > >> Sent from the OpenEJB User mailing list archive at
> > > Nabble.com.
> > > > > > > > > >>
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ------------------------------
> > > > > > > > >  If you reply to this email, your message will be added to
> > the
> > > > > > > discussion
> > > > > > > > > below:
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656204.html
> > > > > > >
> > > > > > > > >  To unsubscribe from Custom ".properties" file, click
> here<
> > > > > > > >
> > > > > > > >
> > > > > > > > > .
> > > > > > > > > NAML<
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > View this message in context:
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656207.html
> > > > > > >
> > > > > > > > Sent from the OpenEJB User mailing list archive at
> Nabble.com.
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ------------------------------
> > > > > > >  If you reply to this email, your message will be added to the
> > > > > discussion
> > > > > > > below:
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656208.html
> > > > >
> > > > > > >  To unsubscribe from Custom ".properties" file, click here<
> > > > > >
> > > > > >
> > > > > > > .
> > > > > > > NAML<
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > View this message in context:
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656209.html
> > > > >
> > > > > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > > > >
> > > > >
> > > > >
> > > > > ------------------------------
> > > > >  If you reply to this email, your message will be added to the
> > > discussion
> > > > > below:
> > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656210.html
> > >
> > > > >  To unsubscribe from Custom ".properties" file, click here<
> > > >
> > > >
> > > > > .
> > > > > NAML<
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656211.html
> > >
> > > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > >
> > >
> > >
> > > ------------------------------
> > >  If you reply to this email, your message will be added to the
> discussion
> > > below:
> > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656212.html
>
> > >  To unsubscribe from Custom ".properties" file, click here<
> >
> >
> > > .
> > > NAML<
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> > >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656213.html
>
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656214.html
>  To unsubscribe from Custom ".properties" file, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656217.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
All you said works fine for me on the snapshot
Le 10 juil. 2012 18:03, "s0dz" <ga...@gmail.com> a écrit :

> We made a brand new, empty class to see if the problem was accessing the
> resources from inside that particular JAR (srbiz).
>
> But it still didn't work.  getResource(".") *should* return at *least* a
> URL/path but it's just null.
>
> On Tue, Jul 10, 2012 at 9:53 AM, Romain Manni-Bucau [via OpenEJB] <
> ml-node+s979440n4656212h82@n4.nabble.com> wrote:
>
> > hmm think i missed sthg
> >
> > basically here the info i'm not sure re-reading the thread: what does
> mean
> > "It
> > is a static class that loads it on OpenEJB startup."?
> >
> > - Romain
> >
> >
> > 2012/7/10 s0dz <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4656212&i=0>>
> >
> >
> > > Putting it in the lib directory does not work either.
> > >
> > > On Tue, Jul 10, 2012 at 9:44 AM, Romain Manni-Bucau [via OpenEJB] <
> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=4656212&i=1>>
> > wrote:
> > >
> > > > can you just check putting the properties file in lib directly (not
> in
> > a
> > > > jar) it works?
> > > >
> > > > - Romain
> > > >
> > > >
> > > > 2012/7/10 s0dz <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=4656210&i=0>>
> > > >
> > > >
> > > > > I tried to create a different class inside of a different jar
> inside
> > > > > OpenEJB just to test with:
> > > > >
> > > > > static
> > > > >     {
> > > > >         System.out.println( "PLAYTIME: ");
> > > > >         System.out.println(
> > > > > Thread.currentThread().getContextClassLoader().getResource( "." )
> );
> > > > >     }
> > > > >
> > > > > The system.out is:
> > > > >
> > > > > PLAYTIME:
> > > > > null
> > > > >
> > > > > On Tue, Jul 10, 2012 at 9:14 AM, Romain Manni-Bucau [via OpenEJB] <
> > > > > [hidden email] <
> http://user/SendEmail.jtp?type=node&node=4656210&i=1>>
> >
> > > > wrote:
> > > > >
> > > > > > hmm
> > > > > >
> > > > > > didnt try to package it, did you check our default exclusions
> > > > prefixes?
> > > > > >
> > > > > > - Romain
> > > > > >
> > > > > >
> > > > > > 2012/7/10 s0dz <[hidden email]<
> > > > > http://user/SendEmail.jtp?type=node&node=4656208&i=0>>
> > > > > >
> > > > > >
> > > > > > > Sry for the delayed response.  I am doing something similar.
> > > > > > >
> > > > > > > InputStream is = null;
> > > > > > > Properties properties = new Properties();
> > > > > > >
> > > > > > > is =
> > > > > Thread.currentThread().getContextClassLoader().getResourceAsStream(
> > > > > > > "common.properties" );
> > > > > > >
> > > > > > > properties.load( is );
> > > > > > >
> > > > > > > But I get this:
> > > > > > >
> > > > > > > Exception occurred in target VM:
> > > > > > > java.lang.NullPointerException
> > > > > > >     at
> > > java.util.Properties$LineReader.readLine(Properties.java:418)
> > > > > > >     at java.util.Properties.load0(Properties.java:337)
> > > > > > >     at java.util.Properties.load(Properties.java:325)
> > > > > > >     *at
> > > > > > >
> > > com.communitect.framework.PropertyMgr.<clinit>(PropertyMgr.java:82)*
> > > > > > >     at com.communitect.ejb.protocol.SMTP.<clinit>(SMTP.java:44)
> > > > > > >     at java.lang.Class.forName0(Native Method)
> > > > > > >     at java.lang.Class.forName(Class.java:247)
> > > > > > >     at org.apache.openejb.util.Classes.forName(Classes.java:62)
> > > > > > >     at
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:139)
> >
> > > >
> > > > > >
> > > > > > >     at
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.CheckCallbacks.validate(CheckCallbacks.java:65)
> >
> > > >
> > > > > >
> > > > > > >     at
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:45)
> >
> > > >
> > > > > >
> > > > > > >     at
> > > > > > >
> > > > org.apache.openejb.config.AppValidator.validate(AppValidator.java:96)
> > > > > > >     at
> > > > > > >
> > > > > >
> > > >
> > org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:37)
> > > > > > >     at
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:321)
> >
> > > >
> > > > > >
> > > > > > >     at
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:792)
> >
> > > >
> > > > > >
> > > > > > >     at
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:668)
> >
> > > >
> > > > > >
> > > > > > >     at
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:437)
> >
> > > >
> > > > > >
> > > > > > >     at
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:345)
> >
> > > >
> > > > > >
> > > > > > >     at
> > > > > > >
> > > > >
> > >
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:324)
> > > > > > >     at
> > org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
> > > > > > >     at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
> > > > > > >     at org.apache.openejb.server.Server.init(Server.java:64)
> > > > > > >     at org.apache.openejb.server.Main.initServer(Main.java:154)
> > > > > > >     at org.apache.openejb.server.Main.main(Main.java:128)
> > > > > > >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> > > > > > >     at
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >
> > > >
> > > > > >
> > > > > > >     at
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >
> > > >
> > > > > >
> > > > > > >     at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > > >     at org.apache.openejb.cli.MainImpl.main(MainImpl.java:148)
> > > > > > >     at
> org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
> > > > > > >
> > > > > > >
> > > > > > > Line 82:
> > > > > > >
> > > > > > > properties.load( is );
> > > > > > >
> > > > > > > The PropertyMgr.java is in a utility jar we use that contains
> > > > business
> > > > > > > rules and database classes.
> > > > > > >
> > > > > > > This works when deployed in Tomcat, but not in OpenEJB.
> > > > > > >
> > > > > > >
> > > > > > > On Tue, Jul 10, 2012 at 3:01 AM, Romain Manni-Bucau [via
> > OpenEJB] <
> > > > > > > [hidden email] <
> > > http://user/SendEmail.jtp?type=node&node=4656208&i=1>>
> > > >
> > > > > > wrote:
> > > > > > >
> > > > > > > > just tried:
> > > > > > > >
> > > > > > > > final Properties p = new Properties();
> > > > > > > > final InputStream is =
> > > > > > > > getClassLoader().getResourceAsStream("common.properties");
> > > > > > > > p.load(is);
> > > > > > > >
> > > > > > > > and it works
> > > > > > > >
> > > > > > > > i just did: echo "foo=bar" > lib/common.properties
> > > > > > > >
> > > > > > > > - Romain
> > > > > > > >
> > > > > > > >
> > > > > > > > 2012/7/10 Romain Manni-Bucau <[hidden email]<
> > > > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=0>>
> > > > > > > >
> > > > > > > >
> > > > > > > > > can you share the way you load it (to avoid us to try
> > several
> > > > > things
> > > > > > > > > before reproducing)?
> > > > > > > > >
> > > > > > > > > - Romain
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > 2012/7/10 s0dz <[hidden email]<
> > > > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=1>>
> > > > > > > >
> > > > > > > > >
> > > > > > > > >> I placed it in the /lib directory.
> > > > > > > > >>
> > > > > > > > >> It is a static class that loads it on OpenEJB startup.  It
> > > > works
> > > > > in
> > > > > > > > tomcat
> > > > > > > > >> in this location, but not in OpenEJB.
> > > > > > > > >>
> > > > > > > > >> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via
> > > > OpenEJB] <
> > > > > > > > >> [hidden email] <
> > > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=2
> > > > > >
> > > > > > > >>
> > > > > > > > wrote:
> > > > > > > > >>
> > > > > > > > >> > Hi,
> > > > > > > > >> >
> > > > > > > > >> > where is the file? when do you load it?
> > > > > > > > >> >
> > > > > > > > >> > - Romain
> > > > > > > > >> >
> > > > > > > > >> >
> > > > > > > > >> > 2012/7/10 s0dz <[hidden email]<
> > > > > > > > >> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
> > > > > > > > >> >
> > > > > > > > >> >
> > > > > > > > >> > > I am working on replacing my company's old school
> > > framework
> > > > > > with
> > > > > > > an
> > > > > > > > >> > > ActiveMQ/OpenEJB solution.  It has been going smoothly
> > > with
> > > > > > > > >> re-factoring
> > > > > > > > >> > > code and implementing OpenEJB.  This was until I ran
> > into
> > > a
> > > > > > slight
> > > > > > > > >> > problem:
> > > > > > > > >> > >
> > > > > > > > >> > > I cannot figure out how to load in a
> > "custom.properties"
> > > > that
> > > > > > > > contains
> > > > > > > > >> > > various important properties custom to my company's
> > > > software.
> > > > > >  The
> > > > > > > > >> .jar
> > > > > > > > >> > > that
> > > > > > > > >> > > actually does the accessing is working.  But it
> appears
> > > the
> > > > > > > > >> classloader
> > > > > > > > >> > is
> > > > > > > > >> > > not finding "custom.properties."
> > > > > > > > >> > >
> > > > > > > > >> > > Any ideas?
> > > > > > > > >> > >
> > > > > > > > >> > > Thanks!
> > > > > > > > >> > > Garrett
> > > > > > > > >> > >
> > > > > > > > >> > > --
> > > > > > > > >> > > View this message in context:
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> > > > > > > > >> > > Sent from the OpenEJB User mailing list archive at
> > > > Nabble.com.
> > > > > > > > >> > >
> > > > > > > > >> >
> > > > > > > > >> >
> > > > > > > > >> > ------------------------------
> > > > > > > > >> >  If you reply to this email, your message will be added
> > to
> > > > the
> > > > > > > > >> discussion
> > > > > > > > >> > below:
> > > > > > > > >> >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
> > > > > > > > >> >  To unsubscribe from Custom ".properties" file, click
> > here<
> > > > > > > > >> >
> > > > > > > > >> > .
> > > > > > > > >> > NAML<
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > > > > >> >
> > > > > > > > >> >
> > > > > > > > >>
> > > > > > > > >>
> > > > > > > > >> --
> > > > > > > > >> View this message in context:
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
> > > > > > > > >> Sent from the OpenEJB User mailing list archive at
> > Nabble.com.
> > > > > > > > >>
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > ------------------------------
> > > > > > > >  If you reply to this email, your message will be added to
> the
> > > > > > discussion
> > > > > > > > below:
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656204.html
> > > > > >
> > > > > > > >  To unsubscribe from Custom ".properties" file, click here<
> > > > > > >
> > > > > > >
> > > > > > > > .
> > > > > > > > NAML<
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > View this message in context:
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656207.html
> > > > > >
> > > > > > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > > > > >
> > > > > >
> > > > > >
> > > > > > ------------------------------
> > > > > >  If you reply to this email, your message will be added to the
> > > > discussion
> > > > > > below:
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656208.html
> > > >
> > > > > >  To unsubscribe from Custom ".properties" file, click here<
> > > > >
> > > > >
> > > > > > .
> > > > > > NAML<
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > View this message in context:
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656209.html
> > > >
> > > > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > > >
> > > >
> > > >
> > > > ------------------------------
> > > >  If you reply to this email, your message will be added to the
> > discussion
> > > > below:
> > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656210.html
> >
> > > >  To unsubscribe from Custom ".properties" file, click here<
> > >
> > >
> > > > .
> > > > NAML<
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > >
> > > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656211.html
> >
> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656212.html
> >  To unsubscribe from Custom ".properties" file, click here<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==
> >
> > .
> > NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656213.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
We made a brand new, empty class to see if the problem was accessing the
resources from inside that particular JAR (srbiz).

But it still didn't work.  getResource(".") *should* return at *least* a
URL/path but it's just null.

On Tue, Jul 10, 2012 at 9:53 AM, Romain Manni-Bucau [via OpenEJB] <
ml-node+s979440n4656212h82@n4.nabble.com> wrote:

> hmm think i missed sthg
>
> basically here the info i'm not sure re-reading the thread: what does mean
> "It
> is a static class that loads it on OpenEJB startup."?
>
> - Romain
>
>
> 2012/7/10 s0dz <[hidden email]<http://user/SendEmail.jtp?type=node&node=4656212&i=0>>
>
>
> > Putting it in the lib directory does not work either.
> >
> > On Tue, Jul 10, 2012 at 9:44 AM, Romain Manni-Bucau [via OpenEJB] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4656212&i=1>>
> wrote:
> >
> > > can you just check putting the properties file in lib directly (not in
> a
> > > jar) it works?
> > >
> > > - Romain
> > >
> > >
> > > 2012/7/10 s0dz <[hidden email]<
> > http://user/SendEmail.jtp?type=node&node=4656210&i=0>>
> > >
> > >
> > > > I tried to create a different class inside of a different jar inside
> > > > OpenEJB just to test with:
> > > >
> > > > static
> > > >     {
> > > >         System.out.println( "PLAYTIME: ");
> > > >         System.out.println(
> > > > Thread.currentThread().getContextClassLoader().getResource( "." ) );
> > > >     }
> > > >
> > > > The system.out is:
> > > >
> > > > PLAYTIME:
> > > > null
> > > >
> > > > On Tue, Jul 10, 2012 at 9:14 AM, Romain Manni-Bucau [via OpenEJB] <
> > > > [hidden email] <http://user/SendEmail.jtp?type=node&node=4656210&i=1>>
>
> > > wrote:
> > > >
> > > > > hmm
> > > > >
> > > > > didnt try to package it, did you check our default exclusions
> > > prefixes?
> > > > >
> > > > > - Romain
> > > > >
> > > > >
> > > > > 2012/7/10 s0dz <[hidden email]<
> > > > http://user/SendEmail.jtp?type=node&node=4656208&i=0>>
> > > > >
> > > > >
> > > > > > Sry for the delayed response.  I am doing something similar.
> > > > > >
> > > > > > InputStream is = null;
> > > > > > Properties properties = new Properties();
> > > > > >
> > > > > > is =
> > > > Thread.currentThread().getContextClassLoader().getResourceAsStream(
> > > > > > "common.properties" );
> > > > > >
> > > > > > properties.load( is );
> > > > > >
> > > > > > But I get this:
> > > > > >
> > > > > > Exception occurred in target VM:
> > > > > > java.lang.NullPointerException
> > > > > >     at
> > java.util.Properties$LineReader.readLine(Properties.java:418)
> > > > > >     at java.util.Properties.load0(Properties.java:337)
> > > > > >     at java.util.Properties.load(Properties.java:325)
> > > > > >     *at
> > > > > >
> > com.communitect.framework.PropertyMgr.<clinit>(PropertyMgr.java:82)*
> > > > > >     at com.communitect.ejb.protocol.SMTP.<clinit>(SMTP.java:44)
> > > > > >     at java.lang.Class.forName0(Native Method)
> > > > > >     at java.lang.Class.forName(Class.java:247)
> > > > > >     at org.apache.openejb.util.Classes.forName(Classes.java:62)
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:139)
>
> > >
> > > > >
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.CheckCallbacks.validate(CheckCallbacks.java:65)
>
> > >
> > > > >
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:45)
>
> > >
> > > > >
> > > > > >     at
> > > > > >
> > > org.apache.openejb.config.AppValidator.validate(AppValidator.java:96)
> > > > > >     at
> > > > > >
> > > > >
> > >
> org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:37)
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:321)
>
> > >
> > > > >
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:792)
>
> > >
> > > > >
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:668)
>
> > >
> > > > >
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:437)
>
> > >
> > > > >
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:345)
>
> > >
> > > > >
> > > > > >     at
> > > > > >
> > > >
> > org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:324)
> > > > > >     at
> org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
> > > > > >     at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
> > > > > >     at org.apache.openejb.server.Server.init(Server.java:64)
> > > > > >     at org.apache.openejb.server.Main.initServer(Main.java:154)
> > > > > >     at org.apache.openejb.server.Main.main(Main.java:128)
> > > > > >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> > >
> > > > >
> > > > > >     at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> > >
> > > > >
> > > > > >     at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > >     at org.apache.openejb.cli.MainImpl.main(MainImpl.java:148)
> > > > > >     at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
> > > > > >
> > > > > >
> > > > > > Line 82:
> > > > > >
> > > > > > properties.load( is );
> > > > > >
> > > > > > The PropertyMgr.java is in a utility jar we use that contains
> > > business
> > > > > > rules and database classes.
> > > > > >
> > > > > > This works when deployed in Tomcat, but not in OpenEJB.
> > > > > >
> > > > > >
> > > > > > On Tue, Jul 10, 2012 at 3:01 AM, Romain Manni-Bucau [via
> OpenEJB] <
> > > > > > [hidden email] <
> > http://user/SendEmail.jtp?type=node&node=4656208&i=1>>
> > >
> > > > > wrote:
> > > > > >
> > > > > > > just tried:
> > > > > > >
> > > > > > > final Properties p = new Properties();
> > > > > > > final InputStream is =
> > > > > > > getClassLoader().getResourceAsStream("common.properties");
> > > > > > > p.load(is);
> > > > > > >
> > > > > > > and it works
> > > > > > >
> > > > > > > i just did: echo "foo=bar" > lib/common.properties
> > > > > > >
> > > > > > > - Romain
> > > > > > >
> > > > > > >
> > > > > > > 2012/7/10 Romain Manni-Bucau <[hidden email]<
> > > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=0>>
> > > > > > >
> > > > > > >
> > > > > > > > can you share the way you load it (to avoid us to try
> several
> > > > things
> > > > > > > > before reproducing)?
> > > > > > > >
> > > > > > > > - Romain
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > 2012/7/10 s0dz <[hidden email]<
> > > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=1>>
> > > > > > >
> > > > > > > >
> > > > > > > >> I placed it in the /lib directory.
> > > > > > > >>
> > > > > > > >> It is a static class that loads it on OpenEJB startup.  It
> > > works
> > > > in
> > > > > > > tomcat
> > > > > > > >> in this location, but not in OpenEJB.
> > > > > > > >>
> > > > > > > >> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via
> > > OpenEJB] <
> > > > > > > >> [hidden email] <
> > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=2
> > > > >
> > > > > > >>
> > > > > > > wrote:
> > > > > > > >>
> > > > > > > >> > Hi,
> > > > > > > >> >
> > > > > > > >> > where is the file? when do you load it?
> > > > > > > >> >
> > > > > > > >> > - Romain
> > > > > > > >> >
> > > > > > > >> >
> > > > > > > >> > 2012/7/10 s0dz <[hidden email]<
> > > > > > > >> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
> > > > > > > >> >
> > > > > > > >> >
> > > > > > > >> > > I am working on replacing my company's old school
> > framework
> > > > > with
> > > > > > an
> > > > > > > >> > > ActiveMQ/OpenEJB solution.  It has been going smoothly
> > with
> > > > > > > >> re-factoring
> > > > > > > >> > > code and implementing OpenEJB.  This was until I ran
> into
> > a
> > > > > slight
> > > > > > > >> > problem:
> > > > > > > >> > >
> > > > > > > >> > > I cannot figure out how to load in a
> "custom.properties"
> > > that
> > > > > > > contains
> > > > > > > >> > > various important properties custom to my company's
> > > software.
> > > > >  The
> > > > > > > >> .jar
> > > > > > > >> > > that
> > > > > > > >> > > actually does the accessing is working.  But it appears
> > the
> > > > > > > >> classloader
> > > > > > > >> > is
> > > > > > > >> > > not finding "custom.properties."
> > > > > > > >> > >
> > > > > > > >> > > Any ideas?
> > > > > > > >> > >
> > > > > > > >> > > Thanks!
> > > > > > > >> > > Garrett
> > > > > > > >> > >
> > > > > > > >> > > --
> > > > > > > >> > > View this message in context:
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> > > > > > > >> > > Sent from the OpenEJB User mailing list archive at
> > > Nabble.com.
> > > > > > > >> > >
> > > > > > > >> >
> > > > > > > >> >
> > > > > > > >> > ------------------------------
> > > > > > > >> >  If you reply to this email, your message will be added
> to
> > > the
> > > > > > > >> discussion
> > > > > > > >> > below:
> > > > > > > >> >
> > > > > > > >> >
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
> > > > > > > >> >  To unsubscribe from Custom ".properties" file, click
> here<
> > > > > > > >> >
> > > > > > > >> > .
> > > > > > > >> > NAML<
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > > > >> >
> > > > > > > >> >
> > > > > > > >>
> > > > > > > >>
> > > > > > > >> --
> > > > > > > >> View this message in context:
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
> > > > > > > >> Sent from the OpenEJB User mailing list archive at
> Nabble.com.
> > > > > > > >>
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ------------------------------
> > > > > > >  If you reply to this email, your message will be added to the
> > > > > discussion
> > > > > > > below:
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656204.html
> > > > >
> > > > > > >  To unsubscribe from Custom ".properties" file, click here<
> > > > > >
> > > > > >
> > > > > > > .
> > > > > > > NAML<
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > View this message in context:
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656207.html
> > > > >
> > > > > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > > > >
> > > > >
> > > > >
> > > > > ------------------------------
> > > > >  If you reply to this email, your message will be added to the
> > > discussion
> > > > > below:
> > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656208.html
> > >
> > > > >  To unsubscribe from Custom ".properties" file, click here<
> > > >
> > > >
> > > > > .
> > > > > NAML<
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656209.html
> > >
> > > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > >
> > >
> > >
> > > ------------------------------
> > >  If you reply to this email, your message will be added to the
> discussion
> > > below:
> > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656210.html
>
> > >  To unsubscribe from Custom ".properties" file, click here<
> >
> >
> > > .
> > > NAML<
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> > >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656211.html
>
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656212.html
>  To unsubscribe from Custom ".properties" file, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656213.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
hmm think i missed sthg

basically here the info i'm not sure re-reading the thread: what does mean "It
is a static class that loads it on OpenEJB startup."?

- Romain


2012/7/10 s0dz <ga...@gmail.com>

> Putting it in the lib directory does not work either.
>
> On Tue, Jul 10, 2012 at 9:44 AM, Romain Manni-Bucau [via OpenEJB] <
> ml-node+s979440n4656210h20@n4.nabble.com> wrote:
>
> > can you just check putting the properties file in lib directly (not in a
> > jar) it works?
> >
> > - Romain
> >
> >
> > 2012/7/10 s0dz <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4656210&i=0>>
> >
> >
> > > I tried to create a different class inside of a different jar inside
> > > OpenEJB just to test with:
> > >
> > > static
> > >     {
> > >         System.out.println( "PLAYTIME: ");
> > >         System.out.println(
> > > Thread.currentThread().getContextClassLoader().getResource( "." ) );
> > >     }
> > >
> > > The system.out is:
> > >
> > > PLAYTIME:
> > > null
> > >
> > > On Tue, Jul 10, 2012 at 9:14 AM, Romain Manni-Bucau [via OpenEJB] <
> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=4656210&i=1>>
> > wrote:
> > >
> > > > hmm
> > > >
> > > > didnt try to package it, did you check our default exclusions
> > prefixes?
> > > >
> > > > - Romain
> > > >
> > > >
> > > > 2012/7/10 s0dz <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=4656208&i=0>>
> > > >
> > > >
> > > > > Sry for the delayed response.  I am doing something similar.
> > > > >
> > > > > InputStream is = null;
> > > > > Properties properties = new Properties();
> > > > >
> > > > > is =
> > > Thread.currentThread().getContextClassLoader().getResourceAsStream(
> > > > > "common.properties" );
> > > > >
> > > > > properties.load( is );
> > > > >
> > > > > But I get this:
> > > > >
> > > > > Exception occurred in target VM:
> > > > > java.lang.NullPointerException
> > > > >     at
> java.util.Properties$LineReader.readLine(Properties.java:418)
> > > > >     at java.util.Properties.load0(Properties.java:337)
> > > > >     at java.util.Properties.load(Properties.java:325)
> > > > >     *at
> > > > >
> com.communitect.framework.PropertyMgr.<clinit>(PropertyMgr.java:82)*
> > > > >     at com.communitect.ejb.protocol.SMTP.<clinit>(SMTP.java:44)
> > > > >     at java.lang.Class.forName0(Native Method)
> > > > >     at java.lang.Class.forName(Class.java:247)
> > > > >     at org.apache.openejb.util.Classes.forName(Classes.java:62)
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:139)
> >
> > > >
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.CheckCallbacks.validate(CheckCallbacks.java:65)
> >
> > > >
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:45)
> >
> > > >
> > > > >     at
> > > > >
> > org.apache.openejb.config.AppValidator.validate(AppValidator.java:96)
> > > > >     at
> > > > >
> > > >
> > org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:37)
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:321)
> >
> > > >
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:792)
> >
> > > >
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:668)
> >
> > > >
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:437)
> >
> > > >
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:345)
> >
> > > >
> > > > >     at
> > > > >
> > >
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:324)
> > > > >     at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
> > > > >     at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
> > > > >     at org.apache.openejb.server.Server.init(Server.java:64)
> > > > >     at org.apache.openejb.server.Main.initServer(Main.java:154)
> > > > >     at org.apache.openejb.server.Main.main(Main.java:128)
> > > > >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >
> > > >
> > > > >     at
> > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >
> > > >
> > > > >     at java.lang.reflect.Method.invoke(Method.java:597)
> > > > >     at org.apache.openejb.cli.MainImpl.main(MainImpl.java:148)
> > > > >     at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
> > > > >
> > > > >
> > > > > Line 82:
> > > > >
> > > > > properties.load( is );
> > > > >
> > > > > The PropertyMgr.java is in a utility jar we use that contains
> > business
> > > > > rules and database classes.
> > > > >
> > > > > This works when deployed in Tomcat, but not in OpenEJB.
> > > > >
> > > > >
> > > > > On Tue, Jul 10, 2012 at 3:01 AM, Romain Manni-Bucau [via OpenEJB] <
> > > > > [hidden email] <
> http://user/SendEmail.jtp?type=node&node=4656208&i=1>>
> >
> > > > wrote:
> > > > >
> > > > > > just tried:
> > > > > >
> > > > > > final Properties p = new Properties();
> > > > > > final InputStream is =
> > > > > > getClassLoader().getResourceAsStream("common.properties");
> > > > > > p.load(is);
> > > > > >
> > > > > > and it works
> > > > > >
> > > > > > i just did: echo "foo=bar" > lib/common.properties
> > > > > >
> > > > > > - Romain
> > > > > >
> > > > > >
> > > > > > 2012/7/10 Romain Manni-Bucau <[hidden email]<
> > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=0>>
> > > > > >
> > > > > >
> > > > > > > can you share the way you load it (to avoid us to try several
> > > things
> > > > > > > before reproducing)?
> > > > > > >
> > > > > > > - Romain
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > 2012/7/10 s0dz <[hidden email]<
> > > > > http://user/SendEmail.jtp?type=node&node=4656204&i=1>>
> > > > > >
> > > > > > >
> > > > > > >> I placed it in the /lib directory.
> > > > > > >>
> > > > > > >> It is a static class that loads it on OpenEJB startup.  It
> > works
> > > in
> > > > > > tomcat
> > > > > > >> in this location, but not in OpenEJB.
> > > > > > >>
> > > > > > >> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via
> > OpenEJB] <
> > > > > > >> [hidden email] <
> > > > http://user/SendEmail.jtp?type=node&node=4656204&i=2
> > > >
> > > > > >>
> > > > > > wrote:
> > > > > > >>
> > > > > > >> > Hi,
> > > > > > >> >
> > > > > > >> > where is the file? when do you load it?
> > > > > > >> >
> > > > > > >> > - Romain
> > > > > > >> >
> > > > > > >> >
> > > > > > >> > 2012/7/10 s0dz <[hidden email]<
> > > > > > >> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
> > > > > > >> >
> > > > > > >> >
> > > > > > >> > > I am working on replacing my company's old school
> framework
> > > > with
> > > > > an
> > > > > > >> > > ActiveMQ/OpenEJB solution.  It has been going smoothly
> with
> > > > > > >> re-factoring
> > > > > > >> > > code and implementing OpenEJB.  This was until I ran into
> a
> > > > slight
> > > > > > >> > problem:
> > > > > > >> > >
> > > > > > >> > > I cannot figure out how to load in a "custom.properties"
> > that
> > > > > > contains
> > > > > > >> > > various important properties custom to my company's
> > software.
> > > >  The
> > > > > > >> .jar
> > > > > > >> > > that
> > > > > > >> > > actually does the accessing is working.  But it appears
> the
> > > > > > >> classloader
> > > > > > >> > is
> > > > > > >> > > not finding "custom.properties."
> > > > > > >> > >
> > > > > > >> > > Any ideas?
> > > > > > >> > >
> > > > > > >> > > Thanks!
> > > > > > >> > > Garrett
> > > > > > >> > >
> > > > > > >> > > --
> > > > > > >> > > View this message in context:
> > > > > > >> > >
> > > > > > >> >
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> > > > > > >> > > Sent from the OpenEJB User mailing list archive at
> > Nabble.com.
> > > > > > >> > >
> > > > > > >> >
> > > > > > >> >
> > > > > > >> > ------------------------------
> > > > > > >> >  If you reply to this email, your message will be added to
> > the
> > > > > > >> discussion
> > > > > > >> > below:
> > > > > > >> >
> > > > > > >> >
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
> > > > > > >> >  To unsubscribe from Custom ".properties" file, click here<
> > > > > > >> >
> > > > > > >> > .
> > > > > > >> > NAML<
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > > >> >
> > > > > > >> >
> > > > > > >>
> > > > > > >>
> > > > > > >> --
> > > > > > >> View this message in context:
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
> > > > > > >> Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > > > > >>
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > ------------------------------
> > > > > >  If you reply to this email, your message will be added to the
> > > > discussion
> > > > > > below:
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656204.html
> > > >
> > > > > >  To unsubscribe from Custom ".properties" file, click here<
> > > > >
> > > > >
> > > > > > .
> > > > > > NAML<
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > View this message in context:
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656207.html
> > > >
> > > > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > > >
> > > >
> > > >
> > > > ------------------------------
> > > >  If you reply to this email, your message will be added to the
> > discussion
> > > > below:
> > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656208.html
> >
> > > >  To unsubscribe from Custom ".properties" file, click here<
> > >
> > >
> > > > .
> > > > NAML<
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > >
> > > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656209.html
> >
> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656210.html
> >  To unsubscribe from Custom ".properties" file, click here<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==
> >
> > .
> > NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656211.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
Putting it in the lib directory does not work either.

On Tue, Jul 10, 2012 at 9:44 AM, Romain Manni-Bucau [via OpenEJB] <
ml-node+s979440n4656210h20@n4.nabble.com> wrote:

> can you just check putting the properties file in lib directly (not in a
> jar) it works?
>
> - Romain
>
>
> 2012/7/10 s0dz <[hidden email]<http://user/SendEmail.jtp?type=node&node=4656210&i=0>>
>
>
> > I tried to create a different class inside of a different jar inside
> > OpenEJB just to test with:
> >
> > static
> >     {
> >         System.out.println( "PLAYTIME: ");
> >         System.out.println(
> > Thread.currentThread().getContextClassLoader().getResource( "." ) );
> >     }
> >
> > The system.out is:
> >
> > PLAYTIME:
> > null
> >
> > On Tue, Jul 10, 2012 at 9:14 AM, Romain Manni-Bucau [via OpenEJB] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4656210&i=1>>
> wrote:
> >
> > > hmm
> > >
> > > didnt try to package it, did you check our default exclusions
> prefixes?
> > >
> > > - Romain
> > >
> > >
> > > 2012/7/10 s0dz <[hidden email]<
> > http://user/SendEmail.jtp?type=node&node=4656208&i=0>>
> > >
> > >
> > > > Sry for the delayed response.  I am doing something similar.
> > > >
> > > > InputStream is = null;
> > > > Properties properties = new Properties();
> > > >
> > > > is =
> > Thread.currentThread().getContextClassLoader().getResourceAsStream(
> > > > "common.properties" );
> > > >
> > > > properties.load( is );
> > > >
> > > > But I get this:
> > > >
> > > > Exception occurred in target VM:
> > > > java.lang.NullPointerException
> > > >     at java.util.Properties$LineReader.readLine(Properties.java:418)
> > > >     at java.util.Properties.load0(Properties.java:337)
> > > >     at java.util.Properties.load(Properties.java:325)
> > > >     *at
> > > > com.communitect.framework.PropertyMgr.<clinit>(PropertyMgr.java:82)*
> > > >     at com.communitect.ejb.protocol.SMTP.<clinit>(SMTP.java:44)
> > > >     at java.lang.Class.forName0(Native Method)
> > > >     at java.lang.Class.forName(Class.java:247)
> > > >     at org.apache.openejb.util.Classes.forName(Classes.java:62)
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:139)
>
> > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.CheckCallbacks.validate(CheckCallbacks.java:65)
>
> > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:45)
>
> > >
> > > >     at
> > > >
> org.apache.openejb.config.AppValidator.validate(AppValidator.java:96)
> > > >     at
> > > >
> > >
> org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:37)
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:321)
>
> > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:792)
>
> > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:668)
>
> > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:437)
>
> > >
> > > >     at
> > > >
> > > >
> > >
> >
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:345)
>
> > >
> > > >     at
> > > >
> > org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:324)
> > > >     at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
> > > >     at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
> > > >     at org.apache.openejb.server.Server.init(Server.java:64)
> > > >     at org.apache.openejb.server.Main.initServer(Main.java:154)
> > > >     at org.apache.openejb.server.Main.main(Main.java:128)
> > > >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >     at
> > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> > >
> > > >     at
> > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> > >
> > > >     at java.lang.reflect.Method.invoke(Method.java:597)
> > > >     at org.apache.openejb.cli.MainImpl.main(MainImpl.java:148)
> > > >     at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
> > > >
> > > >
> > > > Line 82:
> > > >
> > > > properties.load( is );
> > > >
> > > > The PropertyMgr.java is in a utility jar we use that contains
> business
> > > > rules and database classes.
> > > >
> > > > This works when deployed in Tomcat, but not in OpenEJB.
> > > >
> > > >
> > > > On Tue, Jul 10, 2012 at 3:01 AM, Romain Manni-Bucau [via OpenEJB] <
> > > > [hidden email] <http://user/SendEmail.jtp?type=node&node=4656208&i=1>>
>
> > > wrote:
> > > >
> > > > > just tried:
> > > > >
> > > > > final Properties p = new Properties();
> > > > > final InputStream is =
> > > > > getClassLoader().getResourceAsStream("common.properties");
> > > > > p.load(is);
> > > > >
> > > > > and it works
> > > > >
> > > > > i just did: echo "foo=bar" > lib/common.properties
> > > > >
> > > > > - Romain
> > > > >
> > > > >
> > > > > 2012/7/10 Romain Manni-Bucau <[hidden email]<
> > > > http://user/SendEmail.jtp?type=node&node=4656204&i=0>>
> > > > >
> > > > >
> > > > > > can you share the way you load it (to avoid us to try several
> > things
> > > > > > before reproducing)?
> > > > > >
> > > > > > - Romain
> > > > > >
> > > > > >
> > > > > >
> > > > > > 2012/7/10 s0dz <[hidden email]<
> > > > http://user/SendEmail.jtp?type=node&node=4656204&i=1>>
> > > > >
> > > > > >
> > > > > >> I placed it in the /lib directory.
> > > > > >>
> > > > > >> It is a static class that loads it on OpenEJB startup.  It
> works
> > in
> > > > > tomcat
> > > > > >> in this location, but not in OpenEJB.
> > > > > >>
> > > > > >> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via
> OpenEJB] <
> > > > > >> [hidden email] <
> > > http://user/SendEmail.jtp?type=node&node=4656204&i=2
> > >
> > > > >>
> > > > > wrote:
> > > > > >>
> > > > > >> > Hi,
> > > > > >> >
> > > > > >> > where is the file? when do you load it?
> > > > > >> >
> > > > > >> > - Romain
> > > > > >> >
> > > > > >> >
> > > > > >> > 2012/7/10 s0dz <[hidden email]<
> > > > > >> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
> > > > > >> >
> > > > > >> >
> > > > > >> > > I am working on replacing my company's old school framework
> > > with
> > > > an
> > > > > >> > > ActiveMQ/OpenEJB solution.  It has been going smoothly with
> > > > > >> re-factoring
> > > > > >> > > code and implementing OpenEJB.  This was until I ran into a
> > > slight
> > > > > >> > problem:
> > > > > >> > >
> > > > > >> > > I cannot figure out how to load in a "custom.properties"
> that
> > > > > contains
> > > > > >> > > various important properties custom to my company's
> software.
> > >  The
> > > > > >> .jar
> > > > > >> > > that
> > > > > >> > > actually does the accessing is working.  But it appears the
> > > > > >> classloader
> > > > > >> > is
> > > > > >> > > not finding "custom.properties."
> > > > > >> > >
> > > > > >> > > Any ideas?
> > > > > >> > >
> > > > > >> > > Thanks!
> > > > > >> > > Garrett
> > > > > >> > >
> > > > > >> > > --
> > > > > >> > > View this message in context:
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> > > > > >> > > Sent from the OpenEJB User mailing list archive at
> Nabble.com.
> > > > > >> > >
> > > > > >> >
> > > > > >> >
> > > > > >> > ------------------------------
> > > > > >> >  If you reply to this email, your message will be added to
> the
> > > > > >> discussion
> > > > > >> > below:
> > > > > >> >
> > > > > >> >
> > > > > >>
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
> > > > > >> >  To unsubscribe from Custom ".properties" file, click here<
> > > > > >> >
> > > > > >> > .
> > > > > >> > NAML<
> > > > > >>
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > > >> >
> > > > > >> >
> > > > > >>
> > > > > >>
> > > > > >> --
> > > > > >> View this message in context:
> > > > > >>
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
> > > > > >> Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > ------------------------------
> > > > >  If you reply to this email, your message will be added to the
> > > discussion
> > > > > below:
> > > > >
> > > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656204.html
> > >
> > > > >  To unsubscribe from Custom ".properties" file, click here<
> > > >
> > > >
> > > > > .
> > > > > NAML<
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656207.html
> > >
> > > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > >
> > >
> > >
> > > ------------------------------
> > >  If you reply to this email, your message will be added to the
> discussion
> > > below:
> > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656208.html
>
> > >  To unsubscribe from Custom ".properties" file, click here<
> >
> >
> > > .
> > > NAML<
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> > >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656209.html
>
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656210.html
>  To unsubscribe from Custom ".properties" file, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656211.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
can you just check putting the properties file in lib directly (not in a
jar) it works?

- Romain


2012/7/10 s0dz <ga...@gmail.com>

> I tried to create a different class inside of a different jar inside
> OpenEJB just to test with:
>
> static
>     {
>         System.out.println( "PLAYTIME: ");
>         System.out.println(
> Thread.currentThread().getContextClassLoader().getResource( "." ) );
>     }
>
> The system.out is:
>
> PLAYTIME:
> null
>
> On Tue, Jul 10, 2012 at 9:14 AM, Romain Manni-Bucau [via OpenEJB] <
> ml-node+s979440n4656208h58@n4.nabble.com> wrote:
>
> > hmm
> >
> > didnt try to package it, did you check our default exclusions prefixes?
> >
> > - Romain
> >
> >
> > 2012/7/10 s0dz <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4656208&i=0>>
> >
> >
> > > Sry for the delayed response.  I am doing something similar.
> > >
> > > InputStream is = null;
> > > Properties properties = new Properties();
> > >
> > > is =
> Thread.currentThread().getContextClassLoader().getResourceAsStream(
> > > "common.properties" );
> > >
> > > properties.load( is );
> > >
> > > But I get this:
> > >
> > > Exception occurred in target VM:
> > > java.lang.NullPointerException
> > >     at java.util.Properties$LineReader.readLine(Properties.java:418)
> > >     at java.util.Properties.load0(Properties.java:337)
> > >     at java.util.Properties.load(Properties.java:325)
> > >     *at
> > > com.communitect.framework.PropertyMgr.<clinit>(PropertyMgr.java:82)*
> > >     at com.communitect.ejb.protocol.SMTP.<clinit>(SMTP.java:44)
> > >     at java.lang.Class.forName0(Native Method)
> > >     at java.lang.Class.forName(Class.java:247)
> > >     at org.apache.openejb.util.Classes.forName(Classes.java:62)
> > >     at
> > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:139)
> >
> > >     at
> > >
> > >
> >
> org.apache.openejb.config.rules.CheckCallbacks.validate(CheckCallbacks.java:65)
> >
> > >     at
> > >
> > >
> >
> org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:45)
> >
> > >     at
> > > org.apache.openejb.config.AppValidator.validate(AppValidator.java:96)
> > >     at
> > >
> > org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:37)
> > >     at
> > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:321)
> >
> > >     at
> > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:792)
> >
> > >     at
> > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:668)
> >
> > >     at
> > >
> > >
> >
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:437)
> >
> > >     at
> > >
> > >
> >
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:345)
> >
> > >     at
> > >
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:324)
> > >     at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
> > >     at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
> > >     at org.apache.openejb.server.Server.init(Server.java:64)
> > >     at org.apache.openejb.server.Main.initServer(Main.java:154)
> > >     at org.apache.openejb.server.Main.main(Main.java:128)
> > >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >     at
> > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >
> > >     at
> > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >
> > >     at java.lang.reflect.Method.invoke(Method.java:597)
> > >     at org.apache.openejb.cli.MainImpl.main(MainImpl.java:148)
> > >     at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
> > >
> > >
> > > Line 82:
> > >
> > > properties.load( is );
> > >
> > > The PropertyMgr.java is in a utility jar we use that contains business
> > > rules and database classes.
> > >
> > > This works when deployed in Tomcat, but not in OpenEJB.
> > >
> > >
> > > On Tue, Jul 10, 2012 at 3:01 AM, Romain Manni-Bucau [via OpenEJB] <
> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=4656208&i=1>>
> > wrote:
> > >
> > > > just tried:
> > > >
> > > > final Properties p = new Properties();
> > > > final InputStream is =
> > > > getClassLoader().getResourceAsStream("common.properties");
> > > > p.load(is);
> > > >
> > > > and it works
> > > >
> > > > i just did: echo "foo=bar" > lib/common.properties
> > > >
> > > > - Romain
> > > >
> > > >
> > > > 2012/7/10 Romain Manni-Bucau <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=4656204&i=0>>
> > > >
> > > >
> > > > > can you share the way you load it (to avoid us to try several
> things
> > > > > before reproducing)?
> > > > >
> > > > > - Romain
> > > > >
> > > > >
> > > > >
> > > > > 2012/7/10 s0dz <[hidden email]<
> > > http://user/SendEmail.jtp?type=node&node=4656204&i=1>>
> > > >
> > > > >
> > > > >> I placed it in the /lib directory.
> > > > >>
> > > > >> It is a static class that loads it on OpenEJB startup.  It works
> in
> > > > tomcat
> > > > >> in this location, but not in OpenEJB.
> > > > >>
> > > > >> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via OpenEJB] <
> > > > >> [hidden email] <
> > http://user/SendEmail.jtp?type=node&node=4656204&i=2
> >
> > > >>
> > > > wrote:
> > > > >>
> > > > >> > Hi,
> > > > >> >
> > > > >> > where is the file? when do you load it?
> > > > >> >
> > > > >> > - Romain
> > > > >> >
> > > > >> >
> > > > >> > 2012/7/10 s0dz <[hidden email]<
> > > > >> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
> > > > >> >
> > > > >> >
> > > > >> > > I am working on replacing my company's old school framework
> > with
> > > an
> > > > >> > > ActiveMQ/OpenEJB solution.  It has been going smoothly with
> > > > >> re-factoring
> > > > >> > > code and implementing OpenEJB.  This was until I ran into a
> > slight
> > > > >> > problem:
> > > > >> > >
> > > > >> > > I cannot figure out how to load in a "custom.properties" that
> > > > contains
> > > > >> > > various important properties custom to my company's software.
> >  The
> > > > >> .jar
> > > > >> > > that
> > > > >> > > actually does the accessing is working.  But it appears the
> > > > >> classloader
> > > > >> > is
> > > > >> > > not finding "custom.properties."
> > > > >> > >
> > > > >> > > Any ideas?
> > > > >> > >
> > > > >> > > Thanks!
> > > > >> > > Garrett
> > > > >> > >
> > > > >> > > --
> > > > >> > > View this message in context:
> > > > >> > >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> > > > >> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > > >> > >
> > > > >> >
> > > > >> >
> > > > >> > ------------------------------
> > > > >> >  If you reply to this email, your message will be added to the
> > > > >> discussion
> > > > >> > below:
> > > > >> >
> > > > >> >
> > > > >>
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
> > > > >> >  To unsubscribe from Custom ".properties" file, click here<
> > > > >> >
> > > > >> > .
> > > > >> > NAML<
> > > > >>
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > > >> >
> > > > >> >
> > > > >>
> > > > >>
> > > > >> --
> > > > >> View this message in context:
> > > > >>
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
> > > > >> Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > > >>
> > > > >
> > > > >
> > > >
> > > >
> > > > ------------------------------
> > > >  If you reply to this email, your message will be added to the
> > discussion
> > > > below:
> > > >
> > > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656204.html
> >
> > > >  To unsubscribe from Custom ".properties" file, click here<
> > >
> > >
> > > > .
> > > > NAML<
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > >
> > > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656207.html
> >
> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656208.html
> >  To unsubscribe from Custom ".properties" file, click here<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==
> >
> > .
> > NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656209.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
I tried to create a different class inside of a different jar inside
OpenEJB just to test with:

static
    {
        System.out.println( "PLAYTIME: ");
        System.out.println(
Thread.currentThread().getContextClassLoader().getResource( "." ) );
    }

The system.out is:

PLAYTIME:
null

On Tue, Jul 10, 2012 at 9:14 AM, Romain Manni-Bucau [via OpenEJB] <
ml-node+s979440n4656208h58@n4.nabble.com> wrote:

> hmm
>
> didnt try to package it, did you check our default exclusions prefixes?
>
> - Romain
>
>
> 2012/7/10 s0dz <[hidden email]<http://user/SendEmail.jtp?type=node&node=4656208&i=0>>
>
>
> > Sry for the delayed response.  I am doing something similar.
> >
> > InputStream is = null;
> > Properties properties = new Properties();
> >
> > is = Thread.currentThread().getContextClassLoader().getResourceAsStream(
> > "common.properties" );
> >
> > properties.load( is );
> >
> > But I get this:
> >
> > Exception occurred in target VM:
> > java.lang.NullPointerException
> >     at java.util.Properties$LineReader.readLine(Properties.java:418)
> >     at java.util.Properties.load0(Properties.java:337)
> >     at java.util.Properties.load(Properties.java:325)
> >     *at
> > com.communitect.framework.PropertyMgr.<clinit>(PropertyMgr.java:82)*
> >     at com.communitect.ejb.protocol.SMTP.<clinit>(SMTP.java:44)
> >     at java.lang.Class.forName0(Native Method)
> >     at java.lang.Class.forName(Class.java:247)
> >     at org.apache.openejb.util.Classes.forName(Classes.java:62)
> >     at
> >
> >
> org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:139)
>
> >     at
> >
> >
> org.apache.openejb.config.rules.CheckCallbacks.validate(CheckCallbacks.java:65)
>
> >     at
> >
> >
> org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:45)
>
> >     at
> > org.apache.openejb.config.AppValidator.validate(AppValidator.java:96)
> >     at
> >
> org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:37)
> >     at
> >
> >
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:321)
>
> >     at
> >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:792)
>
> >     at
> >
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:668)
>
> >     at
> >
> >
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:437)
>
> >     at
> >
> >
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:345)
>
> >     at
> > org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:324)
> >     at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
> >     at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
> >     at org.apache.openejb.server.Server.init(Server.java:64)
> >     at org.apache.openejb.server.Main.initServer(Main.java:154)
> >     at org.apache.openejb.server.Main.main(Main.java:128)
> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >     at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> >     at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> >     at java.lang.reflect.Method.invoke(Method.java:597)
> >     at org.apache.openejb.cli.MainImpl.main(MainImpl.java:148)
> >     at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
> >
> >
> > Line 82:
> >
> > properties.load( is );
> >
> > The PropertyMgr.java is in a utility jar we use that contains business
> > rules and database classes.
> >
> > This works when deployed in Tomcat, but not in OpenEJB.
> >
> >
> > On Tue, Jul 10, 2012 at 3:01 AM, Romain Manni-Bucau [via OpenEJB] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4656208&i=1>>
> wrote:
> >
> > > just tried:
> > >
> > > final Properties p = new Properties();
> > > final InputStream is =
> > > getClassLoader().getResourceAsStream("common.properties");
> > > p.load(is);
> > >
> > > and it works
> > >
> > > i just did: echo "foo=bar" > lib/common.properties
> > >
> > > - Romain
> > >
> > >
> > > 2012/7/10 Romain Manni-Bucau <[hidden email]<
> > http://user/SendEmail.jtp?type=node&node=4656204&i=0>>
> > >
> > >
> > > > can you share the way you load it (to avoid us to try several things
> > > > before reproducing)?
> > > >
> > > > - Romain
> > > >
> > > >
> > > >
> > > > 2012/7/10 s0dz <[hidden email]<
> > http://user/SendEmail.jtp?type=node&node=4656204&i=1>>
> > >
> > > >
> > > >> I placed it in the /lib directory.
> > > >>
> > > >> It is a static class that loads it on OpenEJB startup.  It works in
> > > tomcat
> > > >> in this location, but not in OpenEJB.
> > > >>
> > > >> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via OpenEJB] <
> > > >> [hidden email] <
> http://user/SendEmail.jtp?type=node&node=4656204&i=2
>
> > >>
> > > wrote:
> > > >>
> > > >> > Hi,
> > > >> >
> > > >> > where is the file? when do you load it?
> > > >> >
> > > >> > - Romain
> > > >> >
> > > >> >
> > > >> > 2012/7/10 s0dz <[hidden email]<
> > > >> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
> > > >> >
> > > >> >
> > > >> > > I am working on replacing my company's old school framework
> with
> > an
> > > >> > > ActiveMQ/OpenEJB solution.  It has been going smoothly with
> > > >> re-factoring
> > > >> > > code and implementing OpenEJB.  This was until I ran into a
> slight
> > > >> > problem:
> > > >> > >
> > > >> > > I cannot figure out how to load in a "custom.properties" that
> > > contains
> > > >> > > various important properties custom to my company's software.
>  The
> > > >> .jar
> > > >> > > that
> > > >> > > actually does the accessing is working.  But it appears the
> > > >> classloader
> > > >> > is
> > > >> > > not finding "custom.properties."
> > > >> > >
> > > >> > > Any ideas?
> > > >> > >
> > > >> > > Thanks!
> > > >> > > Garrett
> > > >> > >
> > > >> > > --
> > > >> > > View this message in context:
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> > > >> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > >> > >
> > > >> >
> > > >> >
> > > >> > ------------------------------
> > > >> >  If you reply to this email, your message will be added to the
> > > >> discussion
> > > >> > below:
> > > >> >
> > > >> >
> > > >>
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
> > > >> >  To unsubscribe from Custom ".properties" file, click here<
> > > >> >
> > > >> > .
> > > >> > NAML<
> > > >>
> > >
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > > >> >
> > > >> >
> > > >>
> > > >>
> > > >> --
> > > >> View this message in context:
> > > >>
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
> > > >> Sent from the OpenEJB User mailing list archive at Nabble.com.
> > > >>
> > > >
> > > >
> > >
> > >
> > > ------------------------------
> > >  If you reply to this email, your message will be added to the
> discussion
> > > below:
> > >
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656204.html
>
> > >  To unsubscribe from Custom ".properties" file, click here<
> >
> >
> > > .
> > > NAML<
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> > >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656207.html
>
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656208.html
>  To unsubscribe from Custom ".properties" file, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656209.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
hmm

didnt try to package it, did you check our default exclusions prefixes?

- Romain


2012/7/10 s0dz <ga...@gmail.com>

> Sry for the delayed response.  I am doing something similar.
>
> InputStream is = null;
> Properties properties = new Properties();
>
> is = Thread.currentThread().getContextClassLoader().getResourceAsStream(
> "common.properties" );
>
> properties.load( is );
>
> But I get this:
>
> Exception occurred in target VM:
> java.lang.NullPointerException
>     at java.util.Properties$LineReader.readLine(Properties.java:418)
>     at java.util.Properties.load0(Properties.java:337)
>     at java.util.Properties.load(Properties.java:325)
>     *at
> com.communitect.framework.PropertyMgr.<clinit>(PropertyMgr.java:82)*
>     at com.communitect.ejb.protocol.SMTP.<clinit>(SMTP.java:44)
>     at java.lang.Class.forName0(Native Method)
>     at java.lang.Class.forName(Class.java:247)
>     at org.apache.openejb.util.Classes.forName(Classes.java:62)
>     at
>
> org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:139)
>     at
>
> org.apache.openejb.config.rules.CheckCallbacks.validate(CheckCallbacks.java:65)
>     at
>
> org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:45)
>     at
> org.apache.openejb.config.AppValidator.validate(AppValidator.java:96)
>     at
> org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:37)
>     at
>
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:321)
>     at
>
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:792)
>     at
>
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:668)
>     at
>
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:437)
>     at
>
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:345)
>     at
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:324)
>     at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
>     at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
>     at org.apache.openejb.server.Server.init(Server.java:64)
>     at org.apache.openejb.server.Main.initServer(Main.java:154)
>     at org.apache.openejb.server.Main.main(Main.java:128)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at org.apache.openejb.cli.MainImpl.main(MainImpl.java:148)
>     at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)
>
>
> Line 82:
>
> properties.load( is );
>
> The PropertyMgr.java is in a utility jar we use that contains business
> rules and database classes.
>
> This works when deployed in Tomcat, but not in OpenEJB.
>
>
> On Tue, Jul 10, 2012 at 3:01 AM, Romain Manni-Bucau [via OpenEJB] <
> ml-node+s979440n4656204h34@n4.nabble.com> wrote:
>
> > just tried:
> >
> > final Properties p = new Properties();
> > final InputStream is =
> > getClassLoader().getResourceAsStream("common.properties");
> > p.load(is);
> >
> > and it works
> >
> > i just did: echo "foo=bar" > lib/common.properties
> >
> > - Romain
> >
> >
> > 2012/7/10 Romain Manni-Bucau <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4656204&i=0>>
> >
> >
> > > can you share the way you load it (to avoid us to try several things
> > > before reproducing)?
> > >
> > > - Romain
> > >
> > >
> > >
> > > 2012/7/10 s0dz <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4656204&i=1>>
> >
> > >
> > >> I placed it in the /lib directory.
> > >>
> > >> It is a static class that loads it on OpenEJB startup.  It works in
> > tomcat
> > >> in this location, but not in OpenEJB.
> > >>
> > >> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via OpenEJB] <
> > >> [hidden email] <http://user/SendEmail.jtp?type=node&node=4656204&i=2
> >>
> > wrote:
> > >>
> > >> > Hi,
> > >> >
> > >> > where is the file? when do you load it?
> > >> >
> > >> > - Romain
> > >> >
> > >> >
> > >> > 2012/7/10 s0dz <[hidden email]<
> > >> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
> > >> >
> > >> >
> > >> > > I am working on replacing my company's old school framework with
> an
> > >> > > ActiveMQ/OpenEJB solution.  It has been going smoothly with
> > >> re-factoring
> > >> > > code and implementing OpenEJB.  This was until I ran into a slight
> > >> > problem:
> > >> > >
> > >> > > I cannot figure out how to load in a "custom.properties" that
> > contains
> > >> > > various important properties custom to my company's software.  The
> > >> .jar
> > >> > > that
> > >> > > actually does the accessing is working.  But it appears the
> > >> classloader
> > >> > is
> > >> > > not finding "custom.properties."
> > >> > >
> > >> > > Any ideas?
> > >> > >
> > >> > > Thanks!
> > >> > > Garrett
> > >> > >
> > >> > > --
> > >> > > View this message in context:
> > >> > >
> > >> >
> > >>
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> > >> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >> > >
> > >> >
> > >> >
> > >> > ------------------------------
> > >> >  If you reply to this email, your message will be added to the
> > >> discussion
> > >> > below:
> > >> >
> > >> >
> > >>
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
> > >> >  To unsubscribe from Custom ".properties" file, click here<
> > >> >
> > >> > .
> > >> > NAML<
> > >>
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >> View this message in context:
> > >>
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
> > >> Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >>
> > >
> > >
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656204.html
> >  To unsubscribe from Custom ".properties" file, click here<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==
> >
> > .
> > NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656207.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
Sry for the delayed response.  I am doing something similar.

InputStream is = null;
Properties properties = new Properties();

is = Thread.currentThread().getContextClassLoader().getResourceAsStream(
"common.properties" );

properties.load( is );

But I get this:

Exception occurred in target VM:
java.lang.NullPointerException
    at java.util.Properties$LineReader.readLine(Properties.java:418)
    at java.util.Properties.load0(Properties.java:337)
    at java.util.Properties.load(Properties.java:325)
    *at com.communitect.framework.PropertyMgr.<clinit>(PropertyMgr.java:82)*
    at com.communitect.ejb.protocol.SMTP.<clinit>(SMTP.java:44)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at org.apache.openejb.util.Classes.forName(Classes.java:62)
    at
org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:139)
    at
org.apache.openejb.config.rules.CheckCallbacks.validate(CheckCallbacks.java:65)
    at
org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:45)
    at org.apache.openejb.config.AppValidator.validate(AppValidator.java:96)
    at
org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:37)
    at
org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:321)
    at
org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:792)
    at
org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:668)
    at
org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:437)
    at
org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:345)
    at
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:324)
    at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:144)
    at org.apache.openejb.OpenEJB.init(OpenEJB.java:290)
    at org.apache.openejb.server.Server.init(Server.java:64)
    at org.apache.openejb.server.Main.initServer(Main.java:154)
    at org.apache.openejb.server.Main.main(Main.java:128)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.openejb.cli.MainImpl.main(MainImpl.java:148)
    at org.apache.openejb.cli.Bootstrap.main(Bootstrap.java:103)


Line 82:

properties.load( is );

The PropertyMgr.java is in a utility jar we use that contains business
rules and database classes.

This works when deployed in Tomcat, but not in OpenEJB.


On Tue, Jul 10, 2012 at 3:01 AM, Romain Manni-Bucau [via OpenEJB] <
ml-node+s979440n4656204h34@n4.nabble.com> wrote:

> just tried:
>
> final Properties p = new Properties();
> final InputStream is =
> getClassLoader().getResourceAsStream("common.properties");
> p.load(is);
>
> and it works
>
> i just did: echo "foo=bar" > lib/common.properties
>
> - Romain
>
>
> 2012/7/10 Romain Manni-Bucau <[hidden email]<http://user/SendEmail.jtp?type=node&node=4656204&i=0>>
>
>
> > can you share the way you load it (to avoid us to try several things
> > before reproducing)?
> >
> > - Romain
> >
> >
> >
> > 2012/7/10 s0dz <[hidden email]<http://user/SendEmail.jtp?type=node&node=4656204&i=1>>
>
> >
> >> I placed it in the /lib directory.
> >>
> >> It is a static class that loads it on OpenEJB startup.  It works in
> tomcat
> >> in this location, but not in OpenEJB.
> >>
> >> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via OpenEJB] <
> >> [hidden email] <http://user/SendEmail.jtp?type=node&node=4656204&i=2>>
> wrote:
> >>
> >> > Hi,
> >> >
> >> > where is the file? when do you load it?
> >> >
> >> > - Romain
> >> >
> >> >
> >> > 2012/7/10 s0dz <[hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
> >> >
> >> >
> >> > > I am working on replacing my company's old school framework with an
> >> > > ActiveMQ/OpenEJB solution.  It has been going smoothly with
> >> re-factoring
> >> > > code and implementing OpenEJB.  This was until I ran into a slight
> >> > problem:
> >> > >
> >> > > I cannot figure out how to load in a "custom.properties" that
> contains
> >> > > various important properties custom to my company's software.  The
> >> .jar
> >> > > that
> >> > > actually does the accessing is working.  But it appears the
> >> classloader
> >> > is
> >> > > not finding "custom.properties."
> >> > >
> >> > > Any ideas?
> >> > >
> >> > > Thanks!
> >> > > Garrett
> >> > >
> >> > > --
> >> > > View this message in context:
> >> > >
> >> >
> >>
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> >> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >> > >
> >> >
> >> >
> >> > ------------------------------
> >> >  If you reply to this email, your message will be added to the
> >> discussion
> >> > below:
> >> >
> >> >
> >>
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
> >> >  To unsubscribe from Custom ".properties" file, click here<
> >> >
> >> > .
> >> > NAML<
> >>
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >> >
> >> >
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
> >> Sent from the OpenEJB User mailing list archive at Nabble.com.
> >>
> >
> >
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656204.html
>  To unsubscribe from Custom ".properties" file, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656207.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
just tried:

final Properties p = new Properties();
final InputStream is =
getClassLoader().getResourceAsStream("common.properties");
p.load(is);

and it works

i just did: echo "foo=bar" > lib/common.properties

- Romain


2012/7/10 Romain Manni-Bucau <rm...@gmail.com>

> can you share the way you load it (to avoid us to try several things
> before reproducing)?
>
> - Romain
>
>
>
> 2012/7/10 s0dz <ga...@gmail.com>
>
>> I placed it in the /lib directory.
>>
>> It is a static class that loads it on OpenEJB startup.  It works in tomcat
>> in this location, but not in OpenEJB.
>>
>> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via OpenEJB] <
>> ml-node+s979440n4656192h62@n4.nabble.com> wrote:
>>
>> > Hi,
>> >
>> > where is the file? when do you load it?
>> >
>> > - Romain
>> >
>> >
>> > 2012/7/10 s0dz <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
>> >
>> >
>> > > I am working on replacing my company's old school framework with an
>> > > ActiveMQ/OpenEJB solution.  It has been going smoothly with
>> re-factoring
>> > > code and implementing OpenEJB.  This was until I ran into a slight
>> > problem:
>> > >
>> > > I cannot figure out how to load in a "custom.properties" that contains
>> > > various important properties custom to my company's software.  The
>> .jar
>> > > that
>> > > actually does the accessing is working.  But it appears the
>> classloader
>> > is
>> > > not finding "custom.properties."
>> > >
>> > > Any ideas?
>> > >
>> > > Thanks!
>> > > Garrett
>> > >
>> > > --
>> > > View this message in context:
>> > >
>> >
>> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
>> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
>> > >
>> >
>> >
>> > ------------------------------
>> >  If you reply to this email, your message will be added to the
>> discussion
>> > below:
>> >
>> >
>> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
>> >  To unsubscribe from Custom ".properties" file, click here<
>> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==
>> >
>> > .
>> > NAML<
>> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> >
>> >
>>
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
can you share the way you load it (to avoid us to try several things before
reproducing)?

- Romain


2012/7/10 s0dz <ga...@gmail.com>

> I placed it in the /lib directory.
>
> It is a static class that loads it on OpenEJB startup.  It works in tomcat
> in this location, but not in OpenEJB.
>
> On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via OpenEJB] <
> ml-node+s979440n4656192h62@n4.nabble.com> wrote:
>
> > Hi,
> >
> > where is the file? when do you load it?
> >
> > - Romain
> >
> >
> > 2012/7/10 s0dz <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
> >
> >
> > > I am working on replacing my company's old school framework with an
> > > ActiveMQ/OpenEJB solution.  It has been going smoothly with
> re-factoring
> > > code and implementing OpenEJB.  This was until I ran into a slight
> > problem:
> > >
> > > I cannot figure out how to load in a "custom.properties" that contains
> > > various important properties custom to my company's software.  The .jar
> > > that
> > > actually does the accessing is working.  But it appears the classloader
> > is
> > > not finding "custom.properties."
> > >
> > > Any ideas?
> > >
> > > Thanks!
> > > Garrett
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
> >  To unsubscribe from Custom ".properties" file, click here<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==
> >
> > .
> > NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Custom ".properties" file

Posted by s0dz <ga...@gmail.com>.
I placed it in the /lib directory.

It is a static class that loads it on OpenEJB startup.  It works in tomcat
in this location, but not in OpenEJB.

On Mon, Jul 9, 2012 at 4:58 PM, Romain Manni-Bucau [via OpenEJB] <
ml-node+s979440n4656192h62@n4.nabble.com> wrote:

> Hi,
>
> where is the file? when do you load it?
>
> - Romain
>
>
> 2012/7/10 s0dz <[hidden email]<http://user/SendEmail.jtp?type=node&node=4656192&i=0>>
>
>
> > I am working on replacing my company's old school framework with an
> > ActiveMQ/OpenEJB solution.  It has been going smoothly with re-factoring
> > code and implementing OpenEJB.  This was until I ran into a slight
> problem:
> >
> > I cannot figure out how to load in a "custom.properties" that contains
> > various important properties custom to my company's software.  The .jar
> > that
> > actually does the accessing is working.  But it appears the classloader
> is
> > not finding "custom.properties."
> >
> > Any ideas?
> >
> > Thanks!
> > Garrett
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656192.html
>  To unsubscribe from Custom ".properties" file, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4656190&code=Z2FycmV0dC5tY3RlYXJAZ21haWwuY29tfDQ2NTYxOTB8MjEwMjIwOTU1Mg==>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>


--
View this message in context: http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190p4656194.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Custom ".properties" file

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

where is the file? when do you load it?

- Romain


2012/7/10 s0dz <ga...@gmail.com>

> I am working on replacing my company's old school framework with an
> ActiveMQ/OpenEJB solution.  It has been going smoothly with re-factoring
> code and implementing OpenEJB.  This was until I ran into a slight problem:
>
> I cannot figure out how to load in a "custom.properties" that contains
> various important properties custom to my company's software.  The .jar
> that
> actually does the accessing is working.  But it appears the classloader is
> not finding "custom.properties."
>
> Any ideas?
>
> Thanks!
> Garrett
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Custom-properties-file-tp4656190.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>