1

I am trying to install Glassfish 3.1 and ended up in configuration fail. I am running it on Windows 7 behind corporate proxy.

It created a default domain successfully but when attempted to start domain it failed showing following message.

Starting domain
_______________
Executing command :C:\glassfish6\glassfish\bin\asadmin.bat start-domain domain1

C:\glassfish6\glassfish\bin\asadmin.bat start-domain domain1
Attempting to start domain1.... Please look at the server log for more details.....

nothing happens after this. Below is my asadmin file.

REM Always use JDK 1.6 or higher
REM Depends on Java from ..\config\asenv.bat
VERIFY OTHER 2>nul
setlocal ENABLEEXTENSIONS
if ERRORLEVEL 0 goto ok
echo "Unable to enable extensions"
exit /B 1
:ok
call "%~dp0..\config\asenv.bat" 
if "%AS_JAVA%" == "C:\Program Files\Java\jdk1.8.0_102" goto UsePath
set JAVA="%AS_JAVA%\bin\java"
goto run
:UsePath
set JAVA=java
:run
%JAVA% -jar "%~dp0..\modules\admin-cli.jar" %*

server logs

Aug 29, 2017 11:02:39 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
-XX:+UnlockDiagnosticVMOptions
-XX:NewRatio=2
-XX:MaxPermSize=192m
-XX:PermSize=64m
-Xmx512m
-javaagent:C:/glassfish6/glassfish/lib/monitor/flashlight-agent.jar
-client
-Djava.security.auth.login.config=C:\glassfish6\glassfish\domains\jmsnew/config/login.conf
-Dfelix.fileinstall.disableConfigSave=false
-Djavax.net.ssl.trustStore=C:\glassfish6\glassfish\domains\jmsnew/config/cacerts.jks
-Dfelix.fileinstall.dir=C:\glassfish6\glassfish/modules/autostart/
-Dfelix.fileinstall.bundles.new.start=true
-Dcom.sun.aas.instanceRoot=C:\glassfish6\glassfish\domains\jmsnew
-Dosgi.shell.telnet.port=6666
-Dgosh.args=--nointeractive
-Dcom.sun.aas.installRoot=C:\glassfish6\glassfish
-Dfelix.fileinstall.poll=5000
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Djava.endorsed.dirs=C:\glassfish6\glassfish/modules/endorsed;C:\glassfish6\glassfish/lib/endorsed
-Djava.security.policy=C:\glassfish6\glassfish\domains\jmsnew/config/server.policy
-Dosgi.shell.telnet.maxconn=1
-Dfelix.fileinstall.bundles.startTransient=true
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dfelix.fileinstall.log.level=2
-Dosgi.shell.telnet.ip=127.0.0.1
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.awt.headless=true
-Djava.ext.dirs=C:\Program Files\Java\jdk1.8.0_102/lib/ext;C:\Program Files\Java\jdk1.8.0_102/jre/lib/ext;C:\glassfish6\glassfish\domains\jmsnew/lib/ext
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djavax.net.ssl.keyStore=C:\glassfish6\glassfish\domains\jmsnew/config/keystore.jks
Aug 29, 2017 11:02:39 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 10 msec.
Aug 29, 2017 11:02:53 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
-XX:+UnlockDiagnosticVMOptions
-XX:NewRatio=2
-XX:MaxPermSize=192m
-XX:PermSize=64m
-Xmx512m
-javaagent:C:/glassfish6/glassfish/lib/monitor/flashlight-agent.jar
-client
-Djava.security.auth.login.config=C:\glassfish6\glassfish\domains\jmsnew/config/login.conf
-Dfelix.fileinstall.disableConfigSave=false
-Djavax.net.ssl.trustStore=C:\glassfish6\glassfish\domains\jmsnew/config/cacerts.jks
-Dfelix.fileinstall.dir=C:\glassfish6\glassfish/modules/autostart/
-Dfelix.fileinstall.bundles.new.start=true
-Dcom.sun.aas.instanceRoot=C:\glassfish6\glassfish\domains\jmsnew
-Dosgi.shell.telnet.port=6666
-Dgosh.args=--nointeractive
-Dcom.sun.aas.installRoot=C:\glassfish6\glassfish
-Dfelix.fileinstall.poll=5000
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Djava.endorsed.dirs=C:\glassfish6\glassfish/modules/endorsed;C:\glassfish6\glassfish/lib/endorsed
-Djava.security.policy=C:\glassfish6\glassfish\domains\jmsnew/config/server.policy
-Dosgi.shell.telnet.maxconn=1
-Dfelix.fileinstall.bundles.startTransient=true
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dfelix.fileinstall.log.level=2
-Dosgi.shell.telnet.ip=127.0.0.1
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.awt.headless=true
-Djava.ext.dirs=C:\Program Files\Java\jdk1.8.0_102/lib/ext;C:\Program Files\Java\jdk1.8.0_102/jre/lib/ext;C:\glassfish6\glassfish\domains\jmsnew/lib/ext
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djavax.net.ssl.keyStore=C:\glassfish6\glassfish\domains\jmsnew/config/keystore.jks
Aug 29, 2017 11:02:53 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 17 msec.
Aug 29, 2017 11:05:17 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
-XX:+UnlockDiagnosticVMOptions
-XX:NewRatio=2
-XX:MaxPermSize=192m
-XX:PermSize=64m
-Xmx512m
-javaagent:C:/glassfish6/glassfish/lib/monitor/flashlight-agent.jar
-client
-Djava.security.auth.login.config=C:\glassfish6\glassfish\domains\jmsnew/config/login.conf
-Dfelix.fileinstall.disableConfigSave=false
-Djavax.net.ssl.trustStore=C:\glassfish6\glassfish\domains\jmsnew/config/cacerts.jks
-Dfelix.fileinstall.dir=C:\glassfish6\glassfish/modules/autostart/
-Dfelix.fileinstall.bundles.new.start=true
-Dcom.sun.aas.instanceRoot=C:\glassfish6\glassfish\domains\jmsnew
-Dosgi.shell.telnet.port=6666
-Dgosh.args=--nointeractive
-Dcom.sun.aas.installRoot=C:\glassfish6\glassfish
-Dfelix.fileinstall.poll=5000
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Djava.endorsed.dirs=C:\glassfish6\glassfish/modules/endorsed;C:\glassfish6\glassfish/lib/endorsed
-Djava.security.policy=C:\glassfish6\glassfish\domains\jmsnew/config/server.policy
-Dosgi.shell.telnet.maxconn=1
-Dfelix.fileinstall.bundles.startTransient=true
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dfelix.fileinstall.log.level=2
-Dosgi.shell.telnet.ip=127.0.0.1
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.awt.headless=true
-Djava.ext.dirs=C:\Program Files\Java\jdk1.8.0_102/lib/ext;C:\Program Files\Java\jdk1.8.0_102/jre/lib/ext;C:\glassfish6\glassfish\domains\jmsnew/lib/ext
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djavax.net.ssl.keyStore=C:\glassfish6\glassfish\domains\jmsnew/config/keystore.jks
Aug 29, 2017 11:05:17 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 6 msec.

