On Wed, Apr 27, 2011 at 11:41 AM, Eike Kettner <[email protected]> wrote:

> Hi Daniele,
>
> >
> > But there is a problem. When I reinstall the bundle, I get this kind of
> > exception:
> >
> > java.lang.IllegalArgumentException: Can not set
> > org.fenotipi.services.StudiService field
> > org.fenotipi.web.general.HomePage.studiService to
> > org.apache.wicket.proxy.$Proxy40
> >
> > Now this only happens from the second time I install the module or just
> > after the first install, i refresh the module from the karaf console.
> > Have you ever experienced something like this?
> >
> > All the packages are in the same bundle.
>
> I have separate wicket bundle(s) and one war bundle and I have the same
> problem when I update the main wicket bundle as you describe. But in
> my case it only occurs when I _update_ the wicket bundle. If I stop and
> start (not update) the wicket bundle, it works here. I don't know why
> this happens, seems like some classloader issue to me. For some reason
> the proxy does not pass the test
> !field.getType().isAssignableFrom(value.getClass()) anymore (field is
> the field to be injected and value the proxy which was loaded fror m the
> wicket bundle that has been updated.)
>

Yes, the issue is that from the "second" time on, it's the field to be
injected that is seen to be of type proxy instead of the right type, while
the injected instance seem fine.
Wow, this looks like a really obscure quest :)

For now I have script that just uninstall/reinstall the bundle. Maybe I can
hack some code to implement a "reinstall" command in the maven-sling-plugin
I'm using for deploy. That should be easier than hacking into the mistery of
osgi class loading, for now.

What is your env? I'm on karaf 2.2.0, jvm 6, wicket 1.5, spring 3 and
spring-dm 1.2.1 (default for karaf 2.2.0).

This is really bad to me cause it happens also when I just refresh any
bundle that my war depends on...

Reply via email to