Bug 993008 - NullPointerException if a findByPrimaryKey(null) is called
Summary: NullPointerException if a findByPrimaryKey(null) is called
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER1
: EAP 6.2.0
Assignee: wfink
QA Contact: Jan Martiska
URL:
Whiteboard:
Depends On:
Blocks: 1010206
TreeView+ depends on / blocked
 
Reported: 2013-08-05 11:54 UTC by wfink
Modified: 2018-12-03 19:31 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1010206 (view as bug list)
Environment:
Last Closed: 2013-12-15 16:55:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description wfink 2013-08-05 11:54:33 UTC
If a findByPrimaryKey is called with a 'null' argument a unclear NullPointerException is thrown:

Caused by: java.lang.NullPointerException
	at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333) [rt.jar:1.7.0_25]
	at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:1016) [rt.jar:1.7.0_25]
	at org.jboss.as.ejb3.component.entity.entitycache.ReferenceCountingEntityCache.containsNotRemoved(ReferenceCountingEntityCache.java:77) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.as.cmp.component.interceptors.CmpEntityBeanHomeFinderInterceptorFactory.invokeFind(CmpEntityBeanHomeFinderInterceptorFactory.java:81) [jboss-as-cmp-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.as.ejb3.component.entity.interceptors.EntityBeanHomeFinderInterceptorFactory$1.processInvocation(EntityBeanHomeFinderInterceptorFactory.java:92) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:226) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:317) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
	at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
	at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
	at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]
	at org.jboss.as.ejb3.component.interceptors.EjbExceptionTransformingInterceptorFactories$2.processInvocation(EjbExceptionTransformingInterceptorFactories.java:89) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
	... 70 more

The CacheType might be different depend on the configuration.

Comment 1 wfink 2013-08-05 12:06:20 UTC
PR send
https://github.com/jbossas/jboss-eap/pull/277

Not applied to WFLY as the EJB2 Entities are removed here. Also the reason for not adding a test.

Comment 2 Jan Martiska 2013-09-18 14:56:49 UTC
Verified with EAP 6.2.0.ER1.


Note You need to log in before you can comment on or make changes to this bug.