-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Javassist throws NullPointerException when in multi-thread
PostPosted: Fri Oct 04, 2013 12:39 pm 
Newbie

Joined: Fri Jul 02, 2010 3:06 pm
Posts: 2
Hi everyone,

I'm facing the following problem.

I have a multi-thread application to run batch processes, and if I run a process segregated in 2 threads it works fine, but when I run it segregated in 10 threads I get a NullPointerException from Javassist:


Caused by: java.lang.NullPointerException
at javassist.util.proxy.RuntimeSupport$DefaultMethodHandler.invoke(RuntimeSupport.java:37)
at org.my.model.PapelContratoColetivo_$$_javassist_63.setTipoSubGrupo(PapelContratoColetivo_$$_javassist_63.java)
at org.my.model.PapelContratoColetivo.<init>(PapelContratoColetivo.java:58)
at org.my.model.PapelContratoColetivo_$$_javassist_63.<init>(PapelContratoColetivo_$$_javassist_63.java:1)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)


Looking at PapelContratoColetivo constructor:

Code:
public PapelContratoColetivo() {

   setTipoSubGrupo(TipoSubGrupo.COLETIVO);

}




but, this method 'setTipoSubGrupo' is method annotated with @Transient , so just to test I've changed the constructor to set the 'tipoSubGrupo' property without call this method.

Code:
public PapelContratoColetivo() {

   this.tipoSubGrupo = TipoSubGrupo.COLETIVO;

}

Now it works independent on how many threads a I have.

My questions are:


Does anyone know why this problem occurs only when I have more than 2 threads? And why did it work after I've changed the property attribution?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.