You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@gmail.com> on 2012/02/01 03:36:17 UTC

Re: Trunk classloading is broken with case sensitive paths

On Jan 31, 2012, at 9:24 AM, AndyG wrote:

> I also think this is something that maybe just been highlighted by a
> classloader issue somewhere else.

That definitely seems to be the case.

I would focus debugging efforts at line 87 of org.apache.openejb.cli.Bootstrap 

The uppercase and lowercase 'D' drive is definitely odd.


-David


> Has anything been changed with class
> loading over the weekend? Also can't see anything specific but gut tells me
> this is not as simple as it looks.
> 
> The following log entries are of concern:
> 
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in
> [jar:file:/d:/OrproVisionServer/openejb/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in
> [jar:file:/D:/OrproVisionServer/openejb/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> 
> I am filtering out the duplicates as discussed and OpenEJB is happy - no
> more duplicate deployment id's etc. But, multiple SLF4J bindings in on the
> same path usually boil down to a classloader issue?
> 
> --
> View this message in context: http://openejb.979440.n4.nabble.com/Trunk-classloading-is-broken-with-case-sensitive-paths-tp4344116p4345206.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: Trunk classloading is broken with case sensitive paths

Posted by Romain Manni-Bucau <rm...@gmail.com>.
great!

- Romain


2012/2/1 AndyG <an...@orprovision.com>

> So, it turns out to be BasicURLClassPath.addJarsToPath was not doing any
> kind
> of URL checking.
>
> This method is called from several locations, and the subsequent call to
> dir.list was/is returning file names with varying case - Not sure why this
> would be, but could be the thread context.
>
> The class behind the invoked 'addURLMethod' does a basic internal check on
> the provided URL but case matching is not performed, so it is possible to
> add duplicate URLs. This means 'we' should ensure that URLs are consistent.
>
> Added the following lines to provide a consistent URL:
>
> new URL(new File(dir,
>
> name).getCanonicalFile().getAbsoluteFile().toURI().toURL().toExternalForm())
>
> ...and fall back or error to :
>
> new URL(new File(dir,
> name).getAbsoluteFile().toURI().toURL().toExternalForm())
>
> Andy.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Trunk-classloading-is-broken-with-case-sensitive-paths-tp4344116p4347885.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: Trunk classloading is broken with case sensitive paths

Posted by AndyG <an...@orprovision.com>.
So, it turns out to be BasicURLClassPath.addJarsToPath was not doing any kind
of URL checking.

This method is called from several locations, and the subsequent call to
dir.list was/is returning file names with varying case - Not sure why this
would be, but could be the thread context.

The class behind the invoked 'addURLMethod' does a basic internal check on
the provided URL but case matching is not performed, so it is possible to
add duplicate URLs. This means 'we' should ensure that URLs are consistent.

Added the following lines to provide a consistent URL:

new URL(new File(dir,
name).getCanonicalFile().getAbsoluteFile().toURI().toURL().toExternalForm())

...and fall back or error to :

new URL(new File(dir,
name).getAbsoluteFile().toURI().toURL().toExternalForm())

Andy.

--
View this message in context: http://openejb.979440.n4.nabble.com/Trunk-classloading-is-broken-with-case-sensitive-paths-tp4344116p4347885.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: Trunk classloading is broken with case sensitive paths

Posted by AndyG <an...@orprovision.com>.
David Blevins-2 wrote
> 
> 
> That definitely seems to be the case.
> 
> I would focus debugging efforts at line 87 of
> org.apache.openejb.cli.Bootstrap 
> 
> 

OK, this is more than likely due to the windows service (Commons Daemon)
already having jars on the classpath. From the get go "openejb-core-*.jar"
and "openejb-daemon-*.jar" are added twice and that can't be good - Working
on a solution now.

Andy.


--
View this message in context: http://openejb.979440.n4.nabble.com/Trunk-classloading-is-broken-with-case-sensitive-paths-tp4344116p4347322.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.