Hello
When I attempt to load a class with
this.getClass.getClassLoader.load("foo.Hello") this prevents future updates
of the bundle exporting foo from being effective, services in that package
will not be running with the updated class until felix is restarted or
packageAdmin.refreshPackages called.
Is this a known problem?
Example clerezza cosnole transcript
zz>val b = bundleContext.getBundle(165)
b: org.osgi.framework.Bundle = tmp.foor [165]
zz>import java.io._
import java.io._
zz>b.update(new FileInputStream("/tmp/last2.jar"))
--> component changed version (looking at webpage generated by the jaxrs
service foo.Service)
zz>b.update(new FileInputStream("/tmp/last1.jar"))
--> component changed version
zz>val cl = this.getClass.getClassLoader()
cl: java.lang.ClassLoader =
scala.tools.nsc.interpreter.AbstractFileClassLoader@748a57a3
zz>cl.loadClass("foo.Hello")
java.lang.ClassNotFoundException: foo.Hello
at
scala.tools.nsc.interpreter.AbstractFileClassLoader.onull$1(AbstractFileClassLoader.scala:21)
at
scala.tools.nsc.interpreter.AbstractFileClassLoader$$anonfun$getBytesForClass$1.apply(AbstractFileClassLoader.scala:26)
at
scala.tools.nsc.interpreter.AbstractFileClassLoader$$anonfun$getBytesForClass$1.apply(AbstractFileClassLoader.scala:25)
at
scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at
scala.tools.nsc.interpreter.AbstractFileClassLoader.getBytesForClass(AbstractFileClassLoader.scala:25)
at
scala.tools.nsc.interpreter.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:33)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
...
zz>b.update(new FileInputStream("/tmp/last2.jar"))
--> no effect on component
Cheers,
reto