#24 Filter fails in 0.9.9, OK in -lite-0.9.9

closed-fixed
nobody
None
5
2008-02-28
2007-09-27
Gwyn Evans
No

I'm running this in Intellij IDEA, using the IDEA plugin but not yet tried to reproduce outside that.

The plugin lets me select which winstone jar to use. I've been using -lite happily enough, but was going to try using the ReloadingServlet option, so downloaded & switched to the full jar (as that's not in -lite). I found, however that with no other change from -lite other than the jar itself, my config stopped working, with the following error...

[Winstone 2007/09/27 16:35:55] - Error initializing web application: prefix []
java.lang.ClassCastException: org.apache.wicket.protocol.http.WicketFilter
at winstone.FilterConfiguration.getFilter(FilterConfiguration.java:128)
at winstone.WebAppConfiguration.<init>(WebAppConfiguration.java:907)
at winstone.HostConfiguration.initWebApp(HostConfiguration.java:131)
at winstone.HostConfiguration.<init>(HostConfiguration.java:73)
at winstone.HostGroup.initHost(HostGroup.java:85)
at winstone.HostGroup.<init>(HostGroup.java:45)
at winstone.Launcher.<init>(Launcher.java:196)
at winstone.Launcher.main(Launcher.java:391)

[Winstone 2007/09/27 16:35:55] - Winstone Servlet Engine v0.9.9 running: controlPort=disabled
[Winstone 2007/09/27 16:35:55] - HTTP Listener started: port=8080
[Winstone 2007/09/27 16:35:55] - AJP13 Listener started: port=8009
[Winstone 2007/09/27 16:35:55] - Request URL / not found - doesn't match any webapp prefix

If I switch back to -lite, it works and my filter (mapped to "/*" runs fine)

