I'm running glassfish v3 on a ubuntu linux box. I've been having some problems with the server. There are times when the server will stop accepting requests and just hang. Nothing in the log has given me any help. While trying to track down this issue, I've noticed an oddity... the following is what I see when i type ps aux | grep java:
155 % ps aux | grep java
my-company 24242 90.0 17.3 3656228 690024 ? Sl 18:39 1:17 /usr/home/my-company/local/jdk1.6.0_45/bin/java -cp /usr/home/my-company/glassfish3/glassfish/modules/glassfish.jar -XX:+UnlockDiagnosticVMOptions -XX:MaxPermSize=256m -XX:NewRatio=2 -Xmx1024m -client -javaagent:/usr/home/my-company/glassfish3/glassfish/lib/monitor/flashlight-agent.jar -Dfelix.fileinstall.disableConfigSave=false -Djavax.net.ssl.keyStore=/usr/home/my-company/glassfish3/glassfish/domains/domain1/config/keystore.jks -Djava.awt.headless=true -Dfelix.fileinstall.poll=5000 -Djava.endorsed.dirs=/usr/home/my-company/glassfish3/glassfish/modules/endorsed:/usr/home/my-company/glassfish3/glassfish/lib/endorsed -Dfelix.fileinstall.bundles.startTransient=true -Djavax.net.ssl.trustStore=/usr/home/my-company/glassfish3/glassfish/domains/domain1/config/cacerts.jks -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as -Djava.security.auth.login.config=/usr/home/my-company/glassfish3/glassfish/domains/domain1/config/login.conf -DANTLR_USE_DIRECT_CLASS_LOADING=true -Dgosh.args=--nointeractive -Dosgi.shell.telnet.maxconn=1 -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -Dfelix.fileinstall.dir=/usr/home/my-company/glassfish3/glassfish/modules/autostart/ -Dosgi.shell.telnet.port=6666 -Djava.security.policy=/usr/home/my-company/glassfish3/glassfish/domains/domain1/config/server.policy -Dfelix.fileinstall.log.level=2 -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Dosgi.shell.telnet.ip=127.0.0.1 -Dcom.sun.aas.instanceRoot=/usr/home/my-company/glassfish3/glassfish/domains/domain1 -Dcom.sun.aas.installRoot=/usr/home/my-company/glassfish3/glassfish -Djava.ext.dirs=/usr/home/my-company/local/jdk1.6.0_45/lib/ext:/usr/home/my-company/local/jdk1.6.0_45/jre/lib/ext:/usr/home/my-company/glassfish3/glassfish/domains/domain1/lib/ext -Dfelix.fileinstall.bundles.new.start=true -Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.fileinstall -Djava.library.path=/usr/home/my-company/glassfish3/glassfish/lib:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk-amd64/lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib com.sun.enterprise.glassfish.bootstrap.ASMain -domainname domain1 -asadmin-args --host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=false,,,start-domain,,,--verbose=false,,,--debug=false,,,--domaindir,,,/usr/home/my-company/glassfish3/glassfish/domains,,,domain1 -instancename server -verbose false -debug false -asadmin-classpath /usr/home/my-company/glassfish3/glassfish/modules/admin-cli.jar -asadmin-classname com.sun.enterprise.admin.cli.AsadminMain -upgrade false -type DAS -domaindir /usr/home/my-company/glassfish3/glassfish/domains/domain1 -read-stdin true
my-company 24427 0.0 0.0 6512 620 pts/0 S+ 18:40 0:00 grep java
There is something rather odd... it appears that the jvm used to start glassfish (via the asadmin command tool) is the JVM located at /usr/home/my-company/local/jdk1.6.0_45, but further in the glob of text, you can see the java.library.path set and it only includes libraries in the /usr/lib/jvm/java-6-openjdk-amd64/ !
The hosting company i'm using installs openJDK by default. I've installed the official oracle version of java /usr/home/my-company/local/jdk1.6.0_45 -- that's the version i want to use and I have set JAVA_HOME and JDK_HOME to point to reflect this. How do I set java.library.path? should it be set via an environment variable, or is this something I have to set inside glassfish itself?