You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by amber <am...@hotmail.fr> on 2014/09/15 10:35:42 UTC
injecting class error with openEJB 4.7.0
Hi,
I wanted to migrated from 4.6.0 to 4.7.0 and I got this error :
ATTENTION - an error occured while injecting the class 'foo': null
I have a super-class test class to initialize OpenEJB, but the keyword
"abstract" on it give a null pointer exception on CDI injection...
here a sample I've started from (cdi-basic 4.7.0 sample) to add a super
class.
(note : occured is spelled occurred ?)
Thx cdi-basic.zip
<http://tomee-openejb.979440.n4.nabble.com/file/n4671770/cdi-basic.zip>
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/injecting-class-error-with-openEJB-4-7-0-tp4671770.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: injecting class error with openEJB 4.7.0
Posted by Romain Manni-Bucau <rm...@gmail.com>.
you can't cause the method is static so then we don't know your instance class.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-09-15 16:00 GMT+02:00 amber <am...@hotmail.fr>:
> I do not understand well why I could not factor the code into a super class
> (aside now must explicitly declare the class tested)? especially as it was
> working fine in 4.6.0 ?
>
> Nevertheless I will look to openjb-junit : I assume you're referring this
> article :
> http://rmannibucau.wordpress.com/2012/05/03/testing-a-jee-application-with-openejb-and-tomee/
> ?
>
> thx Romain :)
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/injecting-class-error-with-openEJB-4-7-0-tp4671770p4671782.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
Re: injecting class error with openEJB 4.7.0
Posted by amber <am...@hotmail.fr>.
I do not understand well why I could not factor the code into a super class
(aside now must explicitly declare the class tested)? especially as it was
working fine in 4.6.0 ?
Nevertheless I will look to openjb-junit : I assume you're referring this
article :
http://rmannibucau.wordpress.com/2012/05/03/testing-a-jee-application-with-openejb-and-tomee/
?
thx Romain :)
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/injecting-class-error-with-openEJB-4-7-0-tp4671770p4671782.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: injecting class error with openEJB 4.7.0
Posted by Romain Manni-Bucau <rm...@gmail.com>.
true but EJBContainer is not designed for it
what about openejb-junit? here are some sample
http://svn.apache.org/repos/asf/tomee/tomee/trunk/container/openejb-junit/src/test/java/org/apache/openejb/junit/
you can also set all subclasses in this property if it helps (comma
separated value)
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-09-15 13:45 GMT+02:00 amber <am...@hotmail.fr>:
> Hi romain,
>
> it works it forces to explicitly declare the subclass in the superclass
> ...not very convenient to factorize the initialization code of OpenEJB ?
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/injecting-class-error-with-openEJB-4-7-0-tp4671770p4671778.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
Re: injecting class error with openEJB 4.7.0
Posted by amber <am...@hotmail.fr>.
Hi romain,
it works it forces to explicitly declare the subclass in the superclass
...not very convenient to factorize the initialization code of OpenEJB ?
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/injecting-class-error-with-openEJB-4-7-0-tp4671770p4671778.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: injecting class error with openEJB 4.7.0
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi
if you do:
@BeforeClass
public static void start() {
container = EJBContainer.createEJBContainer(new Properties() {{
setProperty(OpenEjbContainer.Provider.OPENEJB_ADDITIONNAL_CALLERS_KEY,
CourseTest.class.getName());
}});
}
it works
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-09-15 10:35 GMT+02:00 amber <am...@hotmail.fr>:
> Hi,
>
> I wanted to migrated from 4.6.0 to 4.7.0 and I got this error :
>
> ATTENTION - an error occured while injecting the class 'foo': null
>
>
> I have a super-class test class to initialize OpenEJB, but the keyword
> "abstract" on it give a null pointer exception on CDI injection...
>
> here a sample I've started from (cdi-basic 4.7.0 sample) to add a super
> class.
>
> (note : occured is spelled occurred ?)
>
> Thx cdi-basic.zip
> <http://tomee-openejb.979440.n4.nabble.com/file/n4671770/cdi-basic.zip>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/injecting-class-error-with-openEJB-4-7-0-tp4671770.html
> Sent from the TomEE Users mailing list archive at Nabble.com.