dev@glassfish.java.net

osgi question

From: Justin Lee <justin.d.lee_at_oracle.com>
Date: Tue, 18 May 2010 10:39:32 -0400

I'm attempting to create an osgi bundle in a devtest and running into an
issue. The bundle I create seems OK as far as the basics are
concerned. I can deploy it and I don't get complaints from felix but
I'm getting a ClassCastException at runtime:

java.lang.ClassCastException:
org.glassfish.devtests.web.portunif.DummyProtocolFinder cannot be cast
to com.sun.grizzly.portunif.ProtocolFinder
     at
com.sun.grizzly.config.GrizzlyEmbeddedHttp.configureProtocol(GrizzlyEmbeddedHttp.java:306)
     at
com.sun.grizzly.config.GrizzlyEmbeddedHttp.configure(GrizzlyEmbeddedHttp.java:237)
     at
com.sun.grizzly.config.GrizzlyServiceListener.initializeListener(GrizzlyServiceListener.java:101)
     at
com.sun.grizzly.config.GrizzlyServiceListener.configure(GrizzlyServiceListener.java:86)


The actual line of code is:

                     ProtocolFinder protocolFinder = (ProtocolFinder)
newInstance(finderClassname);

My MANIFEST.MF looks like:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 14.3-b01-101 (Apple Inc.)
Export-Package: org.glassfish.devtests.web.portunif
Bundle-Name: port-unification-devtest
Bundle-Version: 1.0
Bundle-ManifestVersion: 2
Import-Package: com.sun.grizzly,com.sun.grizzly.portunif,com.sun.grizz
  ly.config,com.sun.grizzly.config.dom,com.sun.grizzly.filter,com.sun.g
  rizzly.http
Bundle-SymbolicName: org.glassfish.devtests.web.portunif
Bundle-DocURL: http://www.oracle.com


I'm not sure what I'm missing. Can someone steer me in the right direction?