Hi,
I try to load property files and other resources from a directory
that is not part of my J2EE application. Resources are not packaged
inside a jar file
I did the following configuration:
Deployment is made via JMX by means of addUrl of the DeploymentScanner.
The deployed directory looks like this
| * jboss-service.xml
| * war - file
|
The content of the jboss-service.xml looks like this
| <server>
| <loader-repository>com.winterthur.jackpot.karin:loader=sample.ear
| <loader-repository-config>java2ParentDelegation=false
| </loader-repository-config>
| </loader-repository>
|
| <!-- this is just an example do not care that which library it is -->
| <classpath codebase="file:/C:/common/" archives="mycommonlib.jar"/>
| <classpath codebase="file:/C:/commonresources/" archives="*"/>
| </server>
|
I defined the same loader repository in the jboss-web.xml of the War file.
In the servlet I try to load a resource that is located inside the directory
commonresources
| URL
url=Thread.currentThread().getContextClassLoader().getResource("myresource.txt");
|
In the server.log file the following is logged:
| 2005-02-08 16:58:05,776 DEBUG [org.jboss.mx.loading.RepositoryClassLoader]
Added url: file:/C:/commonresources/myresource.txt, to ucl: [EMAIL PROTECTED]
url=file:/C:/eplatform/jboss/4.0/server/eplatform/tmp/deploy/tmp16962jboss-service.xml
,addedOrder=11}
|
The file myresource.txt cannot be loaded.
But it can be loaded if I place the file myresource.txt in
a Jar file and put it in the directory C:/commonresources/.
It can be loaded as well when I create a sub-directory in the folder
C:/commonresources/mydirectory
(e.g. C:/commonresources/mydirectory) and put my file there.
Is this really the way to do it? Is something wrong with this configuration.
Thanks and regards
Karin
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3865845#3865845
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3865845
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user