incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Spicar (JIRA)" <>
Subject [jira] [Commented] (CLEREZZA-617) Bug in org.apache.clerezza.platform.typerendering.WebRenderingService causes a refresh of all bundles
Date Thu, 15 Sep 2011 08:38:08 GMT


Daniel Spicar commented on CLEREZZA-617:

Further debugging revealed the cause of the unintended dependency:

SSPs are compiled with the CompilerService in the Scala OSGi Services (org.apache.clerezza.scala.scripting)
The CompilerService uses TrackingCompiler.scala and on line 81 a ClassLoader of the org.apache.clerezza.scala.scripting
bundle is used to load the compiled SSP class.

Next the class gets instantiated in Platform ScalaServerPages Renderlet (platform.typerendering.scalaserverpages)
bundle at line 186. At this point, Felix creates the package dependency from org.apache.clerezza.scala.scripting
to the bundle providing the the WebRenderingService (here:

My hypothesis is that this is because in the SSP using the WebRenderingService the WebRenderingService
is referenced via fully qualified classname or that the OSGi service lookup is resolved at
the SSPs compile time. Nevertheless there is obviously a reference on
in the consuming SSP. Because the compiled SSP is loaded with the classloader of org.apache.clerezza.scala.scripting,
the dependency is not as one would expect.

Intuitively one would expect a dependency from
on Now the straight forward approach
would be to use the classloader of
to load the compiled SSP. However this approach would change dependencies on all compiled
SSPs and may have currently unknown side effects.

I don't currently know another viable solution. I though of only referencing the WebRenderingService
as a String in the consuming SSP and ensure, the dependency gets resolved dynamically at execution
time but when the scala scrpiting bundle does not import the webrenderingservice's package
there may be a ClassNotFoundException, as its classloader does not know about the WebRenderingService's

Any thought on this are welcome.

> Bug in org.apache.clerezza.platform.typerendering.WebRenderingService causes a refresh
of all bundles
> -----------------------------------------------------------------------------------------------------
>                 Key: CLEREZZA-617
>                 URL:
>             Project: Clerezza
>          Issue Type: Bug
>         Environment: Mac OSx 10.6.6
> java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
> Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
>            Reporter: Tsuyoshi Ito
>            Priority: Critical
>         Attachments: refreshes.png,
> Updating a bundle which provides a WebrenderingService causes an update of all bundles
(after refresh). Even thougth there are no dependencies between most of the bundles.
> test bundles to reproduce the bug attached.
> How to reproduce it:
> parent version 0.3-incubating-SNAPSHOT is used in test bundles (probably you need  0.2-incubating-SNAPSHOT).
> attempt 1
> 1. Install and start bundle
> 2. Install and start bundle
> 3. Go to http://localhost:8080/admin/renderingtest, The WebrenderingService produces
the text "hello test". WebrenderingService is used in an ssp in the webrenderingserviceconsumer
> 4. update, 
> 5. enter ":f refresh", a refresh is necessary. all bundles are updated
> Furthermore the following error occured, which makes Clerezza Console unavailable.
>$$anon$1@2053076f: caught
Bad file descriptor
> Bad file descriptor
> 	at Method)
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at
> 	at$$anon$1$$anonfun$act$1$$anonfun$apply$1.apply(InterruptibleInputStream.scala:40)
> 	at$$anon$1$$anonfun$act$1$$anonfun$apply$1.apply(InterruptibleInputStream.scala:35)
> 	at
> 	at scala.actors.Reactor$class.resumeReceiver(Reactor.scala:129)
> 	at$$anon$1.scala$actors$ReplyReactor$$super$resumeReceiver(InterruptibleInputStream.scala:32)
> 	at scala.actors.ReplyReactor$class.resumeReceiver(ReplyReactor.scala:69)
> 	at$$anon$1.resumeReceiver(InterruptibleInputStream.scala:32)
> 	at scala.actors.Actor$class.searchMailbox(Actor.scala:478)
> 	at$$anon$1.searchMailbox(InterruptibleInputStream.scala:32)
> 	at scala.actors.Reactor$$anonfun$startSearch$1$$anonfun$apply$mcV$sp$1.apply(Reactor.scala:114)
> 	at scala.actors.Reactor$$anonfun$startSearch$1$$anonfun$apply$mcV$sp$1.apply(Reactor.scala:114)
> 	at
> 	at scala.concurrent.forkjoin.ForkJoinPool$AdaptedRunnable.exec(
> 	at scala.concurrent.forkjoin.ForkJoinTask.quietlyExec(
> 	at scala.concurrent.forkjoin.ForkJoinWorkerThread.mainLoop(
> 	at
> Because Clerezza Console is unavailable I have used http://localhost:8080/system/console/shell

> attempt 2
> 1 .Update bundle again without visiting http://localhost:8080/admin/renderingtest
first (not compiling the ssp)
> 2. enter refresh => no refresh necessary

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message