tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: OpenEJB Startup Problem : NPE in CdiScanner
Date Wed, 21 May 2014 09:33:21 GMT
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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message