« Return to Thread: trouble with setting debug to false in 3.0.RC1

trouble with setting debug to false in 3.0.RC1

by Laura Arhire :: Rate this Message:

Reply to Author | View in Thread

Hello

First of all, I want to say what a great job you're doing with dwr. It's an amazing tool.

I'm having a bit of trouble with setting the dwr configuration for production use. I've recently upgraded from 3.0.M1 to 3.0.rc1 (I deployed the jar downloaded from the dwr website) - now, dwr does not seem to work when setting the debug variable to false.

I'm using dwr integrated with spring - and by simply changing the dwr version in my pom.xml and recompiling I can switch between a working copy and a non-working copy.

I'm using the following configuration:

web.xml:

<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
</servlet-mapping>

dispatcher-servlet.xml:

 <dwr:controller id="dwrController" debug="false" />
  <dwr:configuration />
   
  <bean id="dwrUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="alwaysUseFullPath" value="true" />
        <property name="mappings">
            <value>
                  /dwr/**/*=dwrController
            </value>
        </property>
    </bean>

    <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <value>
                [....]
                /dwr/engine.js=dwrController
                /dwr/util.js=dwrController
                /dwr/interface/**=dwrController
                /dwr/call/**=dwrController
                /dwr/**/*=dwrController
                /dwr/**/*.*=dwrController
            </value>
        </property>
        <property name="order" value="0"/>
    </bean>

Exposed method:

    <bean id="PasswordHintControlService" class="com.[...].webapp.dwr.PasswordHintControl">
        <property name="userManager" ref="userManager"/>
        <dwr:remote javascript="PasswordHintService">
              <dwr:include method="getPasswordHint"/>
         </dwr:remote>
    </bean>

I'm also using (for other exposed methods, which should only be accessed by certain roles) the solution presented here: http://bugs.directwebremoting.org/bugs/browse/DWR-307 (extending DefaultAccessControl). One thing to note is that if I take the DefaultAccessControl-extended class out of the configuration, everything nehaves in the same way, so I don't believe that to be the issue.
   
The output I find at /webapp/interface/PasswordHintService.js contains the following stack trace:

<!--

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/yahoo/platform/yui/compressor/JavaScriptCompressor
Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/yahoo/platform/yui/compressor/JavaScriptCompressor
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/yahoo/platform/yui/compressor/JavaScriptCompressor
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:920)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:406)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75)
    at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.[].webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:74)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
    at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
    at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
    at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
    at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: com/yahoo/platform/yui/compressor/JavaScriptCompressor
    at org.directwebremoting.impl.YahooJSCompressor.compressJavaScript(YahooJSCompressor.java:62)
    at org.directwebremoting.servlet.JavaScriptHandler.generateCachableContent(JavaScriptHandler.java:57)
    at org.directwebremoting.servlet.CachingHandler.handle(CachingHandler.java:73)
    at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:120)
    at org.directwebremoting.spring.DwrController.handleRequestInternal(DwrController.java:232)
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
    ... 59 more
-->


Sorry for the long copy/paste. By adding the yui jar (yuicompressor-2.3.5.jar) to the classpath and restarting the server, the javascript file is produced, but Firebug shows some problems in util.js and engine.js

missing ; before statement
if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa
engine.js (line 1)

missing ; before statement
if(window.dojo){dojo.provide("dwr.util")...escapeHtml=escapeHtml}get ;dwr.util._sho

I guess this last (javascript) error has something to do with the rest of the javascript that i run, but nonetheless - the whole behavior is strange, especially since by simply changing the dwr jar it starts working well.

Any ideas about what might be going on?

All the best,
Laura


 « Return to Thread: trouble with setting debug to false in 3.0.RC1