Hi there!

I tried to use bundle:install/bundle:uninstall commands as you advised, but
I had same errors:

```
ERROR | pipe-bundle:install -s file:/u00/test2/datasource-0.1.jar |
container.BlueprintContainerImpl  440 | 35 - org.apache.aries.blueprint.core
- 1.10.1 | Unable to start container for blueprint bundle
org.example.dependent/0.1.0
org.osgi.service.blueprint.container.ComponentDefinitionException: Error
when instantiating bean dependentService of class test.DependentService
...
Caused by: java.lang.ClassCastException: test.Test cannot be cast to
test.Test
```

The most interesting thing about this is that if I redeploy "dependent.jar"
bundle - all is ok. I get result as expected. 

```
2020-04-06 11:58:51,326 | WARN  | pipe-bundle:install -s
file:/u00/test2/datasource-0.1.jar | test.DependentService   16 | 318 -
org.example.dependent - 0.1.0 |
Test{id='029bd5db-e67b-40bc-b9ca-f0f61cfc9708', name='Test1'}
```

But if I redeploy "domain.jar" too, I get an exception again:
```
ERROR | pipe-bundle:install -s file:/u00/test2/dependent-0.1.jar |
container.BlueprintContainerImpl  440 | 35 - org.apache.aries.blueprint.core
- 1.10.1 | Unable to start container for blueprint bundle
org.example.dependent/0.1.0
org.osgi.service.blueprint.container.ComponentDefinitionException: Error
when instantiating bean dependentService of class test.DependentService
```

It seems like karaf does not remove loaded classes after uninstall, so when
I redeploy "domain bundle" karaf use new one classloader and "dependent.jar"
bundle can't cast it. 

I don't understand why dependent.jar does not know about new domain.jar
classloader and try to use outdated class



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html

Reply via email to