tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanislas Nanchen <stanislas.nanc...@ergon.ch>
Subject Re: OpenEJB Startup Problem : NPE in CdiScanner
Date Thu, 22 May 2014 05:50:56 GMT
Hi,

I think we use it quite "normally". The problem arised when we upgraded 
a library (vaadin from 7.1.10 to 7.2). However the vaadin jar does not
contain any beans.xml file.

How can I investigate more?

As Class#getClassLoader() can be null, I think it would be a good idea
to check for this, e.g. in the comparator. Should I submit a patch?

Cheers.
Stan.

----- Original Message -----
From: "Romain Manni-Bucau" <rmannibucau@gmail.com>
To: users@tomee.apache.org
Sent: Wednesday, 21 May, 2014 11:33:21 AM
Subject: Re: OpenEJB Startup Problem : NPE in CdiScanner

Hi

how do you use it? Charset can't be in this class list normally



Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-05-21 11:24 GMT+02:00 Stanislas Nanchen <stanislas.nanchen@ergon.ch>:

> Hello everyone,
>
> We are using Tomee (and OpenEJB) 1.6.0.2 and we have a problem with the
> startup of OpenEBJ:
> a NPE occurs in the CdiScanner: on line 260 of the CdiScanner.java, there
> is a comparison between 2 ClassLoaders. (see below).
>
> 257   final ClassLoader cl = clazz.getClassLoader();
> ...
> 260   if (!filterByClassLoader
> 261         || comparator.isSame(cl) || (cl.equals(scl) &&
> startupObject.getWebContext() == null)) {
>
> I have debugged step by step and found that the NPE occurs when the
> variable clazz is
> the class java.nio.charset.Charset. In this case, the classloader is null
> and the test
> on lines 260/261 fails.
>
> I have patched the line 261 to check whether cl is null (according to the
> Class API, wenn a class
> is loaded with the Bootloader, it is allowed to return null to the method
> Class#getClassLoader);
> and it works perfectly. (It would be probably a better idea to check for
> null in the comparator).
>
> Have other Tomee/OpenEJB users encountered the same problem? It seems to
> me strange that the
> class java.nio.charset.Charset is being scanned.
>
> Thanks for your help!
> Cheers,
> Stan.
>
>
>
> stanislas.nanchen@ergon.ch +41 44 268 89 00
> Ergon Informatik AG, Kleinstrasse 15, CH-8008 Z├╝rich
> http://www.ergon.ch
> e r g o n smart people - smart software
>

Mime
View raw message