dev@grizzly.java.net

Re: More OSGi

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 05 Jan 2009 10:31:48 -0500

Salut,

Hubert Iwaniuk wrote:
> Hello,
>
> I think there is another issue regarding OSGi bundles.
> I'm getting:
>> java.lang.ClassCastException: com.sun.grizzly.http.HttpWorkerThread
>> at com.sun.grizzly.filter.ReadFilter.execute(ReadFilter.java:121)
>> at com.sun.grizzly.filter.ReadFilter.execute(ReadFilter.java:100)
>> at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
>> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
>> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
>> at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
>> at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
>> at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
>> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>> at java.lang.Thread.run(Thread.java:595)
>

Grrrr :-) :-)


> To reproduce create project as described here:
> http://codemeself.blogspot.com/2008/12/grizzly-osgi-archetype.html
> This problem is probably because two different classloaders are used
> for sample code and for grizzly-http which in turn results in two
> different versions of classes from grizzly-framework.
> It also might be an issue of my pom.xml, but I haven't found any way
> to get it working.
> Thanks for your help.

The exception looks strange indeed...HttpWorkerThread is inside the http
modules, but the exception is from the framework classes. I agree there
is two classloaders here but I hope the framework module doesn't need to
  declare all .http.* classes in order to works. Looking at it as soon
as I get above my mountain of emails :-)

A+ and thanks for the help!

-- Jeanfrancois



>
> Cheers,
> Hubert.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>