[GLASSFISH-18609] Glassfish throws NullPointerException on startup Created: 10/Apr/12  Updated: 08/Aug/13

Status: Open
Project: glassfish
Component/s: other
Affects Version/s: 3.1.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: emailnbw Assignee: Mahesh Kannan
Resolution: Unresolved Votes: 21
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows Server 2008 R2 Standard SP1 & Windows XP Version 2003 SP2 x64, JDK 1.7u3, GF 3.1.2, embedded derby drivers and Oracle ojdbc6



 Description   

During GF server startup/restart the following SEVERE exception is thrown:

[#|2012-04-09T23:29:00.171-0400|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.deployment.org.glassfish.deployment.common|_ThreadID=57;_ThreadName=Thread-2;|Exception while visiting com/sun/gjc/spi/JdbcObjectsFactory.class of size 3630
java.lang.NullPointerException
at org.glassfish.hk2.classmodel.reflect.impl.TypesImpl.getType(TypesImpl.java:78)
at org.glassfish.hk2.classmodel.reflect.impl.ModelClassVisitor.visit(ModelClassVisitor.java:119)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:363)
at org.glassfish.hk2.classmodel.reflect.util.JarArchive.onSelectedEntries(JarArchive.java:125)
at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:348)
at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:70)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:307)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:296)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

#]

This may be related to http://java.net/jira/browse/GLASSFISH-17061. One of our environments where we see this uses the bundled embedded derby with a GF managed Derby connection pool. The other environment we see this uses Oracle's ojdbc6 thin driver with a GF managed JDBC connection pool/resource.



 Comments   
Comment by Hong Zhang [ 10/Apr/12 ]

assign to HK2 team evaluation

Comment by mhankus [ 05/May/12 ]

Stacktrace is exactly the same as GLASSFISH-18513.
It happens to me too

Comment by rusty_turkey [ 17/May/12 ]

I also get error intermittently, and I already am already watching GLASSFISH-18513

Comment by jmkgreen [ 25/Jul/12 ]

Me too... In my case my .war had other faults. As seems usual, Glassfish decided to give me an apparently random NPE and stacktrace instead of the real error. JBoss told me exactly what was wrong.

Comment by smithh032772 [ 04/Sep/12 ]

Interesting, I am running on Windows Server 2008 (test/development) and Windows Server 2003 (production), and I see this error on startup or restart of Glassfish via NetBeans 7.2. I don't recall if I see this error on Windows Server 2003 when deploying app via NetBeans 7.1.2. Anyway, here is system log from beginning:

Launching GlassFish on Felix platform
INFO: Running GlassFish Version: GlassFish Server Open Source Edition 3.1.2.2 (build 5)
INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
INFO: Grizzly Framework 1.9.50 started in: 19ms - bound to [0.0.0.0:8181]
INFO: Grizzly Framework 1.9.50 started in: 60ms - bound to [0.0.0.0:8080]
INFO: Grizzly Framework 1.9.50 started in: 4ms - bound to [0.0.0.0:4848]
INFO: Grizzly Framework 1.9.50 started in: 13ms - bound to [0.0.0.0:3700]
INFO: Grizzly Framework 1.9.50 started in: 15ms - bound to [0.0.0.0:7676]
INFO: The Admin Console is already installed, but not yet loaded.
INFO: Created EjbThreadPoolExecutor with thread-core-pool-size 16 thread-max-pool-size 32 thread-keep-alive-seconds 60 thread-queue-capacity 2147483647 allow-core-thread-timeout false
INFO: SEC1002: Security Manager is OFF.
INFO: SEC1010: Entering Security Startup Service
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
INFO: SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
INFO: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
INFO: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
INFO: SEC1011: Security Service(s) Started Successfully
INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]
INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]
INFO: WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:4848]
INFO: WEB0171: Created virtual server [server]
INFO: WEB0171: Created virtual server [__asadmin]
INFO: WEB0172: Virtual server [server] loaded default web module []
SEVERE: Exception while visiting com/sun/gjc/spi/JdbcObjectsFactory.class of size 3615
java.lang.NullPointerException
at org.glassfish.hk2.classmodel.reflect.impl.TypesImpl.getType(TypesImpl.java:78)
at org.glassfish.hk2.classmodel.reflect.impl.ModelClassVisitor.visit(ModelClassVisitor.java:119)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:363)
at org.glassfish.hk2.classmodel.reflect.util.JarArchive.onSelectedEntries(JarArchive.java:125)
at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:348)
at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:70)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:307)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:296)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)

INFO: HV000001: Hibernate Validator 4.3.0.Final
INFO: EclipseLink, version: Eclipse Persistence Services - 2.3.2.v20111125-r10461

Comment by jwells [ 04/Sep/12 ]

Classmodel is only used by the config subsystem, so assigning to Mahesh.

Comment by gfuser9999 [ 16/Sep/12 ]

See also GLASSFISH-18513

Comment by kithouna [ 08/Apr/13 ]

I've got the exact same exception using GlassFish 3.1.2.2 and an h2 database version 1.3.170. Please fix this, it's really annoying.

Comment by disney2002 [ 30/May/13 ]

got the same problem while using GlassFish 3.1.2.2.

and restart glassfish maybe the will not happen.

Comment by gfuser9999 [ 02/Jun/13 ]

I thought the fix made to 3.1.2.4 (available from Oracle)
since many months now (on the HK2 module) for GF-18513. See
https://blogs.oracle.com/GlassFishForBusiness/entry/oracle_glassfish_server_ogfs_v3
15884192 INTEGRATE NEW HK2
14512884 EXCEPTION WHILE VISITING COM/SUN/GJC/COMMON/DATASOURCESPEC.CLASS OF SIZE 3267

Comment by linuxhippy [ 08/Aug/13 ]

Same here on Linux x86_64 with:

java version "1.7.0_25"
OpenJDK Runtime Environment (fedora-2.3.12.3.fc19-x86_64)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

Stack: [#|2013-08-08T17:01:44.899+0200|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=85;_ThreadName=Thread-2;|Exception while visiting EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap.class of size 6209
java.lang.NullPointerException
at org.glassfish.hk2.classmodel.reflect.impl.TypesImpl.getType(TypesImpl.java:78)
at org.glassfish.hk2.classmodel.reflect.impl.ModelClassVisitor.visit(ModelClassVisitor.java:119)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:363)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:171)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:133)
at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:348)
at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:70)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:307)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:296)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

#]
Generated at Thu Dec 08 12:29:17 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.