Hot questions for Using GlassFish in glassfish 3

Question:

After working for a good number of weeks, I cannot deploy my application with Glassfish 3 to my local machine. I get:

EJB Container initialization error

and it appears there is a null pointer:

com.sun.messaging.jms.ra.DirectConnectionFactory._createConnectionId(DirectConnectionFactory.java:424)

I occasionally change my application to point to a glassfish instance on another server and have to update the settings for the correct server, but I am sure that the current configuration is proper for my local machine.

What might be causing this sudden behaviour?


Answer:

A very likely solution, though not one which is immediately obvious, is that a locking has taken place. This often happens on a machine where the IP address is prone to changing. It is one of the first checks that should be performed for an error involving DirectConnectionFactory and it is a behaviour which has carried over since Glassfish 2 (so this fix may work for that as well).

What you do to fix is:

  1. Go to the folder where your application is deployed (for me it is glassfish3\glassfish\domains{MY_APPLICATION})
  2. Look for imq/instances/imqbroker/lock
  3. Delete that file
  4. Restart glassfish
  5. Try to deploy your application again.

Question:

Basically I can start glassfish after installing. But after I exit Netbeans I canĀ“t run it even from console. I am using Netbeans 7.1.2 and glassfish 3.1.2. This is my output from console. My secret guess is that it will be problem in file path but I still hope that not. Could someone help? Hope that this is not some repost, if so pls atttach link to solution, I couldnt find anything. Thanks a lot

C:\Moje programy\glassfishServer\bin>asadmin start-domain personal_domain_2
Waiting for personal_domain_2 to start ...Error starting domain personal_domain_2.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:

