I have a problem when starting my server glassfish. When I start it loads in about 1 minute and then immediately sends the error message quoted below.

Glassfish domain config:

<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>

Error description:

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.

If someone know what i can do to fix this problem will help me a lot.

Thanks!

有帮助吗?

解决方案

This problem occurs when you are using -XX:+UseLargePages and no more HugePages are available or they are not accessible for the current user.

You can see if HugePages are available if you run: cat /proc/meminfo (on *nix)

Try removing the JVM option and see if it helps. In the debian wiki you can get some detailed information about HugePages and how they are used.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top