[jboss-jira] [JBoss JIRA] (JASSIST-214) Nullpointer in RuntimeSupport

Andreas Gudian (JIRA) issues at jboss.org
Fri Feb 14 07:51:29 EST 2014


    [ https://issues.jboss.org/browse/JASSIST-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12944637#comment-12944637 ] 

Andreas Gudian commented on JASSIST-214:
----------------------------------------

FYI, I had the same issue and traced it down to my usage of the Dozer bean mapper: when mapping from my DTO to the entity type ({{mapper.map(customerDto, com.Customer.class)}}, Dozer used the com.Customer_$$javassist_1 type for creating a new instance, instead of com.Customer. Only because I previously mapped from a customerEntity (of type com.Customer_$$javassist_1) to CustomerDto. That's how the improperly initialized com.Customer_$$javassist_1 instance ended up in my persistence context and caused the NPE.

My temporary solution was making sure that I always initialize and un-proxy the customerEntity object before handing it into dozer. The permanent solution will be to fully migrate to MapStruct.
                
> Nullpointer in RuntimeSupport
> -----------------------------
>
>                 Key: JASSIST-214
>                 URL: https://issues.jboss.org/browse/JASSIST-214
>             Project: Javassist
>          Issue Type: Bug
>    Affects Versions: 3.16.1-GA
>            Reporter: Michael Burns
>            Assignee: Shigeru Chiba
>
> Under moderate load our multithreaded application frequently gives the following exception:
> java.lang.NullPointerException
>         at javassist.util.proxy.RuntimeSupport$DefaultMethodHandler.invoke(RuntimeSupport.java:38)
>         at com.Customer_$$_javassist_1.getHibernateLazyInitializer(Customer_$$_javassist_1.java)
>         at org.hibernate.Hibernate.isInitialized(Hibernate.java:429)
> This then effects all future instantiations of the Customer object which give the same exception.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list