Launching GlassFish on Felix platform
ERROR: Error parsing system bundle export statement: org.osgi.framework; version=1.6.0, org.osgi.framework.launch; version=1.0.0, org.osgi.framework.wiring; version=1.0.0, org.osgi.framework.startlevel; version=1.0.0, org.osgi.framework.hooks.bundle; version=1.0.0, org.osgi.framework.hooks.resolver; version=1.0.0, org.osgi.framework.hooks.service; version=1.1.0, org.osgi.framework.hooks.weaving; version=1.0.0, org.osgi.service.packageadmin; version=1.2.0, org.osgi.service.startlevel; version=1.1.0, org.osgi.service.url;
ERROR: Bundle jaxb-api [2] Error starting file:/C:/Moje%20programy/glassfishServer/glassfish/modules/endorsed/jaxb-api-osgi.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle jaxb-api [2]: Unable to resolve 2.0: missing requirement [2.0] osgi.wiring.package; (osgi.wiring.package=javax.activation))
ERROR: Bundle org.glassfish.metro.webservices-api-osgi [3] Error starting file:/C:/Moje%20programy/glassfishServer/glassfish/modules/endorsed/webservices-api-osgi.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.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.activati
ERROR: Bundle org.glassfish.main.core.glassfish [101] Error starting file:/C:/Moje%20programy/glassfishServer/glassfish/modules/glassfish.jar (org.osgi.framework.BundleException: Activator start error in bundle org.glassfish.main.core.glassfish [101].)
ERROR: Bundle org.glassfish.hk2.osgi-adapter [203] Error starting file:/C:/Moje%20programy/glassfishServer/glassfish/modules/osgi-adapter.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.hk2.osgi-adapter [203]: Unable to resolve 203.0: missing requirement [203.0] osgi.wiring.package; (&(osgi.wiring.package=com.sun.enterprise.module)(version>=1.1.0)) [caused by: Unable to resolve 121.0: missing requirement [121.0] osgi.wiring.package; (&(osgi.wiring.package=org.jvnet.hk2.config)(vers
org.osgi.framework.BundleException: Exported package names cannot be zero length.
        at org.apache.felix.framework.util.manifestparser.ManifestParser.normalizeExportClauses(ManifestParser.java:729)
        at org.apache.felix.framework.util.manifestparser.ManifestParser.<init>(ManifestParser.java:191)
        at org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:220)
        at org.apache.felix.framework.Felix.<init>(Felix.java:374)
        at org.apache.felix.framework.FrameworkFactory.newFramework(FrameworkFactory.java:28)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher.launchOSGiFrameWork(OSGiFrameworkLauncher.java:77)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:128)
        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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
        at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
feb 17, 2015 8:14:04 PM BundleProvisioner install
WARNING: Failed to install file:/C:/Moje%20programy/glassfishServer/glassfish/modules/flashlight-extra-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(BundleContextImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.installBundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.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(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(ExtensionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

feb 17, 2015 8:14:04 PM BundleProvisioner install
WARNING: Failed to install file:/C:/Moje%20programy/glassfishServer/glassfish/modules/glassfish-corba-omgapi.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(BundleContextImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.installBundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.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(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(ExtensionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

feb 17, 2015 8:14:04 PM BundleProvisioner install
WARNING: Failed to install file:/C:/Moje%20programy/glassfishServer/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(BundleContextImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.installBundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.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(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(ExtensionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

feb 17, 2015 8:14:04 PM BundleProvisioner install
WARNING: Failed to install file:/C:/Moje%20programy/glassfishServer/glassfish/modules/glassfish-oracle-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(BundleContextImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.installBundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.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(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(ExtensionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

feb 17, 2015 8:14:04 PM BundleProvisioner install
WARNING: Failed to install file:/C:/Moje%20programy/glassfishServer/glassfish/modules/javax.transaction.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(BundleContextImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.installBundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.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(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(ExtensionManager.java:401)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2751)
        ... 13 more

feb 17, 2015 8:14:04 PM BundleProvisioner install
WARNING: Failed to install file:/C:/Moje%20programy/glassfishServer/glassfish/modules/webservices-extra-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(BundleContextImpl.java:165)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.install(BundleProvisioner.java:446)
        at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.installBundles(BundleProvisioner.java:208)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.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(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at org.apache.felix.framework.ExtensionManager.addExtensionBundle(ExtensionManager.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.wiring.package=javax.activation)
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
        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(FrameworkStartLevelImpl.java:295)
        at java.lang.Thread.run(Unknown Source)
org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.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:3826)
        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(FrameworkStartLevelImpl.java:295)
        at java.lang.Thread.run(Unknown Source)
java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2128)
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1432)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1317)
        at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4170)
        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(FrameworkStartLevelImpl.java:295)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.osgi.framework.BundleActivator not found by org.glassfish.main.core.glassfish [101]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 14 more
org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.hk2.osgi-adapter [203]: Unable to resolve 203.0: missing requirement [203.0] osgi.wiring.package; (&(osgi.wiring.package=com.sun.enterprise.module)(version>=1.1.0)) [caused by: Unable to resolve 121.0: missing requirement [121.0] osgi.wiring.package; (&(osgi.wiring.package=org.jvnet.hk2.config)(version>=1.1.0)) [caused by: Unable to resolve 37.0: missing requirement [37.0] osgi.wiring.package; (osgi.wiring.package=javax.management)]]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
        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(FrameworkStartLevelImpl.java:295)
        at java.lang.Thread.run(Unknown Source)
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.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.OSGiGlassFishRuntimeBuilder.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 available
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.getGlassFishRuntime(OSGiGlassFishRuntimeBuilder.java:202)
        at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.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(GlassFishMain.java:203)
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=192m; support 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.

Answer:

so I forgot to check Java version. Uninstalled java8 and tadaaa it is working. hope that it will help someone

Question:

I am using Hibernate 5,java 1.7 and glassfish 3.1 server.

I have Implement a sample program for fetching records from DB with includes above stuff.

when I run this program on Apache tomcat server that working fine.

But when I am try to run same program on glassfish server then that shows following error:

java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index; 

I dont understand what wrongs with me. Please some body help me for solving this issue.


Answer:

GlassFish 3.1 supports JPA 2.0 and you are trying to use a feature introduced in JPA 2.1, hence this error. You can fix this by either downgrading JPA provider, or upgrading GlassFish to match the JPA provider.

Question:

I have installed the GlassFish Tool and the Oracle Enterprise pack :

because I can't find the Adapter:

But nothing happens and I can't add the Server.

What's going wrong?


Answer:

Hey I have challenged it.

The solution was to change the eclipse.ini file. see here:

Glassfish server adapter not shown in list in Eclipse

Question:

Hello i am trying to connect my server from a local client in my Computer I have a remote server running.. when I am running my code from Netbeans everything works fine... when i am trying from the CMD i am getting this error

java.lang.NullPointerException at com.sun.enterprise.naming.impl.SerialContext.getORB(SerialContext.java:347) at com.sun.enterprise.naming.impl.SerialContext.getProviderCacheKey(SerialContext.java:354) at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:384) at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:329) at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:477) at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:438) at javax.naming.InitialContext.lookup(Unknown Source) at test4.Test4.main(Test4.java:45) Exception in thread "main" javax.naming.NamingException: Lookup failed for 'jms/connection' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is java.lang.NullPointerException]] at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:491) at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:438) at javax.naming.InitialContext.lookup(Unknown Source) at test4.Test4.main(Test4.java:45) Caused by: javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is java.lang.NullPointerException] at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:334) at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:477) ... 3 more Caused by: java.lang.NullPointerException at com.sun.enterprise.naming.impl.SerialContext.getORB(SerialContext.java:347) at com.sun.enterprise.naming.impl.SerialContext.getProviderCacheKey(SerialContext.java:354) at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:384) at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:329) ... 4 more