Discussion

  • Rick Knowles

    Rick Knowles - 2007-09-27

    Logged In: YES
    user_id=716353
    Originator: NO

    Hmmm ... this looks like a classloader bug in the ReloadingClassLoader. I thought we'd gotten rid of these - looks like I spoke too soon. You might find 0.9.6 works better in the short term if you really need the reloading feature.

    I'll have a look at this. Thanks for reporting it.

    Rick

     
  • Gwyn Evans

    Gwyn Evans - 2007-09-28

    Logged In: YES
    user_id=239067
    Originator: YES

    I'm not sure it's that, as I just have to switch jars to trigger this - I'm not (knowingly) running the ReloadingServlet, that was just why I switched, but I went back to the default option when that failed and found this odd behaviour!

    I've pasted the working, then the failing, exec lines, although I've chopped the classpaths from each (as they're very long!) The only diff I can see is the 0.9.9 jars...

    D:\Java\jdk1.5.0_10\bin\java -Didea.launcher.port=7532 -Didea.launcher.bin.path=D:\Java\Tools\IDEA7274\bin -Dfile.encoding=windows-1252 -classpath D:\Java\tools\winstone\winstone-lite-0.9.9.jar;... com.intellij.rt.execution.application.AppMain winstone.Launcher --webroot=V:\consulting\3_UK\CareApps\target\h3g-P.2.1.0-MVN --httpPort=8080 --useJasper=true --javaHome=D:/Java/jdk1.5.0_10 --toolsJar=D:/Java/jdk1.5.0_10/lib/tools.jar --debug=5 --commonLibFolder=D:\Java\tools\winstone\lib

    D:\Java\jdk1.5.0_10\bin\java -Didea.launcher.port=7533 -Didea.launcher.bin.path=D:\Java\Tools\IDEA7274\bin -Dfile.encoding=windows-1252 -classpath D:\Java\tools\winstone\winstone-0.9.9.jar;... com.intellij.rt.execution.application.AppMain winstone.Launcher --webroot=V:\consulting\3_UK\CareApps\target\h3g-P.2.1.0-MVN --httpPort=8080 --useJasper=true --javaHome=D:/Java/jdk1.5.0_10 --toolsJar=D:/Java/jdk1.5.0_10/lib/tools.jar --debug=5 --commonLibFolder=D:\Java\tools\winstone\lib

    /Gwyn

     
  • Rick Knowles

    Rick Knowles - 2007-09-29

    Logged In: YES
    user_id=716353
    Originator: NO

    Sorry typo / brain-freeze on my part. I meant the winstone.classLoader.WebappClassLoader class not ReloadingClassLoader.

    The boot-time Launcher class checks for the presence of WebappClassLoader at startup, and if it's present it uses it. If not, it falls back to java.net.URLClassLoader. This is what is happening in the lite version.

    You can test this hypothesis by adding a command line arg "--preferredClassLoader=java.net.URLClassLoader". This will force even the full jar to use the lite version's classloader.

    If this is the problem, it's likely I've got some serious hell on my hands with the classloader. Rapidly reaching the limits of my knowledge/skill with classloaders ... if anyone out there wants to contribute a webapp classloader (with the proper hierarchy as in the spec) I'd be eternally grateful.

     
  • Gwyn Evans

    Gwyn Evans - 2007-09-29

    Logged In: YES
    user_id=239067
    Originator: YES

    Ah... adding that option does make it work, I'm afraid! :-)

    Let me know if there's anything I can do to provide any info that might help...

     
  • Rick Knowles

    Rick Knowles - 2007-09-29

    Logged In: YES
    user_id=716353
    Originator: NO

    Actually one thing you might be able to confirm for me is whether or not the same problem occurs when you run it from the command line instead of inside IDEA. If IDEA is anything like eclipse, the plugin is probably doing some nasty hackery to make the IDE project classloader somehow feed the winstone system classloader.

    If this is the case, it would mean that there's no way reloading could be supported, and only the URLClassloader has any chance of working.

    Can you give it a try from a dos/unix shell and let me know please ? thanks

     
  • Gwyn Evans

    Gwyn Evans - 2007-09-29

    Logged In: YES
    user_id=239067
    Originator: YES

    Not IDEA-specific - I get the same problem from the command-line, just targetting the war or exploded-war folder, i.e. nothing IDEA-related around...

    D:\&gt;java -jar \Java\Tools\winstone\winstone-0.9.9.jar \ST\V\gwyeva1_view\vobs\consulting\3_UK\CareApps\target\h3g-P.2.1.0-MVN
    [Winstone 2007/09/29 15:18:43] - WARNING: Non-XML-Schema-compliant parser detected. Servlet spec <= 2.3 supported
    [Winstone 2007/09/29 15:18:44] - Error initializing web application: prefix []
    java.lang.ClassCastException
    at winstone.FilterConfiguration.getFilter(FilterConfiguration.java:128)
    at winstone.WebAppConfiguration.<init>(WebAppConfiguration.java:907)
    at winstone.HostConfiguration.initWebApp(HostConfiguration.java:131)
    at winstone.HostConfiguration.<init>(HostConfiguration.java:73)
    at winstone.HostGroup.initHost(HostGroup.java:85)
    at winstone.HostGroup.<init>(HostGroup.java:45)
    at winstone.Launcher.<init>(Launcher.java:196)
    at winstone.Launcher.main(Launcher.java:391)

    [Winstone 2007/09/29 15:18:44] - Winstone Servlet Engine v0.9.9 running: controlPort=disabled
    [Winstone 2007/09/29 15:18:44] - HTTP Listener started: port=8080
    [Winstone 2007/09/29 15:18:44] - AJP13 Listener started: port=8009

    If I get a chance, I'll see if I can cut it down a bit & produce a demo war

     
  • Nobody/Anonymous

    Logged In: NO

    The OpenSymphony Sitemesh filter didn't produce errors in v0.9.9, but doesn't work (kept producing blank pages). Will be trying it in the lite version.

     
  • Rick Knowles

    Rick Knowles - 2008-02-28

    Logged In: YES
    user_id=716353
    Originator: NO

    please try this again with the latest release or cvs version, it should have been fixed by now

     
  • Rick Knowles

    Rick Knowles - 2008-02-28
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks