tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Gumbrecht <agumbre...@tomitribe.com>
Subject Re: OpenEJB Startup Problem : NPE in CdiScanner
Date Thu, 22 May 2014 12:46:09 GMT
What is your runtime environment?

I also think I may have seen this when there are duplicate libraries on 
the classpath, just not sure where :-\

Switch to debug logging and see if there is anything else in the logs 
that may throw some more light on this.

Andy.

On 22/05/2014 08:59, Romain Manni-Bucau wrote:
> PS: maybe dump in CdiScanner value of beans.managedClasses
>
> shouldn't contain any JVM classes
>
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-05-22 8:48 GMT+02:00 Romain Manni-Bucau <rmannibucau@gmail.com>:
>
>> Hi
>>
>> I'll try to have a quick look to check few thing but a sample showing it
>> would be great. A if (!= null) would surely work for you but is not really
>> compatible with this logic (well not alone ;))
>>
>>
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>> 2014-05-22 7:50 GMT+02:00 Stanislas Nanchen <stanislas.nanchen@ergon.ch>:
>>
>> 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
>>>>
>>

-- 
   Andy Gumbrecht

   http://www.tomitribe.com
   agumbrecht@tomitribe.com
   https://twitter.com/AndyGeeDe

   TomEE treibt Tomitribe! | http://tomee.apache.org


Mime
View raw message