users@glassfish.java.net

Re: java.lang.ClassCastException in glassfish

From: Sahoo <sanjeeb.sahoo_at_oracle.com>
Date: Thu, 12 Jan 2012 17:06:05 +0530

You can't package OSGi bundles in ear file. You have to deploy OSGi
bundles separately.

Sahoo
On Thursday 12 January 2012 04:56 PM, forums_at_java.net wrote:
> I'm working on a simple application with Glassfish and OSGI. I found this
> tutorial:
> http://blogs.oracle.com/arungupta/entry/totd_154_dynamic_osgi_services
> [1] I
> modified the example. You can find my customized example file:
> http://uploading.com/files/cf1ffd63/test.zip/ [2] I created EAR
> package with
> web module and EJB module. I created a session bean which calls the OSGI
> bundle. I successfully compiled the project. The problem is that when i
> uploaded the packages into Glassfish application server and tried to
> open the
> simple applet into the web module this error message appears:
>
> HTTP Status 500 -
> type Exception report
> message
> descriptionThe server encountered an internal error () that prevented
> it from
> fulfilling this request.
> exception
> java.lang.ClassCastException: Cannot cast
> org.glassfish.web.loader.WebappClassLoader to
> org.osgi.framework.BundleReference
> note The full stack traces of the exception and its root causes are
> available
> in the GlassFish Server Open Source Edition 3.1.1 logs.
> GlassFish Server Open Source Edition 3.1.1
>
>
>
>
>
>
> [1]
> http://blogs.oracle.com/arungupta/entry/totd_154_dynamic_osgi_services
> [2] http://uploading.com/files/cf1ffd63/test.zip/
>
> --
>
> [Message sent by forum member 'rcbandit']
>
> View Post: http://forums.java.net/node/882669
>
>