独立Glassfish无法以ClassNotFoundException启动

时间:2013-09-27 20:54:13

标签: glassfish

我从运行Java 1.6.0_10的Debian机器上的zip文件中解压缩Glassfish 3.1.2.2。当我尝试启动Glassfish时,它失败并出现ClassNotFoundException。

java/lang/ClassNotFoundException: error in opening JAR file /u/seqprodbio/bin/glassfish3/glassfish/modules/endorsed/._webservices-api-osgi.jar

机器信息

$ uname -a
Linux platinum 3.2.0-0.bpo.4-amd64 #1 SMP Debian 3.2.46-1~bpo60+1 x86_64 GNU/Linux
$ hostname
platinum
$ domainname
(none)
$ cat /etc/hosts
127.0.0.1   localhost
10.0.0.207  platinum.company.com    platinum

Java Info

$ java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode)

完整日志

$ ./asadmin start-domain --verbose domain1
27-Sep-2013 4:51:02 PM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
-XX:+UnlockDiagnosticVMOptions
-XX:PermSize=64m
-XX:MaxPermSize=192m
-XX:NewRatio=2
-Xmx512m
-javaagent:/u/seqprodbio/bin/glassfish3/glassfish/lib/monitor/flashlight-agent.jar
-client
-Dosgi.shell.telnet.maxconn=1
-Dfelix.fileinstall.disableConfigSave=false
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.dir=/u/seqprodbio/bin/glassfish3/glassfish/modules/autostart/
-Djavax.net.ssl.keyStore=/u/seqprodbio/bin/glassfish3/glassfish/domains/domain1/config/keystore.jks
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=/u/seqprodbio/bin/glassfish3/glassfish/domains/domain1/config/server.policy
-Djava.awt.headless=true
-Dfelix.fileinstall.log.level=2
-Dfelix.fileinstall.poll=5000
-Dcom.sun.aas.instanceRoot=/u/seqprodbio/bin/glassfish3/glassfish/domains/domain1
-Dosgi.shell.telnet.ip=127.0.0.1
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Djava.endorsed.dirs=/u/seqprodbio/bin/glassfish3/glassfish/modules/endorsed:/u/seqprodbio/bin/glassfish3/glassfish/lib/endorsed
-Dcom.sun.aas.installRoot=/u/seqprodbio/bin/glassfish3/glassfish
-Dfelix.fileinstall.bundles.startTransient=true
-Djava.ext.dirs=/cr/local/lib/jvm/jdk1.6.0_10/lib/ext:/cr/local/lib/jvm/jdk1.6.0_10/jre/lib/ext:/u/seqprodbio/bin/glassfish3/glassfish/domains/domain1/lib/ext
-Dfelix.fileinstall.bundles.new.start=true
-Djavax.net.ssl.trustStore=/u/seqprodbio/bin/glassfish3/glassfish/domains/domain1/config/cacerts.jks
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Djava.security.auth.login.config=/u/seqprodbio/bin/glassfish3/glassfish/domains/domain1/config/login.conf
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Dgosh.args=--nointeractive
27-Sep-2013 4:51:02 PM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 15 msec.
Error occurred during initialization of VM
java/lang/ClassNotFoundException: error in opening JAR file /u/seqprodbio/bin/glassfish3/glassfish/modules/endorsed/._webservices-api-osgi.jar
Command start-domain failed.
The DAS was stopped.

1 个答案:

答案 0 :(得分:0)

您应该将包含该JAR的目录添加到您的Java CLASSPATH中。

CLASSPATH是一个环境变量,它告诉系统在哪里查找java类。有关如何设置的详细信息,请转到here

另外,检查是否设置了JAVA_HOME变量。