and the error on cmd:

Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:653)
        at java.util.ArrayList.get(ArrayList.java:429)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(Extens
ionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

Aug 29, 2017 11:05:18 AM BundleProvisioner install
WARNING: Failed to install file:/C:/glassfish6/glassfish/modules/glassfish-extra
-jre-packages.jar
org.osgi.framework.BundleException: Could not create bundle object.
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2785)
        at org.apache.felix.framework.BundleContextImpl.installBundle(BundleCont
extImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install
(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install
Bundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.build(OSGiGlassFishRuntimeBuilder.java:139)
        at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime
.java:157)
        at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.
java:110)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(
GlassFishMain.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMa
in.java:97)
        at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:653)
        at java.util.ArrayList.get(ArrayList.java:429)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(Extens
ionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

Aug 29, 2017 11:05:18 AM BundleProvisioner install
WARNING: Failed to install file:/C:/glassfish6/glassfish/modules/glassfish-oracl
e-jdbc-driver-packages.jar
org.osgi.framework.BundleException: Could not create bundle object.
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2785)
        at org.apache.felix.framework.BundleContextImpl.installBundle(BundleCont
extImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install
(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install
Bundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.build(OSGiGlassFishRuntimeBuilder.java:139)
        at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime
.java:157)
        at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.
java:110)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(
GlassFishMain.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMa
in.java:97)
        at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:653)
        at java.util.ArrayList.get(ArrayList.java:429)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(Extens
ionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

Aug 29, 2017 11:05:18 AM BundleProvisioner install
WARNING: Failed to install file:/C:/glassfish6/glassfish/modules/javax.transacti
on.jar
org.osgi.framework.BundleException: Could not create bundle object.
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2785)
        at org.apache.felix.framework.BundleContextImpl.installBundle(BundleCont
extImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install
(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install
Bundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.build(OSGiGlassFishRuntimeBuilder.java:139)
        at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime
.java:157)
        at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.
java:110)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(
GlassFishMain.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMa
in.java:97)
        at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:653)
        at java.util.ArrayList.get(ArrayList.java:429)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(Extens
ionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

Aug 29, 2017 11:05:18 AM BundleProvisioner install
WARNING: Failed to install file:/C:/glassfish6/glassfish/modules/performance-tun
er-extra-jre-packages.jar
org.osgi.framework.BundleException: Could not create bundle object.
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2785)
        at org.apache.felix.framework.BundleContextImpl.installBundle(BundleCont
extImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install
(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install
Bundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.build(OSGiGlassFishRuntimeBuilder.java:139)
        at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime
.java:157)
        at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.
java:110)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(
GlassFishMain.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMa
in.java:97)
        at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:653)
        at java.util.ArrayList.get(ArrayList.java:429)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(Extens
ionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

Aug 29, 2017 11:05:18 AM BundleProvisioner install
WARNING: Failed to install file:/C:/glassfish6/glassfish/modules/webservices-ext
ra-jdk-packages.jar
org.osgi.framework.BundleException: Could not create bundle object.
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2785)
        at org.apache.felix.framework.BundleContextImpl.installBundle(BundleCont
extImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install
(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install
Bundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.build(OSGiGlassFishRuntimeBuilder.java:139)
        at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime
.java:157)
        at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.
java:110)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(
GlassFishMain.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMa
in.java:97)
        at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:653)
        at java.util.ArrayList.get(ArrayList.java:429)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(Extens
ionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

org.osgi.framework.BundleException: Unresolved constraint in bundle jaxb-api [2]
: Unable to resolve 2.0: missing requirement [2.0] osgi.wiring.package; (osgi.wi
ring.package=javax.activation)
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:382
6)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)

        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart
