glassfish v3 classpath settings

12,343

Solution 1

You could put them in the server's classpath if necessary. Go to the domain's lib directory.

Solution 2

In your Glassfish domain's domain.xml you can use the classpath-suffix attribute of the java-config tag to point to locations that should be part of Glassfish's classpath for that particular domain.

Solution 3

For jar's this is OK but for property files it is something else. It tends to be harder unless you put them in the WAR (which means you cannot update them without a full redeploy).

I tried to put the xxx.properties in the config folder & adapting the following domain.xml line

 <java-config debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009" system-classpath="${com.sun.aas.instanceRoot}/MY_VALUE" classpath-suffix="">
      ...
 </java-config>

with MY_VALUE taking the following values :

  1. config
  2. config/
  3. config/xxx.properties

Trying the same with the classpath-suffix did not help either.

Requesting the web-app to display the classpath with the following line :

String path = System.getProperty("java.class.path");
LOG.info("Classpath is : '" + path + "'.");

did show that the values were picked up ... but the property-file was never accessible from the ClassLoader.getResourceAsInputStream()

Share:
12,343
Marko
Author by

Marko

Updated on June 04, 2022

Comments

  • Marko
    Marko almost 2 years

    I'm developing j2ee app on glassfish v3 which will remotely call EJB deployed on jboss 5 app server. For this to work, my app has to have jboss client jars in class path. I managed to do this by packaging client jar files with my application, but this expends size by aprox 10mb, thus uploading app becomes an issue.

    How can I put these jars elsewhere so that gf picks them up so I dont need to hold them in my app?