java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • http://forums.terracotta.org/forums/posts/list/7678.page#37323. I have requested for more details about the complete Terracotta Server and Client logs from the date and time of the incident. Root exception is: net.sf.ehcache.CacheException: java.lang.NullPointerException at org.terracotta.modules.ehcache.store.ValueModeHandlerSerialization.getRealKeyObject(ValueModeHandlerSerialization.java:128) at org.terracotta.modules.ehcache.store.ValueModeHandlerSoftLockAwareSerialization.getRealKeyObject(ValueModeHandlerSoftLockAwareSerialization.java:68) at org.terracotta.modules.ehcache.store.ClusteredStoreBackendImpl$TDCWithEvents.onEvict(ClusteredStoreBackendImpl.java:204) at org.terracotta.cache.TerracottaDistributedCache.evicted(TerracottaDistributedCache.java:447) at com.terracotta.toolkit.collections.ConcurrentDistributedServerMapDso.notifyElementEvicted(ConcurrentDistributedServerMapDso.java:436) at com.terracotta.toolkit.collections.ConcurrentDistributedServerMapDso.evictedInServer(ConcurrentDistributedServerMapDso.java:425) at com.tc.object.handler.ReceiveServerMapEvictionBroadcastHandler.handleEvent(ReceiveServerMapEvictionBroadcastHandler.java:39) at com.tc.async.impl.StageImpl$WorkerThread.run(StageImpl.java:135) Caused by: java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768) at org.hibernate.impl.SessionFactoryObjectFactory.getNamedInstance(SessionFactoryObjectFactory.java:159) at org.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:753) at sun.reflect.GeneratedMethodAccessor616.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
    via by Karthik Lalithraj,
  • This is a spin-off from - https://forum.hibernate.org/viewtopic.php?f=1&t=1013687&sid=e62b8ea711e4986a6ff419e3e641e2e8 - http://stackoverflow.com/q/8404559/7345 org.hibernate.cache.CacheKey is an object which is used for L2 cache notifications - e.g. to flush a cache on a different cluster node when a certain object has been updated. The problem comes from org.hibernate.cache.CacheKey carrying the type which (sometimes) happens to have a reference to objects like org.hibernate.impl.SessionFactoryImpl. This problem is actually not just theoretic but also causes real pain. First, it takes much longer to broadcast cache flush events. Secondly, I get this exception during deserialization of such a CacheKey: java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768) at org.hibernate.impl.SessionFactoryObjectFactory.getNamedInstance(SessionFactoryObjectFactory.java:159) at org.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:753) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readUnshared(ObjectInputStream.java:441) at my.class.deserializeKey(EhcacheUtils.java:35) I have done a quick scan through all the types, and found these problems related to their serializability: 1) org.hibernate.type.CollectionType, org.hibernate.type.ComponentType and subclasses of both - they use attribute "typeScope" (of type TypeFactory.TypeScope) which is assigned in the constructor and kept in the but seems to be never used. The typeScope in turn has a reference to the SessionImpl. Can it simply be removed? 2) org.hibernate.type.EntityType (and its subclasses) stores typeScope and only uses it in the getter, so I guess it should be safe to remove it, too. 3) org.hibernate.type.SortedSetType and org.hibernate.type.SortedMapType keeps a reference to the comparator, but does not enforce its serializability. It should at least throw a runtime exception in org.hibernate.mapping.Collection::getComparator if the comparator is not serializable.
    via by Mindaugas Žakšauskas,
  • http://forums.terracotta.org/forums/posts/list/7678.page#37323. I have requested for more details about the complete Terracotta Server and Client logs from the date and time of the incident. Root exception is: net.sf.ehcache.CacheException: java.lang.NullPointerException at org.terracotta.modules.ehcache.store.ValueModeHandlerSerialization.getRealKeyObject(ValueModeHandlerSerialization.java:128) at org.terracotta.modules.ehcache.store.ValueModeHandlerSoftLockAwareSerialization.getRealKeyObject(ValueModeHandlerSoftLockAwareSerialization.java:68) at org.terracotta.modules.ehcache.store.ClusteredStoreBackendImpl$TDCWithEvents.onEvict(ClusteredStoreBackendImpl.java:204) at org.terracotta.cache.TerracottaDistributedCache.evicted(TerracottaDistributedCache.java:447) at com.terracotta.toolkit.collections.ConcurrentDistributedServerMapDso.notifyElementEvicted(ConcurrentDistributedServerMapDso.java:436) at com.terracotta.toolkit.collections.ConcurrentDistributedServerMapDso.evictedInServer(ConcurrentDistributedServerMapDso.java:425) at com.tc.object.handler.ReceiveServerMapEvictionBroadcastHandler.handleEvent(ReceiveServerMapEvictionBroadcastHandler.java:39) at com.tc.async.impl.StageImpl$WorkerThread.run(StageImpl.java:135) Caused by: java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768) at org.hibernate.impl.SessionFactoryObjectFactory.getNamedInstance(SessionFactoryObjectFactory.java:159) at org.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:753) at sun.reflect.GeneratedMethodAccessor616.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
    via by Karthik Lalithraj,
  • This is a spin-off from - https://forum.hibernate.org/viewtopic.php?f=1&t=1013687&sid=e62b8ea711e4986a6ff419e3e641e2e8 - http://stackoverflow.com/q/8404559/7345 org.hibernate.cache.CacheKey is an object which is used for L2 cache notifications - e.g. to flush a cache on a different cluster node when a certain object has been updated. The problem comes from org.hibernate.cache.CacheKey carrying the type which (sometimes) happens to have a reference to objects like org.hibernate.impl.SessionFactoryImpl. This problem is actually not just theoretic but also causes real pain. First, it takes much longer to broadcast cache flush events. Secondly, I get this exception during deserialization of such a CacheKey: java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768) at org.hibernate.impl.SessionFactoryObjectFactory.getNamedInstance(SessionFactoryObjectFactory.java:159) at org.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:753) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readUnshared(ObjectInputStream.java:441) at my.class.deserializeKey(EhcacheUtils.java:35) I have done a quick scan through all the types, and found these problems related to their serializability: 1) org.hibernate.type.CollectionType, org.hibernate.type.ComponentType and subclasses of both - they use attribute "typeScope" (of type TypeFactory.TypeScope) which is assigned in the constructor and kept in the but seems to be never used. The typeScope in turn has a reference to the SessionImpl. Can it simply be removed? 2) org.hibernate.type.EntityType (and its subclasses) stores typeScope and only uses it in the getter, so I guess it should be safe to remove it, too. 3) org.hibernate.type.SortedSetType and org.hibernate.type.SortedMapType keeps a reference to the comparator, but does not enforce its serializability. It should at least throw a runtime exception in org.hibernate.mapping.Collection::getComparator if the comparator is not serializable.
    via by Mindaugas Žakšauskas,
  • issuehub.io
    via by Unknown author,
  • Hive bulk load into HBase
    via by Unknown author,
  • NPE
    via GitHub by IvanMamontov
    ,
    • java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768) at org.hibernate.impl.SessionFactoryObjectFactory.getNamedInstance(SessionFactoryObjectFactory.java:159) at org.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:753) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1056) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1761) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:479) at net.sf.ehcache.Element.readObject(Element.java:800) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:969) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:288) at sun.rmi.transport.Transport$1.run(Transport.java:159) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:155) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142) at net.sf.ehcache.distribution.RMICachePeer_Stub.put(Unknown Source) at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.replicatePutNotification(RMISynchronousCacheReplicator.java:149) at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.notifyElementPut(RMISynchronousCacheReplicator.java:132) at net.sf.ehcache.event.RegisteredEventListeners.notifyElementPut(RegisteredEventListeners.java:100) at net.sf.ehcache.Cache.notifyPutInternalListeners(Cache.java:1446) at net.sf.ehcache.Cache.putInternal(Cache.java:1438) at net.sf.ehcache.Cache.put(Cache.java:1367) at net.sf.ehcache.Cache.put(Cache.java:1339) at net.sf.ehcache.hibernate.regions.EhcacheTransactionalDataRegion.put(EhcacheTransactionalDataRegion.java:127) at net.sf.ehcache.hibernate.strategy.AbstractReadWriteEhcacheAccessStrategy.putFromLoad(AbstractReadWriteEhcacheAccessStrategy.java:93) at net.sf.ehcache.hibernate.nonstop.NonstopAwareEntityRegionAccessStrategy.putFromLoad(NonstopAwareEntityRegionAccessStrategy.java:180) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:195) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:982) at org.hibernate.loader.Loader.doQuery(Loader.java:857) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.loadEntity(Loader.java:2037) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:69) at org.hibernate.loader.entity.BatchingEntityLoader.load(BatchingEntityLoader.java:113) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3293) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1005) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998) at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:614) at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:589) at com.espn.test.Producer.getTS(Producer.java:130) at com.espn.test.Producer.main(Producer.java:34)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    musketyr
    6 times, last one,
    Hronom
    201 times, last one,
    Unknown visitor1 times, last one,
    20 more bugmates