You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lukasz Lenart <lu...@apache.org> on 2014/03/03 09:06:48 UTC
WebappClassLoader#getResources returns enumeration with null element
Hi,
We just were informed about bug in Apache Struts [1] but it looks like
a bug in Tomcat 8. The PackageBasedActionConfigBuilder class uses
class loader to fetch all the URLs where application's classes are
stored, but right now the resulting enumeration contains also null
element. The same code works with no problems on Tomcat 7.
If I add if(url != null) (see [2]) everything works as expected (but I
must apply this ugly fix in few other places as well).
[1] https://issues.apache.org/jira/browse/WW-4294
[2] https://github.com/apache/struts/blob/master/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java#L406
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: WebappClassLoader#getResources returns enumeration with null element
Posted by Lukasz Lenart <lu...@apache.org>.
2014-03-03 9:54 GMT+01:00 Mark Thomas <ma...@apache.org>:
> On 03/03/2014 08:23, Mark Thomas wrote:
>> On 03/03/2014 08:06, Lukasz Lenart wrote:
>>> Hi,
>>>
>>> We just were informed about bug in Apache Struts [1] but it looks like
>>> a bug in Tomcat 8. The PackageBasedActionConfigBuilder class uses
>>> class loader to fetch all the URLs where application's classes are
>>> stored, but right now the resulting enumeration contains also null
>>> element. The same code works with no problems on Tomcat 7.
>>>
>>> If I add if(url != null) (see [2]) everything works as expected (but I
>>> must apply this ugly fix in few other places as well).
>>
>> Including null in that enumeration doesn't look right but I do wonder
>> (without having looked at the code) how it got there. I'll take a look.
>
> When I looked at the stack trace, I thought it looked familiar:
>
> https://issues.apache.org/bugzilla/show_bug.cgi?id=56125
Yes, thanks Mark! Next time I will try spend more time on searching
before asking :-)
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: WebappClassLoader#getResources returns enumeration with null
element
Posted by Mark Thomas <ma...@apache.org>.
On 03/03/2014 08:23, Mark Thomas wrote:
> On 03/03/2014 08:06, Lukasz Lenart wrote:
>> Hi,
>>
>> We just were informed about bug in Apache Struts [1] but it looks like
>> a bug in Tomcat 8. The PackageBasedActionConfigBuilder class uses
>> class loader to fetch all the URLs where application's classes are
>> stored, but right now the resulting enumeration contains also null
>> element. The same code works with no problems on Tomcat 7.
>>
>> If I add if(url != null) (see [2]) everything works as expected (but I
>> must apply this ugly fix in few other places as well).
>
> Including null in that enumeration doesn't look right but I do wonder
> (without having looked at the code) how it got there. I'll take a look.
When I looked at the stack trace, I thought it looked familiar:
https://issues.apache.org/bugzilla/show_bug.cgi?id=56125
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: WebappClassLoader#getResources returns enumeration with null
element
Posted by Mark Thomas <ma...@apache.org>.
On 03/03/2014 08:06, Lukasz Lenart wrote:
> Hi,
>
> We just were informed about bug in Apache Struts [1] but it looks like
> a bug in Tomcat 8. The PackageBasedActionConfigBuilder class uses
> class loader to fetch all the URLs where application's classes are
> stored, but right now the resulting enumeration contains also null
> element. The same code works with no problems on Tomcat 7.
>
> If I add if(url != null) (see [2]) everything works as expected (but I
> must apply this ugly fix in few other places as well).
Including null in that enumeration doesn't look right but I do wonder
(without having looked at the code) how it got there. I'll take a look.
Mark
>
> [1] https://issues.apache.org/jira/browse/WW-4294
> [2] https://github.com/apache/struts/blob/master/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java#L406
>
>
> Regards
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org