views:

1775

answers:

3

I am working on deploying a J2ee application that I have previously been deploying in JBOSS into Weblogic 10.3.1.0. I am running into an issue with external properties files. In Jboss I can just put the properties files into $JBOSS_HOME/server/default/conf, and they are loaded onto the system classpath and I can access them without any problems. I was able to put shared libraries into $MIDDLEWAREHOME/user_projects/domains/mydomain/lib and they were loaded into the system classpath without any problems but I am unable to load properties files.

Does anyone know how to include external properties files in Weblogic?

Thanks,

A: 

Although it may be a little extra effort, if you put the files into a JAR before dropping them into that lib directory, that should work.

Adam Batkin
I did that, I put the newly created jar file(containing my properties file) in a lib folder defined on the classpath. This worked, and I figured it would, but it is not ideal to have to jar/unjar these config files when a change needs to be made. This is only a few steps better than including the properties file in my ear file somewhere. For now it works, so I'm going to go with it while looking for a better solution.
broschb
A: 

You can look at your setDomainEnv.cmd (Windows) or setDomainEnv.sh (Unix/Linux) script in your domain files and see what locations are added in the CLASSPATH for your domain. Then just choose one folder and place the properties file there, if you want a specific location for your properties file just edit the script.

victor hugo
I did that, and I put the files in a folder that is added to classpath, it is not picking up any properties files. It is however picking up the jar files that I put in that same directory. I'm not sure why the properties files are not getting picked up.
broschb
A: 

I figured this out and have it working the way I would expect. First I did try the suggestions as above. If i added a folder to my classpath, or put the properties files in a folder on my classpath, the jars in the file were picked up, but not properties files. If i put my properties files in a jar, and put them in a folder on my classpath everything worked. But I did not want to have jar my files everytime a change was made. The following works in my env.

If i place the properties files in %WEBLOGIC_HOME%/user_projects/domains/MYDOMAIN then they are getting picked up, without having to be placed in a jar file.

broschb