admin@glassfish.java.net

Re: Follow up on Classpath issues

From: Kedar Mhaswade <Kedar.Mhaswade_at_Sun.COM>
Date: Mon, 24 Sep 2007 13:13:32 -0700

First off:

http://forums.java.net/jive/thread.jspa?messageID=235666

is the discussion thread at the forum.

Byron:

Please respond there.

Another point: I agree that we should change the launcher to take
the environmental classpath and put that in -Dcom.sun.aas.ClassPathSuffix
instead of appending it to -cp. There is a subtle difference in the two.

Byron: I would request you to do three things:

- Respond to the thread.
- Create an RFE that makes launcher modify -Dcom.sun.aas.ClassPathSuffix
   by the environment classpath when env-classpath-ignored=false
- Create another RFE which enables:
   -DFoo=$ENV{"BAR"} to translate to System.getEnv("BAR");


Thanks,
Kedar

BN wrote:
> I changed the attribute of interest in domain.xml:
>
> env-classpath-ignored="false"
>
> The result is that ASLauncher puts the contents of the CLASSPATH env
> variable like so in the java command line:
>
> java -cp <jhall,appserv-launch><your-classpath>
>
> I then deployed a web module that is dependent on a jar in CLASSPATH --
> and it worked fine.
>
> The classpath contents are put *almost* in the front of the runtime
> classpath. Take a look at the actual runtime classpath below. My
> classpath stuff shows up starting at the third position (CLASSPATH ==>
> .;C:\dev\elf\dist\elf.jar;.............)
>
> I can change ASLauncher to put the env CLASSPATH contents in, say,
> classpath-suffix instead of as the "-cp" arg.
> Thoughts????
>
> note that the output below is from calling com.elf.util.Classpath() --
> which is in elf.jar which is NOT in the deployed web-module's tree.
> Thus proving that the web module can "see" the jar that is in the env
> classpath
>
> Kedar, in summary,
>
> * The user problem can be solved by simply changing one "true" to
> "false" in domain.xml and setting env CLASSPATH to their
> mega-classpath
> * They have to be careful about classes in their jars "hiding"
> classes by the same name in GF jars.
> * They must restart the server if they change anything inside the
> jars (to "see" the changes if the class is already loaded)
>
>
> -------------------------------------------------------------------------
>
> D:/as/lib/jhall.jar
> D:\as\lib\appserv-launch.jar
> *.
> C:\dev\elf\dist\elf.jar
> c:\dev\derby\lib\derby.jar
> c:\dev\derby\lib\derbytools.jar
> C:\Program Files\Java\jre1.6.0_01\lib\ext\QTJava.zip
> *D:/as\lib\javaee.jar
> c:/jdk/jre/../lib/tools.jar
> D:/as\lib\install/applications/jmsra/imqjmsra.jar
> D:/as\lib\com-sun-commons-launcher.jar
> D:/as\lib\com-sun-commons-logging.jar
> D:/as/imq/lib/jaxm-api.jar
> D:/as/imq/lib/fscontext.jar
> D:/as/imq/lib/imqbroker.jar
> D:/as/imq/lib/imqjmx.jar
> D:/as/imq/lib/imqxm.jar
> D:/as\lib\webservices-rt.jar
> D:/as\lib\webservices-tools.jar
> D:/as\lib\mail.jar
> D:/as\lib\appserv-jstl.jar
> D:/as\lib\jmxremote_optional.jar
> D:/as/lib/SUNWjdmk/5.1/lib/jdmkrt.jar
> D:/as\lib\activation.jar
> D:/as\lib\appserv-rt.jar
> D:/as\lib\appserv-admin.jar
> D:/as\lib\appserv-cmp.jar
> D:/as/updatecenter/lib/updatecenter.jar
> D:/as/jbi/lib/jbi.jar
> D:/as/imq/lib/imqjmx.jar
> D:/as/lib/ant/lib/ant.jar
> D:/as\lib\dbschema.jar
> D:/as\lib\appserv-se.jar
> D:/as\lib\appserv-ee.jar
> D:/as\lib\jesmf-plugin.jar
> D:/as\lib\/lib/dbstate.jar
> D:/as\lib\/lib/hadbjdbc4.jar
> D:/as\lib\jgroups-all.jar
> D:/as/lib/SUNWmfwk/lib/mfwk_instrum_tk.jar
> D:\as\lib\activation.jar
> D:\as\lib\admin-cli-ee.jar
> D:\as\lib\admin-cli.jar
> D:\as\lib\appserv-admin.jar
> D:\as\lib\appserv-cmp.jar
> D:\as\lib\appserv-deployment-client.jar
> D:\as\lib\appserv-ee.jar
> D:\as\lib\appserv-ext.jar
> D:\as\lib\appserv-jstl.jar
> D:\as\lib\appserv-jwsacc.jar
> D:\as\lib\appserv-launch.jar
> D:\as\lib\appserv-rt.jar
> D:\as\lib\appserv-se.jar
> D:\as\lib\appserv-tags.jar
> D:\as\lib\appserv-upgrade.jar
> D:\as\lib\appserv-ws.jar
> D:\as\lib\com-sun-commons-launcher.jar
> D:\as\lib\com-sun-commons-logging.jar
> D:\as\lib\dbschema.jar
> D:\as\lib\j2ee-svc.jar
> D:\as\lib\j2ee.jar
> D:\as\lib\javaee.jar
> D:\as\lib\jesmf-plugin.jar
> D:\as\lib\jhall.jar
> D:\as\lib\jmac-api.jar
> D:\as\lib\jmxremote_optional.jar
> D:\as\lib\jsf-impl.jar
> D:\as\lib\jxta.jar
> D:\as\lib\mail.jar
> D:\as\lib\Pack200Task.jar
> D:\as\lib\shoal-gms.jar
> D:\as\lib\sun-appserv-ant.jar
> D:\as\lib\toplink-essentials-agent.jar
> D:\as\lib\toplink-essentials.jar
> D:\as\lib\webservices-rt.jar
> D:\as\lib\webservices-tools.jar
> D:/as