无法在Eclipse中启动GlassFish:GlassFish错误:无法找到或加载主类文件

时间:2012-08-16 19:54:00

标签: eclipse glassfish

我正试图从日食(juno)中启动玻璃鱼。我收到以下错误:

信息:成功启动10毫秒。 错误:无法找到或加载主类文件 命令start-domain失败。 DAS被停止了。

 Here is the complete output in Eclipse:



  Aug 16, 2012 11:51:23 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
    INFO: JVM invocation command line:

    C:\Program Files\Java\jdk1.7.0\bin\java.exe
    -cp
    C:/glassfish3-2/glassfish3/glassfish/modules/glassfish.jar
   -XX:+UnlockDiagnosticVMOptions
   -XX:MaxPermSize=192m
    -XX:NewRatio=2
    -Xmx512m
    -javaagent:C:/glassfish3-2/glassfish3/glassfish/lib/monitor/btrace-   agent.jar=unsafe=true,noServer=true
    -client
    -Dosgi.shell.telnet.maxconn=1
    -Dfelix.fileinstall.disableConfigSave=false
    -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
    -Dfelix.fileinstall.dir=C:\glassfish3-2\glassfish3\glassfish/modules/autostart/
    -Djavax.net.ssl.keyStore=C:\glassfish3-2\glassfish3\glassfish\domains\domain1/config/keystore.jks 
    -Dosgi.shell.telnet.port=6666
    -Djava.security.policy=C:\glassfish3-2\glassfish3\glassfish\domains\domain1/config/server.policy
    -Dfelix.fileinstall.log.level=2
    -Dfelix.fileinstall.poll=5000
    -Dcom.sun.aas.instanceRoot=C:\glassfish3-2\glassfish3\glassfish\domains\domain1
    -Dosgi.shell.telnet.ip=127.0.0.1
         -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serv    erbeans.AppserverConfigEnvironmentFactory
   -Djava.endorsed.dirs=C:\glassfish3-2\glassfish3\glassfish/modules/endorsed;      C:\glassfish3-2\glassfish3\glassfish/lib/endorsed
    -Dcom.sun.aas.installRoot=C:\glassfish3-2\glassfish3\glassfish
    -Dfelix.fileinstall.bundles.startTransient=true
    -Djava.ext.dirs=C:\Program Files\Java\jdk1.7.0/lib/ext;C:\Program Files\Java\jdk1.7.0/jre/lib/ext;C:\glassfish3-2\glassfish3\glassfish\domains\domain1/lib/ext
    -Dfelix.fileinstall.bundles.new.start=true
    -Djavax.net.ssl.trustStore=C:\glassfish3-2\glassfish3\glassfish\domains\domain1/config/cacerts.jks
       Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command
    -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
    -Djava.security.auth.login.config=C:\glassfish3-2\glassfish3\glassfish\domains\domain1/config/login.conf
    -DANTLR_USE_DIRECT_CLASS_LOADING=true
    -Dgosh.args=--nointeractive
    -Djava.library.path=C:/glassfish3-2/glassfish3/glassfish/lib;C:/Program Files/Java/jdk1.7.0/bin;C:/Windows/Sun/Java/bin;C:/Windows/System32;C:/Windows;C:/Program Files (x86)/HP SimplePass 2011/x64;C:/Program Files (x86)/HP SimplePass 2011;C:/Program Files/Common Files/Microsoft Shared/Windows Live;C:/Program Files (x86)/Common Files/microsoft shared/Windows Live;C:/Windows/System32/wbem;C:/Windows/System32/WindowsPowerShell/v1.0;C:/Program Files (x86)/Windows Live/Shared;C:/Program Files/Intel/WiFi/bin;C:/Program Files/Common Files/Intel/WirelessCommon;C:/Program Files (x86)/Intel/Services/IPT;C:/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn;C:/Program Files/Microsoft SQL Server/100/Tools/Binn;C:/Program Files/Microsoft SQL Server/100/DTS/Binn;C:/Program Files (x86)/Microsoft ASP.NET/ASP.NET Web Pages/v1.0;C:/Program Files (x86)/Java/jdk1.7.0_01/bin;C:/glassfish3-2/glassfish3/glassfish/"C:/eclipse/eclipse.exe;C:/glassfish3-2/glassfish3/glassfish/" -vm "C:/Program Files (x86)/Java/jdk1.7.0_01/jre/bin/javaw.exe;C:/glassfish3-2/glassfish3/glassfish/.;C:/Program Files/Microsoft SQL Server/110/Tools/Binn;C:/Program Files (x86)/Microsoft SQL Server/110/Tools/Binn;C:/Program Files/Microsoft SQL Server/110/DTS/Binn;C:/Program Files (x86)/Microsoft SQL Server/110/Tools/Binn/ManagementStudio;C:/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn;C:/Program Files/jEdit;C:/Program Files (x86)/Java/jre7/bin;C:/Program Files (x86)/QuickTime/QTSystem;C:/Program Files/Java/jdk1.7.0/db/bin;C:/glassfish3-2/glassfish3/glassfish
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=true,,,--debug=false,,,--domaindir,,,C:\glassfish3-2\glassfish3\glassfish\domains,,,domain1
    -instancename
server
    -verbose
true
    -debug
false
    -asadmin-classpath
C:/glassfish3-2/glassfish3/glassfish/modules/admin-cli.jar
    -asadmin-classname
com.sun.enterprise.admin.cli.AsadminMain
    -upgrade
false
    -type
DAS
    -domaindir
C:/glassfish3-2/glassfish3/glassfish/domains/domain1
    -read-stdin
true
    Aug 16, 2012 11:51:23 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
    INFO: Successfully launched in 10 msec.
    Error: Could not find or load main class Files 
    Command start-domain failed.
    The DAS was stopped.

一如既往地感谢。

此致 umbregachoong

2 个答案:

答案 0 :(得分:3)

这发生在我身上,在命令提示符下启动了glassfish。

c:\glassfish4\glassfish\bin>asadmin start-domain
Waiting for domain1 to start .
Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:

Error: Could not find or load main class Files

Command start-domain failed.

这是由路径上的以下内容引起的:

Path=...;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;...

答案 1 :(得分:1)

我遇到了与jan.supol相同的问题,将NVIDIA二进制文件的路径设置为双引号,这样也修复了它:

Path=...;"C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common";...

很可能这可能是由PATH变量中没有用双引号括起来的任何空格引起的。