LevelImpl.java:295)
        at java.lang.Thread.run(Thread.java:745)
org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfis
h.metro.webservices-api-osgi [3]: Unable to resolve 3.0: missing requirement [3.
0] osgi.wiring.package; (&(osgi.wiring.package=javax.xml.bind)(version>=2.2.0))
[caused by: Unable to resolve 2.0: missing requirement [2.0] osgi.wiring.package
; (osgi.wiring.package=javax.activation)]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:382
6)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)

        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart
LevelImpl.java:295)
        at java.lang.Thread.run(Thread.java:745)
java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findCla
ss(BundleWiringImpl.java:2128)
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDele
gation(BundleWiringImpl.java:1432)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringIm
pl.java:72)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadCla
ss(BundleWiringImpl.java:1843)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(Bund
leWiringImpl.java:1317)
        at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:417
0)
        at org.apache.felix.framework.Felix.activateBundle(Felix.java:1972)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)

        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart
LevelImpl.java:295)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.osgi.framework.BundleActivator
not found by org.glassfish.main.core.glassfish [108]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDele
gation(BundleWiringImpl.java:1460)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringIm
pl.java:72)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadCla
ss(BundleWiringImpl.java:1843)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 14 more
org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfis
h.hk2.osgi-adapter [210]: Unable to resolve 210.0: missing requirement [210.0] o
sgi.wiring.package; (&(osgi.wiring.package=com.sun.enterprise.module)(version>=1
.1.0)) [caused by: Unable to resolve 128.0: missing requirement [128.0] osgi.wir
ing.package; (&(osgi.wiring.package=org.jvnet.hk2.config)(version>=1.1.0)) [caus
ed by: Unable to resolve 38.0: missing requirement [38.0] osgi.wiring.package; (
osgi.wiring.package=javax.management)]]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:382
6)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)

        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart
LevelImpl.java:295)
        at java.lang.Thread.run(Thread.java:745)
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMa
in.java:97)
        at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: org.glassfish.embeddable.GlassFishException: org.glassfish.embeddable
.GlassFishException: No GlassFishRuntime available
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.build(OSGiGlassFishRuntimeBuilder.java:164)
        at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime
.java:157)
        at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.
java:110)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(
GlassFishMain.java:112)
        ... 6 more
Caused by: org.glassfish.embeddable.GlassFishException: No GlassFishRuntime avai
lable
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.getGlassFishRuntime(OSGiGlassFishRuntimeBuilder.java:202)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.build(OSGiGlassFishRuntimeBuilder.java:162)
        ... 9 more
Error stopping framework: java.lang.NullPointerException
java.lang.NullPointerException
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher$1.run(G
lassFishMain.java:203)
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=192m; sup
port was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=64m; support
 was removed in 8.0

Command start-domain failed.
Vishal Chepuri
  • 306
  • 5
  • 26

2 Answers2

2

1st try:

How did you create the domain? From a fresh install of glassfish, you shouldn't need to create the domain. The domain1 should be ready right out of the box. If you've created it, there may be somewhere you went wrong with the configuration during the creation.

First, make sure you're working with a fresh, up to date, full copy. You can find the latest version (ATM 4.1.2) here. Download that "Full Platform" version.

Unzip the downloaded folder to your chosen directory. (I directly unzipped into my C directory.)

Then navigate to your glassfish bin. After the install (unzipping), mine is here:

C:\glassfish4\glassfish\bin

Then without creating or configuring anything, start the server:

asadmin start-domain

Bam! Your domain should be started.

One more thing if that doesn't work. Try navigating to the outer glassfish bin directory instead. For me it would be:

