启动Glassfish时出错(错误= 22)

时间:2013-09-25 14:24:35

标签: java glassfish jvm-arguments infrastructure

启动服务器glassfish时遇到问题。当我开始加载大约1分钟,然后立即发送下面引用的错误消息。

Glassfish域配置:

<java-config debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009" system-classpath="" classpath-suffix="">
    <jvm-options>-Djava.awt.headless=true</jvm-options>
    <jvm-options>-XX:+AggressiveOpts</jvm-options>
    <jvm-options>-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy</jvm-options>
    <jvm-options>-Xmn1500m</jvm-options>
    <jvm-options>-XX:+UseLargePages</jvm-options>
    <jvm-options>-Dfelix.fileinstall.disableConfigSave=false</jvm-options>
    <jvm-options>-Dosgi.shell.telnet.maxconn=1</jvm-options>
    <jvm-options>-Dfelix.fileinstall.poll=5000</jvm-options>
    <jvm-options>-XX:NewRatio=2</jvm-options>
    <jvm-options>-Djava.endorsed.dirs=${com.sun.aas.installRoot}/modules/endorsed${path.separator}${com.sun.aas.installRoot}/lib/endorsed</jvm-options>
    <jvm-options>-Dosgi.shell.telnet.port=6666</jvm-options>
    <jvm-options>-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory</jvm-options>
    <jvm-options>-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext</jvm-options>
    <jvm-options>-XX:+UseParallelOldGC</jvm-options>
    <jvm-options>-XX:PermSize=2048m</jvm-options>
    <jvm-options>-Dgosh.args=--nointeractive</jvm-options>
    <jvm-options>-Dwebconsole.type=properties</jvm-options>
    <jvm-options>-Djava.rmi.server.hostname=localhost</jvm-options>
    <jvm-options>-Dwebconsole.jms.url=tcp://localhost:61616</jvm-options>
    <jvm-options>-Djavax.management.builder.initial=com.sun.enterprise.v3.admin.AppServerMBeanServerBuilder</jvm-options>
    <jvm-options>-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as</jvm-options>
    <jvm-options>-XX:MaxPermSize=4096m</jvm-options>
    <jvm-options>-XX:LargePageSizeInBytes=2048k</jvm-options>
    <jvm-options>-XX:+UnlockDiagnosticVMOptions</jvm-options>
    <jvm-options>-XX:ParallelGCThreads=16</jvm-options>
    <jvm-options>-Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi</jvm-options>
    <jvm-options>-Dfelix.fileinstall.bundles.startTransient=true</jvm-options>
    <jvm-options>-Dfelix.fileinstall.bundles.new.start=true</jvm-options>
    <jvm-options>-Dfelix.fileinstall.dir=${com.sun.aas.installRoot}/modules/autostart/</jvm-options>
    <jvm-options>-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf</jvm-options>
    <jvm-options>-Dosgi.shell.telnet.ip=127.0.0.1</jvm-options>
    <jvm-options>-Dfelix.fileinstall.log.level=2</jvm-options>
    <jvm-options>-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks</jvm-options>
    <jvm-options>-server</jvm-options>
    <jvm-options>-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver</jvm-options>
    <jvm-options>-DAllowMediatedWriteInDefaultFetchGroup=true</jvm-options>
    <jvm-options>-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks</jvm-options>
    <jvm-options>-Dcom.sun.enterprise.server.ss.ASQuickStartup=false</jvm-options>
    <jvm-options>-Xms2048m</jvm-options>
    <jvm-options>-DANTLR_USE_DIRECT_CLASS_LOADING=true</jvm-options>
    <jvm-options>-Xmx5020m</jvm-options>
    <jvm-options>-XX:+UseTLAB</jvm-options>
    <jvm-options>-XX:+UseParallelGC</jvm-options>
  </java-config>

错误说明:

Waiting for domain1 to start ..................................Error starting domain domain1.
The server exited prematurely with exit code 0.
Before it died, it produced the following output:

Java HotSpot(TM) 64-Bit Server VM warning: Failed to reserve shared memory (errno = 22).
Java HotSpot(TM) 64-Bit Server VM warning: Failed to reserve shared memory (errno = 22).
Launching GlassFish on Felix platform

Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread "Grizzly-kernel-thread(1)"

Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread "Grizzly-kernel-thread(1)"

Command start-domain failed.

如果有人知道我能做些什么来解决这个问题会对我有所帮助。

谢谢!

1 个答案:

答案 0 :(得分:1)

当您使用-XX:+UseLargePages并且没有更多可用的HugePages或当前用户无法访问它们时会发生此问题。

如果您运行,可以查看HugePages是否可用:cat /proc/meminfo(在* nix上)

尝试删除JVM选项,看看它是否有帮助。 In the debian wiki您可以获得有关HugePages及其使用方式的详细信息。