'Achim,

In the situation I could repro, the bad class loader was always the
original plain old application boot class loader, not some class
loader from inside pax-web.

In the backtrace, and the debugger, it was clear that pax-web just
wasn't setting the TCCL in this thread. I would offer the opinion that
when pax-web creates a thread pool, it should arrange to set the tccl
to its own bundle class loader for each thread.

I'm changing jobs in two weeks, and I have to focus on things really
needed until then, so I'm afraid that I won't have time to try the
experiment of adding a tccl setting to the threads and seeing if the
problem goes away, or building a test case in the open.

--benson


On Wed, Nov 9, 2016 at 6:09 AM, 'Achim Nierbeck' via OPS4J
<[email protected]> wrote:
> Hi Benson,
>
> it might be interesting, if this could be the cause of some of your issues.
> Marc just found an interesting effect while trying to fix 906:
>
> https://ops4j1.jira.com/browse/PAXWEB-906?focusedCommentId=37803&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-37803
>
> Could you verify if this maybe the cause for your issue?
>
> regards, Achim
>
>
> 2016-11-07 12:38 GMT+01:00 Benson Margulies <[email protected]>:
>>
>> On Mon, Nov 7, 2016 at 3:59 AM, 'Christoph Läubrich' via OPS4J
>> <[email protected]> wrote:
>> > Am 04.11.2016 13:23, schrieb Benson Margulies:
>> >>
>> >>
>> >> It's an important goal of this project to _not_ require an extra JVM,
>> >> so your suggestion
>> >> of using a process builder, while it would allow me to make this test
>> >> work, would not
>> >> be something I can use in production.
>> >>
>> >
>> > The you should not start something from within the (boot)class-path but
>> > embedd everything in OSGi-Bundles and carefully craft import/exports
>> > instead
>> > of rely on automatic guessing from BND and such tools. This is the only
>> > way
>> > to have true classloader-isolation.
>>
>> Christoph, the fundamental goal here requires a tiny, very controlled,
>> amount of system bundle/bootclasspath communication. I don't think
>> it's the source of my problems.
>>
>> >
>> > Pax Web (with embedded jetty) as well as Pax Exam rely on some parts on
>> > Dynamic-Imports and thus can easily lead to have classes loaded from the
>> > boot-class-path as well als some libs are not behave very frndly by
>> > using
>> > Class.forName or static Methods to obtain Connections and such.
>> > Context-Classloading is some kind of work-around to adress these
>> > problem,
>> > but not a real solution.
>>
>> OK. I had hoped that by trimming down the list of packages on the
>> system bundle, I could cut off this, but I take your point.
>>
>> >
>> > So I would recommend (if you really do not want to start up an extra vm
>> > for
>> > testing, what would be in the sense of test-isolation preferable) that
>> > you
>> > pack your "launch the test service using the CXF API; no OSGi involved."
>> > inside a bundle (embedding all dependecies) make sure the bundle does
>> > not
>> > export or import any packages and use an Activator to fire up the
>> > test-service. You can then use this bundle in your pax-exam test without
>> > polluting your test-classpath with other libs (CXF itself requires a lot
>> > as
>> > of the last time I have embedded this in a container). You also should
>> > use
>> > the remote-test-container to make sure nothing trickles in from other
>> > parts.
>> >
>> >
>> > --
>> > --
>> > ------------------
>> > OPS4J - http://www.ops4j.org - [email protected]
>> >
>> > --- You received this message because you are subscribed to the Google
>> > Groups "OPS4J" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to [email protected].
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> --
>> ------------------
>> OPS4J - http://www.ops4j.org - [email protected]
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "OPS4J" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - [email protected]
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OPS4J" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to