C:\glassfish4\bin

and running the asadmin command from there. I've noticed that I have both on my classpath (environment variable) so I can't be sure which one is being used, although I think its the first.

As a side note, I've added the glassfish bin above to my environment variables so that I'm able to issue glassfish commands without having to navigate to the glassfish bin. Makes things much easier when you use it often.

2nd Try:

EDIT #2: OK, you're getting a bind error that I've seen before. Using the same fresh install that we've just done, do the following:

Find your domain.xml which should be located ->

\glassfish4\glassfish\domains\domain1\config\domain.xml

I would save a copy of this file just in case you mess something up(habit but shouldn't matter here). Once you are ready, open that puppy up and search the document until you find the following:

<network-listeners>
      <network-listener protocol="http-listener-1" port="8080" name="http-listener-1" thread-pool="http-thread-pool" transport="tcp"></network-listener>
      <network-listener protocol="http-listener-2" port="8181" name="http-listener-2" thread-pool="http-thread-pool" transport="tcp"></network-listener>
      <network-listener protocol="admin-listener" port="4848" name="admin-listener" thread-pool="admin-thread-pool" transport="tcp"></network-listener>
</network-listeners>

then change the port numbers to something different. Save it, close it out and try to start the server again... Any luck?

3rd Try (extra credit?)

Also worth trying, you can check to see if there is something already running on those ports. Open your windows command prompt and enter the command:

netstat -aon

Now look through that entire list of ip numbers (there are ways to export to text file if it's too much) and see if you find any of them that use 4848 at the end of the address. If so, you can kill that process by taking the PID number that is on the far right of the listing and using it in this command:

taskkill /f /PID INSERT_PID_#_HERE_FROM_FAR_LEFT_ON_LIST

Be careful. I once had my IDE responsible for the blocked port and killed the port blocking app with this command, whilst not realizing that the IDE was responsible and it quit immediately without save.

Basically, the bind exception is saying, "Hey buddy, you've got another glassfish running around here somewhere or at the very list, somebody's stealing my port homie."

Check to make sure the other, earlier versions of glassfish that you tried are no longer in the way, in the classpath or somehow using ports. Or try changing default port numbers in the domain.xml.

Community
  • 1
  • 1
Old Schooled
  • 1,222
  • 11
  • 22
  • I have done same thing which u mentioned and again got the same error which i previously command start domain failed. Is thier any else that i need to configure – Vishal Chepuri Aug 30 '17 at 10:01
  • OK, try it fresh for me with this: https://javaee.github.io/glassfish/download download 4.1.2 full platform. Extract that file, navigate to the bin and retry previous instructions. I am confident that this file works as that's the one I'm using. I will update the answer to reflect the specifics. – Old Schooled Aug 30 '17 at 17:28
  • Also, you can try running the command from the first glassfish bin instead of the nested one. Explained in edit above. – Old Schooled Aug 30 '17 at 17:35
  • got this error:Waiting for domain1 to start ............................Error starting domain d omain1. The server exited prematurely with exit code 0. Before it died, it produced the following output: Launching GlassFish on Felix platform Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishRunt ime@437d9f67 in service registry. – Vishal Chepuri Aug 31 '17 at 10:01
  • appending the error : [#|2017-08-31T15:27:33.139+0530|SEVERE|glassfish 4.1|javax.enterprise.system.cor e|_ThreadID=1;_ThreadName=main;_TimeMillis=1504173453139;_LevelValue=1000;_Messa geID=NCLS-CORE-00019;| Shutting down server due to startup exception java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java: 223) – Vishal Chepuri Aug 31 '17 at 10:02
  • Ok, try this... wait, I'll put it in the answer above, to messy here. It will be the domain.xml edit. – Old Schooled Aug 31 '17 at 15:36
  • Did that help you? Are you still stuck and unable to get it to work? – Old Schooled Sep 03 '17 at 08:23
  • sorry for late reply but even that didnt work as their is not process running on that port. Checked twice – Vishal Chepuri Sep 03 '17 at 17:23
  • Did you try changing the port numbers in the domain.xml? – Old Schooled Sep 03 '17 at 17:55
0

I had exact same problem and I resolved it by downgrading java from version 8 to 7 as this glassfish server seems to be working on java 7 only. To be exact I changed AS_JAVA(located at ./glassfish/config/asenv.conf) from C:\Program Files\Java\jdk1.8.0_102 to C:\Program Files\Java\jdk1.7.0_80

And also for me there was a reference to Java 8 in domain.xml(my custom setting, reminding just in case you might also have it).

It is only glassfish where you can reference Java 7 you don't need to change entire JAVA_HOME if you don't want it.

I also found a thread , Will it be possible to use Java 8 on Glassfish 3?

Aman Adhikari
  • 3,240
  • 3
  • 22
  • 32