Closed GoogleCodeExporter closed 9 years ago
CoreJavaScriptResourceReference implements the Serializable interface. This
means Java should be able to serialize/deserialize it. Most random
serialize/deserialize errors occur when restarting the the webapplication after
updating. The wicket work directory is then used to restore sessions. When
classes have been altered the serialization attempt fails.
I fail to see the relevance of your suggestion to avoid the
WicketRuntimeException. The value of isMinifiedJavascript() is fetched from a
non static context.
Will note your problem, but as it is not reproducable and you are the only one
reporting it at the moment there is nothing we can do. Will tweaks the
constructor of the resourcereferences as your pointed out.
Original comment by hielke.hoeve
on 27 Jun 2011 at 1:56
Check trunk for changes to the resourcereferences. All references are now
loaded lazily to prevent premature initialization.
Original comment by hielke.hoeve
on 27 Jun 2011 at 3:11
if you want have singleton of your ResourceReference, you should add
synchronized keyword (check Google for that).
(And please, add curly brackets to your if/else conditions !)
There's no call to getWiQueryName() (which calls the problematic
isMinifiedJavaScriptResources()) so the problem is solved since you don't call
anymore the problematic code...
What is the goal of getWiQueryName() ?
Original comment by guiom.mary@gmail.com
on 27 Jun 2011 at 4:18
Oops doing too many things at once does work, this proves that once more :)
Synchronized is not necessary as we do not alter the variable from multiple
threads, we only set it the first time. In the highly unlikely event that 2
threads simultaneously set instance only the first thread will serve a
different instance of the resource once. Every consecutive call will return the
last resource. IMO the overhead of making it synchronized counts heavier than
serving a different instance max 1 time per application launch. The file itself
will never change :)
I wanted to override getName() but people from Wicket get off at making things
final so the check is now in the constructor. As all ResourceReferences are
lazy loaded at first load the WiQuerySettings are initialized and all is well.
Original comment by hielke.hoeve
on 28 Jun 2011 at 6:17
Original issue reported on code.google.com by
guiom.mary@gmail.com
on 27 Jun 2011 at 10:37