public static void main(String[] args) throws NamingException {

    Context initialContext = Test4.getInitialContext();
    ConnectionFactory connectionFactory = (ConnectionFactory)initialContext.lookup("jms/connection");
    System.out.println("yeee:"+connectionFactory.toString());
    JMSContext jMSContext =  connectionFactory.createContext();
    Queue myQueue = (Queue)initialContext.lookup("jms/myQueue");
    JMSProducer jMSProducer = jMSContext.createProducer();
    jMSProducer.send(myQueue, "Hi,Zion");
    System.out.println("work work work wrok wrok");
}



 public static Context getInitialContext() throws NamingException{

    System.setProperty("org.omg.CORBA.ORBInitialHost", "MyIP");
    System.setProperty("org.omg.CORBA.ORBInitialPort", "3800");

    return new InitialContext();
}

Answer:

ok i figure it out!!!i should to put all the paths with the jars lib where the glassfish was installed and run java -cp "c:/programFiles/glassfish/lib/*" test4.Test4 can close the Topic.

Question:

Iam Using Glassfish 3 server to run a web service. Connection Pool is implemented in the server and able to ping Database.

Connection is received from the server but it is throwing java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended exception while running PreparedStatement.

Glassfish 4 does not throw any exception

The Query is taken from property file

QUERY=select * from TABLE where SYSTEMID=?1

Using two seperate java classes for receiving connection and further processing

JDBCUtil.java

public static Connection connectionFromConnectionPool()
        throws NamingException, SQLException {
    Context initCtx = new InitialContext();
    DataSource dataSource = (DataSource) initCtx.lookup(PropertyFileReader
                            .getPropertyValue("connectionPool.JNDI.name"));
    Connection connection = (Connection) dataSource.getConnection();
    if (connection != null) {
        logger.info("Received Connection");
    } else {
        logger.info("No Connection Received");
    }

    return connection;
}

DAO.java

ResultSet resultSet = null;
    PreparedStatement preparedStatement = null;
    Connection connection = null;
    try {
        connection = JDBCUtil.connectionFromConnectionPool();

        if (connection != null) {
            preparedStatement = connection
                    .prepareStatement(PropertyFileReader
                            .getPropertyValue("QUERY"));
            if (preparedStatement != null) {
                preparedStatement.setString(1, "systemID");
                resultSet = preparedStatement.executeQuery();     // line No:56

Log generated :

18:13:35,328 INFO - *****.JDBCUtil.connectionFromConnectionPool(JDBCUtil.java:38) - Received Connection
18:13:35,397ERROR - *****(DAO.java:81) - **************************** :: 
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:863)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1153)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1275)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3620)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
at com.sun.gjc.spi.jdbc40.PreparedStatementWrapper40.executeQuery(PreparedStatementWrapper40.java:642)
at *************************************(DAO.java:56)
....................

ojdbc6.jar placed in glassfish3\glassfish\lib and glassfish4\glassfish\lib


Answer:

Check if there is any other ojdbc jar inside server folder especially inside domain folder you are using.

If there are different jars or different versions of jar in the server folder, it may cause such errors.

For ex : glassfish3\glassfish\domains\domain1\lib...

If there are jar files of different versions, replace them all with same version.

I use Glassfish4. I kept the ojdbc jar only in glassfish4\glassfish\lib which works fine for me.

Question:

we did a migration of our j2ee application on a Weblogic application server to Glassfish 3. Doing this we had to switch from Richfaces 3.X to Richfaces 4.3

A new resource handling came along with RF4 and static resources for RF-Components have to be handled by the application server now. Previously the static resources (like CSS or JS) have been stored on the webserver.

During our load test with 50 virtual users a "Too many files"-Exception was thrown (because of all the additional resources).

ulimit -n shows that our limit for open files is 4096.

Does anyone have an idea how to overcome this problem without increasing the ulimit?

We have tried to use the resource optimization feature from Richfaces, but the problem here is that the order of the resource loading can not be defined. So resources are loaded first which need other resources which had not been loaded yet.


Answer:

Is it possible that your input streams dont close properly?

I once had the same problem and noticed that they were still opened. When I closed them, the "Too many files" Exception was gone.