trouble with setting debug to false in 3.0.RC1

View: New views
15 Messages — Rating Filter:   Alert me  

trouble with setting debug to false in 3.0.RC1

by Laura Arhire :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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



Re: trouble with setting debug to false in 3.0.RC1

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).
 
Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 
 
 
On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:
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




Re: trouble with setting debug to false in 3.0.RC1

by Laura Arhire :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

Thank you for the swift reply!

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:
Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).
 
Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 
 
 
On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:
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





Re: trouble with setting debug to false in 3.0.RC1

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:
I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

Thank you for the swift reply!


On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:
Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).
 
Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 
 
 
On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:
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






RE: trouble with setting debug to false in 3.0.RC1

by Don Lyon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I’m using RC1 and getting the same error.

 

It looks like StartupUtil instantiates an instance of org.directwebremoting.impl.YahooJSCompressor, which works fine without the yuicompressor-2.3.5.jar in the classpath.  However, at runtime, YahooJSCompressor.compressJavaScript() tries to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor, which throws the NoClassDefFoundError.

 

Is there a way to configure which compressor to load? 

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 15, 2009 11:19 AM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

 

Thank you for the swift reply!

 

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).

 

Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 

 

 

On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:

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

Error! Filename not specified.if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa

engine.js (line 1)

missing ; before statement

Error! Filename not specified.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

 

 

 


Re: trouble with setting debug to false in 3.0.RC1

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

DWR uses whatever compression library it finds in the classpath (if the yahoo compression jar is present DWR will use that, if shrinksafe is DWR will use that, otherwise DWR will use a custom compression implementation).  Can you share more about your deployment, because if you have yuicompressor-2.3.5.jar in your classpath I don't see how you are getting a NoClassDefFound error for com.yahoo.platform.yui.compressor.JavascriptCompressor since it exists in the jar. 
On Mon, Jun 22, 2009 at 11:39 AM, Don Lyon <don.lyon@...> wrote:

I’m using RC1 and getting the same error.

 

It looks like StartupUtil instantiates an instance of org.directwebremoting.impl.YahooJSCompressor, which works fine without the yuicompressor-2.3.5.jar in the classpath.  However, at runtime, YahooJSCompressor.compressJavaScript() tries to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor, which throws the NoClassDefFoundError.

 

Is there a way to configure which compressor to load? 

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 15, 2009 11:19 AM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

 

Thank you for the swift reply!

 

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).

 

Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 

 

 

On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:

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

Error! Filename not specified.if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa

engine.js (line 1)

missing ; before statement

Error! Filename not specified.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

 

 

 



RE: trouble with setting debug to false in 3.0.RC1

by Don Lyon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

With the yuicompressor-2.3.5.jar in the classpath, it works fine.  I can see in StartupUtils that it creates an instance of YahooJSCompressor and puts it on the configuration.

 

However, I’m having a conflict with another library and the org.mozilla classes, so I remove yuicompressor-2.3.5.jar.  That’s when I get the NoClassDefFoundError.  When I step through StartupUtils, it looks like it still creates an instance of YahooJSCompressor for the configuration.  However, when the compressJavaScript method is called, the NoClassDefFoundError is thrown trying to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor.  I don’t see where in the code it’s looking for which compressor is present in the classpath.  It looks like StartupUtils is looping through the list of org.directwebremoting.impl compressor classes defined in default.properties

 

I don’t think I’ve messed anything up in my environment, since I got the NoClassDefFoundError right off the bat when I upgraded from DWR1.0 to 3.0RC1.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 3:31 PM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

DWR uses whatever compression library it finds in the classpath (if the yahoo compression jar is present DWR will use that, if shrinksafe is DWR will use that, otherwise DWR will use a custom compression implementation).  Can you share more about your deployment, because if you have yuicompressor-2.3.5.jar in your classpath I don't see how you are getting a NoClassDefFound error for com.yahoo.platform.yui.compressor.JavascriptCompressor since it exists in the jar. 

On Mon, Jun 22, 2009 at 11:39 AM, Don Lyon <don.lyon@...> wrote:

I’m using RC1 and getting the same error.

 

It looks like StartupUtil instantiates an instance of org.directwebremoting.impl.YahooJSCompressor, which works fine without the yuicompressor-2.3.5.jar in the classpath.  However, at runtime, YahooJSCompressor.compressJavaScript() tries to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor, which throws the NoClassDefFoundError.

 

Is there a way to configure which compressor to load? 

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 15, 2009 11:19 AM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

 

Thank you for the swift reply!

 

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).

 

Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 

 

 

On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:

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

Error! Filename not specified.if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa

engine.js (line 1)

missing ; before statement

Error! Filename not specified.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

 

 

 

 


Re: trouble with setting debug to false in 3.0.RC1

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, so your original posting was incorrect:
 
"which works fine without the yuicompressor-2.3.5.jar in the classpath."
 
You meant it works fine WITH the yuicompressor-2.3.5.jar.  
 
I just checked the code and it verifies what I said, in protected static void resolveMultipleImplementation(DefaultContainer container, Class<?> toResolve)
 
In this method we loop through all compression classes and attempt to instansiate them.  If instansiation fails we log a debug message.  If no external compression implementations are found we will use our default implementation.  So this should not be causing an issue besides a debug message being logged (if your threshold is DEBUG).
 
What app server are you using?
 


 
On Mon, Jun 22, 2009 at 3:28 PM, Don Lyon <don.lyon@...> wrote:

With the yuicompressor-2.3.5.jar in the classpath, it works fine.  I can see in StartupUtils that it creates an instance of YahooJSCompressor and puts it on the configuration.

 

However, I’m having a conflict with another library and the org.mozilla classes, so I remove yuicompressor-2.3.5.jar.  That’s when I get the NoClassDefFoundError.  When I step through StartupUtils, it looks like it still creates an instance of YahooJSCompressor for the configuration.  However, when the compressJavaScript method is called, the NoClassDefFoundError is thrown trying to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor.  I don’t see where in the code it’s looking for which compressor is present in the classpath.  It looks like StartupUtils is looping through the list of org.directwebremoting.impl compressor classes defined in default.properties

 

I don’t think I’ve messed anything up in my environment, since I got the NoClassDefFoundError right off the bat when I upgraded from DWR1.0 to 3.0RC1.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 3:31 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

DWR uses whatever compression library it finds in the classpath (if the yahoo compression jar is present DWR will use that, if shrinksafe is DWR will use that, otherwise DWR will use a custom compression implementation).  Can you share more about your deployment, because if you have yuicompressor-2.3.5.jar in your classpath I don't see how you are getting a NoClassDefFound error for com.yahoo.platform.yui.compressor.JavascriptCompressor since it exists in the jar. 

On Mon, Jun 22, 2009 at 11:39 AM, Don Lyon <don.lyon@...> wrote:

I’m using RC1 and getting the same error.

 

It looks like StartupUtil instantiates an instance of org.directwebremoting.impl.YahooJSCompressor, which works fine without the yuicompressor-2.3.5.jar in the classpath.  However, at runtime, YahooJSCompressor.compressJavaScript() tries to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor, which throws the NoClassDefFoundError.

 

Is there a way to configure which compressor to load? 

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 15, 2009 11:19 AM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

 

Thank you for the swift reply!

 

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).

 

Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 

 

 

On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:

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

Error! Filename not specified.if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa

engine.js (line 1)

missing ; before statement

Error! Filename not specified.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

 

 

 

 



RE: trouble with setting debug to false in 3.0.RC1

by Don Lyon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

In my original post, I was referring to org.directwebremoting.impl.YahooJSCompressor instantiating, without yuicompressor-2.3.5.jar in the classpath.  It’s not until compressJavaScript() is called that the NoClassDefFoundError is thrown.

 

If I’m reading it correctly, resolveMultipleImplementation loops through:

org.directwebremoting.extend.Compressor: \

    org.directwebremoting.impl.YahooJSCompressor, \

    org.directwebremoting.impl.ShrinkSafeCompressor, \

    org.directwebremoting.impl.LegacyCompressor, \

    org.directwebremoting.impl.NullCompressor

 

Wouldn’t these all instantiate without having the external libraries present?  That’s what appears to be happening in my case.  It always instantiates YahooJSCompressor, external library or not.

 

I’m running on JBoss 4.0.5.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 4:42 PM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

Ok, so your original posting was incorrect:

 

"which works fine without the yuicompressor-2.3.5.jar in the classpath."

 

You meant it works fine WITH the yuicompressor-2.3.5.jar.  

 

I just checked the code and it verifies what I said, in protected static void resolveMultipleImplementation(DefaultContainer container, Class<?> toResolve)

 

In this method we loop through all compression classes and attempt to instansiate them.  If instansiation fails we log a debug message.  If no external compression implementations are found we will use our default implementation.  So this should not be causing an issue besides a debug message being logged (if your threshold is DEBUG).

 

What app server are you using?

 



 

On Mon, Jun 22, 2009 at 3:28 PM, Don Lyon <don.lyon@...> wrote:

With the yuicompressor-2.3.5.jar in the classpath, it works fine.  I can see in StartupUtils that it creates an instance of YahooJSCompressor and puts it on the configuration.

 

However, I’m having a conflict with another library and the org.mozilla classes, so I remove yuicompressor-2.3.5.jar.  That’s when I get the NoClassDefFoundError.  When I step through StartupUtils, it looks like it still creates an instance of YahooJSCompressor for the configuration.  However, when the compressJavaScript method is called, the NoClassDefFoundError is thrown trying to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor.  I don’t see where in the code it’s looking for which compressor is present in the classpath.  It looks like StartupUtils is looping through the list of org.directwebremoting.impl compressor classes defined in default.properties

 

I don’t think I’ve messed anything up in my environment, since I got the NoClassDefFoundError right off the bat when I upgraded from DWR1.0 to 3.0RC1.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 3:31 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

DWR uses whatever compression library it finds in the classpath (if the yahoo compression jar is present DWR will use that, if shrinksafe is DWR will use that, otherwise DWR will use a custom compression implementation).  Can you share more about your deployment, because if you have yuicompressor-2.3.5.jar in your classpath I don't see how you are getting a NoClassDefFound error for com.yahoo.platform.yui.compressor.JavascriptCompressor since it exists in the jar. 

On Mon, Jun 22, 2009 at 11:39 AM, Don Lyon <don.lyon@...> wrote:

I’m using RC1 and getting the same error.

 

It looks like StartupUtil instantiates an instance of org.directwebremoting.impl.YahooJSCompressor, which works fine without the yuicompressor-2.3.5.jar in the classpath.  However, at runtime, YahooJSCompressor.compressJavaScript() tries to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor, which throws the NoClassDefFoundError.

 

Is there a way to configure which compressor to load? 

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 15, 2009 11:19 AM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

 

Thank you for the swift reply!

 

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).

 

Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 

 

 

On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:

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

Error! Filename not specified.if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa

engine.js (line 1)

missing ; before statement

Error! Filename not specified.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

 

 

 

 

 


Re: trouble with setting debug to false in 3.0.RC1

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, Don.  I didn't implement this piece and I just assumed it was working as advertised.  But looks like we have a bug here since only our implementations are in the default.properties.  I will look into it further and create a bug report. 

On Mon, Jun 22, 2009 at 3:41 PM, David Marginian <david@...> wrote:
Ok, so your original posting was incorrect:
 
"which works fine without the yuicompressor-2.3.5.jar in the classpath."
 
You meant it works fine WITH the yuicompressor-2.3.5.jar.  
 
I just checked the code and it verifies what I said, in protected static void resolveMultipleImplementation(DefaultContainer container, Class<?> toResolve)
 
In this method we loop through all compression classes and attempt to instansiate them.  If instansiation fails we log a debug message.  If no external compression implementations are found we will use our default implementation.  So this should not be causing an issue besides a debug message being logged (if your threshold is DEBUG).
 
What app server are you using?
 


 
On Mon, Jun 22, 2009 at 3:28 PM, Don Lyon <don.lyon@...> wrote:

With the yuicompressor-2.3.5.jar in the classpath, it works fine.  I can see in StartupUtils that it creates an instance of YahooJSCompressor and puts it on the configuration.

 

However, I’m having a conflict with another library and the org.mozilla classes, so I remove yuicompressor-2.3.5.jar.  That’s when I get the NoClassDefFoundError.  When I step through StartupUtils, it looks like it still creates an instance of YahooJSCompressor for the configuration.  However, when the compressJavaScript method is called, the NoClassDefFoundError is thrown trying to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor.  I don’t see where in the code it’s looking for which compressor is present in the classpath.  It looks like StartupUtils is looping through the list of org.directwebremoting.impl compressor classes defined in default.properties

 

I don’t think I’ve messed anything up in my environment, since I got the NoClassDefFoundError right off the bat when I upgraded from DWR1.0 to 3.0RC1.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 3:31 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

DWR uses whatever compression library it finds in the classpath (if the yahoo compression jar is present DWR will use that, if shrinksafe is DWR will use that, otherwise DWR will use a custom compression implementation).  Can you share more about your deployment, because if you have yuicompressor-2.3.5.jar in your classpath I don't see how you are getting a NoClassDefFound error for com.yahoo.platform.yui.compressor.JavascriptCompressor since it exists in the jar. 

On Mon, Jun 22, 2009 at 11:39 AM, Don Lyon <don.lyon@...> wrote:

I’m using RC1 and getting the same error.

 

It looks like StartupUtil instantiates an instance of org.directwebremoting.impl.YahooJSCompressor, which works fine without the yuicompressor-2.3.5.jar in the classpath.  However, at runtime, YahooJSCompressor.compressJavaScript() tries to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor, which throws the NoClassDefFoundError.

 

Is there a way to configure which compressor to load? 

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 15, 2009 11:19 AM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

 

Thank you for the swift reply!

 

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).

 

Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 

 

 

On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:

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

Error! Filename not specified.if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa

engine.js (line 1)

missing ; before statement

Error! Filename not specified.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

 

 

 

 




Re: trouble with setting debug to false in 3.0.RC1

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, Don.  You are correct.  I didn't check the default.properties and the compressor implementations and I just sent a response after I checked.  I don't think there is anything you can set to override this in RC1.  I am going to file a bug report tonight. 

On Mon, Jun 22, 2009 at 3:50 PM, Don Lyon <don.lyon@...> wrote:

In my original post, I was referring to org.directwebremoting.impl.YahooJSCompressor instantiating, without yuicompressor-2.3.5.jar in the classpath.  It’s not until compressJavaScript() is called that the NoClassDefFoundError is thrown.

 

If I’m reading it correctly, resolveMultipleImplementation loops through:

org.directwebremoting.extend.Compressor: \

    org.directwebremoting.impl.YahooJSCompressor, \

    org.directwebremoting.impl.ShrinkSafeCompressor, \

    org.directwebremoting.impl.LegacyCompressor, \

    org.directwebremoting.impl.NullCompressor

 

Wouldn’t these all instantiate without having the external libraries present?  That’s what appears to be happening in my case.  It always instantiates YahooJSCompressor, external library or not.

 

I’m running on JBoss 4.0.5.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 4:42 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

Ok, so your original posting was incorrect:

 

"which works fine without the yuicompressor-2.3.5.jar in the classpath."

 

You meant it works fine WITH the yuicompressor-2.3.5.jar.  

 

I just checked the code and it verifies what I said, in protected static void resolveMultipleImplementation(DefaultContainer container, Class<?> toResolve)

 

In this method we loop through all compression classes and attempt to instansiate them.  If instansiation fails we log a debug message.  If no external compression implementations are found we will use our default implementation.  So this should not be causing an issue besides a debug message being logged (if your threshold is DEBUG).

 

What app server are you using?

 



 

On Mon, Jun 22, 2009 at 3:28 PM, Don Lyon <don.lyon@...> wrote:

With the yuicompressor-2.3.5.jar in the classpath, it works fine.  I can see in StartupUtils that it creates an instance of YahooJSCompressor and puts it on the configuration.

 

However, I’m having a conflict with another library and the org.mozilla classes, so I remove yuicompressor-2.3.5.jar.  That’s when I get the NoClassDefFoundError.  When I step through StartupUtils, it looks like it still creates an instance of YahooJSCompressor for the configuration.  However, when the compressJavaScript method is called, the NoClassDefFoundError is thrown trying to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor.  I don’t see where in the code it’s looking for which compressor is present in the classpath.  It looks like StartupUtils is looping through the list of org.directwebremoting.impl compressor classes defined in default.properties

 

I don’t think I’ve messed anything up in my environment, since I got the NoClassDefFoundError right off the bat when I upgraded from DWR1.0 to 3.0RC1.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 3:31 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

DWR uses whatever compression library it finds in the classpath (if the yahoo compression jar is present DWR will use that, if shrinksafe is DWR will use that, otherwise DWR will use a custom compression implementation).  Can you share more about your deployment, because if you have yuicompressor-2.3.5.jar in your classpath I don't see how you are getting a NoClassDefFound error for com.yahoo.platform.yui.compressor.JavascriptCompressor since it exists in the jar. 

On Mon, Jun 22, 2009 at 11:39 AM, Don Lyon <don.lyon@...> wrote:

I’m using RC1 and getting the same error.

 

It looks like StartupUtil instantiates an instance of org.directwebremoting.impl.YahooJSCompressor, which works fine without the yuicompressor-2.3.5.jar in the classpath.  However, at runtime, YahooJSCompressor.compressJavaScript() tries to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor, which throws the NoClassDefFoundError.

 

Is there a way to configure which compressor to load? 

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 15, 2009 11:19 AM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

 

Thank you for the swift reply!

 

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).

 

Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 

 

 

On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:

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

Error! Filename not specified.if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa

engine.js (line 1)

missing ; before statement

Error! Filename not specified.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

 

 

 

 

 



Re: trouble with setting debug to false in 3.0.RC1

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

And thanks for being persistent. 

On Mon, Jun 22, 2009 at 3:56 PM, David Marginian <david@...> wrote:
Yes, Don.  You are correct.  I didn't check the default.properties and the compressor implementations and I just sent a response after I checked.  I don't think there is anything you can set to override this in RC1.  I am going to file a bug report tonight. 

On Mon, Jun 22, 2009 at 3:50 PM, Don Lyon <don.lyon@...> wrote:

In my original post, I was referring to org.directwebremoting.impl.YahooJSCompressor instantiating, without yuicompressor-2.3.5.jar in the classpath.  It’s not until compressJavaScript() is called that the NoClassDefFoundError is thrown.

 

If I’m reading it correctly, resolveMultipleImplementation loops through:

org.directwebremoting.extend.Compressor: \

    org.directwebremoting.impl.YahooJSCompressor, \

    org.directwebremoting.impl.ShrinkSafeCompressor, \

    org.directwebremoting.impl.LegacyCompressor, \

    org.directwebremoting.impl.NullCompressor

 

Wouldn’t these all instantiate without having the external libraries present?  That’s what appears to be happening in my case.  It always instantiates YahooJSCompressor, external library or not.

 

I’m running on JBoss 4.0.5.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 4:42 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

Ok, so your original posting was incorrect:

 

"which works fine without the yuicompressor-2.3.5.jar in the classpath."

 

You meant it works fine WITH the yuicompressor-2.3.5.jar.  

 

I just checked the code and it verifies what I said, in protected static void resolveMultipleImplementation(DefaultContainer container, Class<?> toResolve)

 

In this method we loop through all compression classes and attempt to instansiate them.  If instansiation fails we log a debug message.  If no external compression implementations are found we will use our default implementation.  So this should not be causing an issue besides a debug message being logged (if your threshold is DEBUG).

 

What app server are you using?

 



 

On Mon, Jun 22, 2009 at 3:28 PM, Don Lyon <don.lyon@...> wrote:

With the yuicompressor-2.3.5.jar in the classpath, it works fine.  I can see in StartupUtils that it creates an instance of YahooJSCompressor and puts it on the configuration.

 

However, I’m having a conflict with another library and the org.mozilla classes, so I remove yuicompressor-2.3.5.jar.  That’s when I get the NoClassDefFoundError.  When I step through StartupUtils, it looks like it still creates an instance of YahooJSCompressor for the configuration.  However, when the compressJavaScript method is called, the NoClassDefFoundError is thrown trying to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor.  I don’t see where in the code it’s looking for which compressor is present in the classpath.  It looks like StartupUtils is looping through the list of org.directwebremoting.impl compressor classes defined in default.properties

 

I don’t think I’ve messed anything up in my environment, since I got the NoClassDefFoundError right off the bat when I upgraded from DWR1.0 to 3.0RC1.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 3:31 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

DWR uses whatever compression library it finds in the classpath (if the yahoo compression jar is present DWR will use that, if shrinksafe is DWR will use that, otherwise DWR will use a custom compression implementation).  Can you share more about your deployment, because if you have yuicompressor-2.3.5.jar in your classpath I don't see how you are getting a NoClassDefFound error for com.yahoo.platform.yui.compressor.JavascriptCompressor since it exists in the jar. 

On Mon, Jun 22, 2009 at 11:39 AM, Don Lyon <don.lyon@...> wrote:

I’m using RC1 and getting the same error.

 

It looks like StartupUtil instantiates an instance of org.directwebremoting.impl.YahooJSCompressor, which works fine without the yuicompressor-2.3.5.jar in the classpath.  However, at runtime, YahooJSCompressor.compressJavaScript() tries to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor, which throws the NoClassDefFoundError.

 

Is there a way to configure which compressor to load? 

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 15, 2009 11:19 AM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

 

Thank you for the swift reply!

 

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).

 

Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 

 

 

On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:

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

Error! Filename not specified.if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa

engine.js (line 1)

missing ; before statement

Error! Filename not specified.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

 

 

 

 

 




RE: trouble with setting debug to false in 3.0.RC1

by Don Lyon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

David, thanks for filing the bug on this.  I’m glad I didn’t hack up default.properties in vain on my end to get this to work.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 5:13 PM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

And thanks for being persistent. 

On Mon, Jun 22, 2009 at 3:56 PM, David Marginian <david@...> wrote:

Yes, Don.  You are correct.  I didn't check the default.properties and the compressor implementations and I just sent a response after I checked.  I don't think there is anything you can set to override this in RC1.  I am going to file a bug report tonight. 

 

On Mon, Jun 22, 2009 at 3:50 PM, Don Lyon <don.lyon@...> wrote:

In my original post, I was referring to org.directwebremoting.impl.YahooJSCompressor instantiating, without yuicompressor-2.3.5.jar in the classpath.  It’s not until compressJavaScript() is called that the NoClassDefFoundError is thrown.

 

If I’m reading it correctly, resolveMultipleImplementation loops through:

org.directwebremoting.extend.Compressor: \

    org.directwebremoting.impl.YahooJSCompressor, \

    org.directwebremoting.impl.ShrinkSafeCompressor, \

    org.directwebremoting.impl.LegacyCompressor, \

    org.directwebremoting.impl.NullCompressor

 

Wouldn’t these all instantiate without having the external libraries present?  That’s what appears to be happening in my case.  It always instantiates YahooJSCompressor, external library or not.

 

I’m running on JBoss 4.0.5.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 4:42 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

Ok, so your original posting was incorrect:

 

"which works fine without the yuicompressor-2.3.5.jar in the classpath."

 

You meant it works fine WITH the yuicompressor-2.3.5.jar.  

 

I just checked the code and it verifies what I said, in protected static void resolveMultipleImplementation(DefaultContainer container, Class<?> toResolve)

 

In this method we loop through all compression classes and attempt to instansiate them.  If instansiation fails we log a debug message.  If no external compression implementations are found we will use our default implementation.  So this should not be causing an issue besides a debug message being logged (if your threshold is DEBUG).

 

What app server are you using?

 



 

On Mon, Jun 22, 2009 at 3:28 PM, Don Lyon <don.lyon@...> wrote:

With the yuicompressor-2.3.5.jar in the classpath, it works fine.  I can see in StartupUtils that it creates an instance of YahooJSCompressor and puts it on the configuration.

 

However, I’m having a conflict with another library and the org.mozilla classes, so I remove yuicompressor-2.3.5.jar.  That’s when I get the NoClassDefFoundError.  When I step through StartupUtils, it looks like it still creates an instance of YahooJSCompressor for the configuration.  However, when the compressJavaScript method is called, the NoClassDefFoundError is thrown trying to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor.  I don’t see where in the code it’s looking for which compressor is present in the classpath.  It looks like StartupUtils is looping through the list of org.directwebremoting.impl compressor classes defined in default.properties

 

I don’t think I’ve messed anything up in my environment, since I got the NoClassDefFoundError right off the bat when I upgraded from DWR1.0 to 3.0RC1.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 3:31 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

DWR uses whatever compression library it finds in the classpath (if the yahoo compression jar is present DWR will use that, if shrinksafe is DWR will use that, otherwise DWR will use a custom compression implementation).  Can you share more about your deployment, because if you have yuicompressor-2.3.5.jar in your classpath I don't see how you are getting a NoClassDefFound error for com.yahoo.platform.yui.compressor.JavascriptCompressor since it exists in the jar. 

On Mon, Jun 22, 2009 at 11:39 AM, Don Lyon <don.lyon@...> wrote:

I’m using RC1 and getting the same error.

 

It looks like StartupUtil instantiates an instance of org.directwebremoting.impl.YahooJSCompressor, which works fine without the yuicompressor-2.3.5.jar in the classpath.  However, at runtime, YahooJSCompressor.compressJavaScript() tries to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor, which throws the NoClassDefFoundError.

 

Is there a way to configure which compressor to load? 

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 15, 2009 11:19 AM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

 

Thank you for the swift reply!

 

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).

 

Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 

 

 

On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:

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

Error! Filename not specified.if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa

engine.js (line 1)

missing ; before statement

Error! Filename not specified.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

 

 

 

 

 

 

 


Re: trouble with setting debug to false in 3.0.RC1

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Don,
  If you want try adding something like the following to YahooJSCompressor.  This should do the trick.  I implemented this class but then we changed the way we were doing things and I forgot to go back and change it. 
 
/**
     * Constructor: YahooJSCompressor using default property values.
     */
    public YahooJSCompressor() throws InstantiationException
    {
        try
        {
            new JavaScriptCompressor(new StringReader(""), new YahooJSErrorReporter());
        }
        catch (NoClassDefFoundError ncdf)
        {
            throw new InstantiationException("com.yahoo.platform.yui.compressor.JavaScriptCompressor is not available, assuming Yahoo Compressor is not here from yuicompressor.jar ");
        }
        catch (Exception e)
        {
            // We don't care about this!  The instansiation above is just to ensure that the Yahoo compressor is
            // on the classpath.  If the actual test compression fails we don't need to do anything.
        }
        setCompressorParameters(null);
    }

On Mon, Jun 22, 2009 at 4:27 PM, Don Lyon <don.lyon@...> wrote:

David, thanks for filing the bug on this.  I’m glad I didn’t hack up default.properties in vain on my end to get this to work.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 5:13 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

And thanks for being persistent. 

On Mon, Jun 22, 2009 at 3:56 PM, David Marginian <david@...> wrote:

Yes, Don.  You are correct.  I didn't check the default.properties and the compressor implementations and I just sent a response after I checked.  I don't think there is anything you can set to override this in RC1.  I am going to file a bug report tonight. 

 

On Mon, Jun 22, 2009 at 3:50 PM, Don Lyon <don.lyon@...> wrote:

In my original post, I was referring to org.directwebremoting.impl.YahooJSCompressor instantiating, without yuicompressor-2.3.5.jar in the classpath.  It’s not until compressJavaScript() is called that the NoClassDefFoundError is thrown.

 

If I’m reading it correctly, resolveMultipleImplementation loops through:

org.directwebremoting.extend.Compressor: \

    org.directwebremoting.impl.YahooJSCompressor, \

    org.directwebremoting.impl.ShrinkSafeCompressor, \

    org.directwebremoting.impl.LegacyCompressor, \

    org.directwebremoting.impl.NullCompressor

 

Wouldn’t these all instantiate without having the external libraries present?  That’s what appears to be happening in my case.  It always instantiates YahooJSCompressor, external library or not.

 

I’m running on JBoss 4.0.5.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 4:42 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

Ok, so your original posting was incorrect:

 

"which works fine without the yuicompressor-2.3.5.jar in the classpath."

 

You meant it works fine WITH the yuicompressor-2.3.5.jar.  

 

I just checked the code and it verifies what I said, in protected static void resolveMultipleImplementation(DefaultContainer container, Class<?> toResolve)

 

In this method we loop through all compression classes and attempt to instansiate them.  If instansiation fails we log a debug message.  If no external compression implementations are found we will use our default implementation.  So this should not be causing an issue besides a debug message being logged (if your threshold is DEBUG).

 

What app server are you using?

 



 

On Mon, Jun 22, 2009 at 3:28 PM, Don Lyon <don.lyon@...> wrote:

With the yuicompressor-2.3.5.jar in the classpath, it works fine.  I can see in StartupUtils that it creates an instance of YahooJSCompressor and puts it on the configuration.

 

However, I’m having a conflict with another library and the org.mozilla classes, so I remove yuicompressor-2.3.5.jar.  That’s when I get the NoClassDefFoundError.  When I step through StartupUtils, it looks like it still creates an instance of YahooJSCompressor for the configuration.  However, when the compressJavaScript method is called, the NoClassDefFoundError is thrown trying to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor.  I don’t see where in the code it’s looking for which compressor is present in the classpath.  It looks like StartupUtils is looping through the list of org.directwebremoting.impl compressor classes defined in default.properties

 

I don’t think I’ve messed anything up in my environment, since I got the NoClassDefFoundError right off the bat when I upgraded from DWR1.0 to 3.0RC1.

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 22, 2009 3:31 PM


To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

DWR uses whatever compression library it finds in the classpath (if the yahoo compression jar is present DWR will use that, if shrinksafe is DWR will use that, otherwise DWR will use a custom compression implementation).  Can you share more about your deployment, because if you have yuicompressor-2.3.5.jar in your classpath I don't see how you are getting a NoClassDefFound error for com.yahoo.platform.yui.compressor.JavascriptCompressor since it exists in the jar. 

On Mon, Jun 22, 2009 at 11:39 AM, Don Lyon <don.lyon@...> wrote:

I’m using RC1 and getting the same error.

 

It looks like StartupUtil instantiates an instance of org.directwebremoting.impl.YahooJSCompressor, which works fine without the yuicompressor-2.3.5.jar in the classpath.  However, at runtime, YahooJSCompressor.compressJavaScript() tries to instantiate com.yahoo.platform.yui.compressor.JavascriptCompressor, which throws the NoClassDefFoundError.

 

Is there a way to configure which compressor to load? 

 

From: dmarginian@... [mailto:dmarginian@...] On Behalf Of David Marginian
Sent: Monday, June 15, 2009 11:19 AM
To: users@...
Subject: Re: [dwr-user] trouble with setting debug to false in 3.0.RC1

 

I would clear out your containers cache/temp and remove the dwr.jar and make sure you don't have an older jar in the path somewhere as well.

On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...> wrote:

I'll re-download the jar from the website and try again, maybe I accidentally corrupted my artifactory. I'll also strip all javascript from the page and see where that takes me. I'll report here as soon as I manage to do everything.

 

Thank you for the swift reply!

 

On Mon, Jun 15, 2009 at 7:01 PM, David Marginian <david@...> wrote:

Are you absolutely certain you are using RC1?  I would certainly not expect you to be seeing the stack trace you have included if you are.  DWR will only try to use the Yahoo Compressor if it is available in the classpath, a quick look a the code confirms this behavior.  If it is not, a default compression implementation should be used.  You can verify this in StartupUtil.java (resolveMultipleImplementations and resolveMultipleImplemenation methods).

 

Despite everything above I would recommend trimming your html file to just the basic DWR includes (remove all external JavaScript etc.) and see if you get the same JavaScript errors. 

 

 

On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...> wrote:

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

Error! Filename not specified.if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa

engine.js (line 1)

missing ; before statement

Error! Filename not specified.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

 

 

 

 

 

 

 



Re: trouble with setting debug to false in 3.0.RC1

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugs.directwebremoting.org/bugs/browse/DWR-394

David Marginian wrote:

> Don,
>   If you want try adding something like the following to
> YahooJSCompressor.  This should do the trick.  I implemented this
> class but then we changed the way we were doing things and I forgot to
> go back and change it.
>  
> /**
>      * Constructor: YahooJSCompressor using default property values.
>      */
>     public YahooJSCompressor() throws InstantiationException
>     {
>         try
>         {
>             new JavaScriptCompressor(new StringReader(""), new
> YahooJSErrorReporter());
>         }
>         catch (NoClassDefFoundError ncdf)
>         {
>             throw new
> InstantiationException("com.yahoo.platform.yui.compressor.JavaScriptCompressor
> is not available, assuming Yahoo Compressor is not here from
> yuicompressor.jar ");
>         }
>         catch (Exception e)
>         {
>             // We don't care about this!  The instansiation above is
> just to ensure that the Yahoo compressor is
>             // on the classpath.  If the actual test compression fails
> we don't need to do anything.
>         }
>         setCompressorParameters(null);
>     }
>
> On Mon, Jun 22, 2009 at 4:27 PM, Don Lyon <don.lyon@...
> <mailto:don.lyon@...>> wrote:
>
>     David, thanks for filing the bug on this.  I’m glad I didn’t hack
>     up default.properties in vain on my end to get this to work.
>
>      
>
>     *From:* dmarginian@... <mailto:dmarginian@...>
>     [mailto:dmarginian@... <mailto:dmarginian@...>] *On
>     Behalf Of *David Marginian
>     *Sent:* Monday, June 22, 2009 5:13 PM
>
>     *To:* users@... <mailto:users@...>
>     *Subject:* Re: [dwr-user] trouble with setting debug to false in
>     3.0.RC1
>
>      
>
>     And thanks for being persistent.
>
>     On Mon, Jun 22, 2009 at 3:56 PM, David Marginian
>     <david@... <mailto:david@...>> wrote:
>
>     Yes, Don.  You are correct.  I didn't check the default.properties
>     and the compressor implementations and I just sent a response
>     after I checked.  I don't think there is anything you can set to
>     override this in RC1.  I am going to file a bug report tonight.
>
>      
>
>     On Mon, Jun 22, 2009 at 3:50 PM, Don Lyon <don.lyon@...
>     <mailto:don.lyon@...>> wrote:
>
>     In my original post, I was referring to
>     org.directwebremoting.impl.YahooJSCompressor instantiating,
>     without yuicompressor-2.3.5.jar in the classpath.  It’s not until
>     compressJavaScript() is called that the NoClassDefFoundError is
>     thrown.
>
>      
>
>     If I’m reading it correctly, resolveMultipleImplementation loops
>     through:
>
>     org.directwebremoting.extend.Compressor: \
>
>         org.directwebremoting.impl.YahooJSCompressor, \
>
>         org.directwebremoting.impl.ShrinkSafeCompressor, \
>
>         org.directwebremoting.impl.LegacyCompressor, \
>
>         org.directwebremoting.impl.NullCompressor
>
>      
>
>     Wouldn’t these all instantiate without having the external
>     libraries present?  That’s what appears to be happening in my
>     case.  It always instantiates YahooJSCompressor, external library
>     or not.
>
>      
>
>     I’m running on JBoss 4.0.5.
>
>      
>
>     *From:* dmarginian@... <mailto:dmarginian@...>
>     [mailto:dmarginian@... <mailto:dmarginian@...>] *On
>     Behalf Of *David Marginian
>     *Sent:* Monday, June 22, 2009 4:42 PM
>
>
>     *To:* users@... <mailto:users@...>
>     *Subject:* Re: [dwr-user] trouble with setting debug to false in
>     3.0.RC1
>
>      
>
>     Ok, so your original posting was incorrect:
>
>      
>
>     "which works fine without the yuicompressor-2.3.5.jar in the
>     classpath."
>
>      
>
>     You meant it works fine WITH the yuicompressor-2.3.5.jar.  
>
>      
>
>     I just checked the code and it verifies what I said, in protected
>     static void resolveMultipleImplementation(DefaultContainer
>     container, Class<?> toResolve)
>
>      
>
>     In this method we loop through all compression classes and attempt
>     to instansiate them.  If instansiation fails we log a debug
>     message.  If no external compression implementations are found we
>     will use our default implementation.  So this should not be
>     causing an issue besides a debug message being logged (if your
>     threshold is DEBUG).
>
>      
>
>     What app server are you using?
>
>      
>
>
>
>      
>
>     On Mon, Jun 22, 2009 at 3:28 PM, Don Lyon <don.lyon@...
>     <mailto:don.lyon@...>> wrote:
>
>     With the yuicompressor-2.3.5.jar in the classpath, it works fine.
>     I can see in StartupUtils that it creates an instance of
>     YahooJSCompressor and puts it on the configuration.
>
>      
>
>     However, I’m having a conflict with another library and the
>     org.mozilla classes, so I remove yuicompressor-2.3.5.jar.  That’s
>     when I get the NoClassDefFoundError.  When I step through
>     StartupUtils, it looks like it still creates an instance of
>     YahooJSCompressor for the configuration.  However, when the
>     compressJavaScript method is called, the NoClassDefFoundError is
>     thrown trying to instantiate
>     com.yahoo.platform.yui.compressor.JavascriptCompressor.  I don’t
>     see where in the code it’s looking for which compressor is present
>     in the classpath.  It looks like StartupUtils is looping through
>     the list of org.directwebremoting.impl compressor classes defined
>     in default.properties
>
>      
>
>     I don’t think I’ve messed anything up in my environment, since I
>     got the NoClassDefFoundError right off the bat when I upgraded
>     from DWR1.0 to 3.0RC1.
>
>      
>
>     *From:* dmarginian@... <mailto:dmarginian@...>
>     [mailto:dmarginian@... <mailto:dmarginian@...>] *On
>     Behalf Of *David Marginian
>     *Sent:* Monday, June 22, 2009 3:31 PM
>
>
>     *To:* users@... <mailto:users@...>
>     *Subject:* Re: [dwr-user] trouble with setting debug to false in
>     3.0.RC1
>
>      
>
>     DWR uses whatever compression library it finds in the classpath
>     (if the yahoo compression jar is present DWR will use that, if
>     shrinksafe is DWR will use that, otherwise DWR will use a custom
>     compression implementation).  Can you share more about your
>     deployment, because if you have yuicompressor-2.3.5.jar in your
>     classpath I don't see how you are getting a NoClassDefFound
>     error for com.yahoo.platform.yui.compressor.JavascriptCompressor
>     since it exists in the jar.
>
>     On Mon, Jun 22, 2009 at 11:39 AM, Don Lyon <don.lyon@...
>     <mailto:don.lyon@...>> wrote:
>
>     I’m using RC1 and getting the same error.
>
>      
>
>     It looks like StartupUtil instantiates an instance of
>     org.directwebremoting.impl.YahooJSCompressor, which works fine
>     without the yuicompressor-2.3.5.jar in the classpath.  However, at
>     runtime, YahooJSCompressor.compressJavaScript() tries to
>     instantiate
>     com.yahoo.platform.yui.compressor.JavascriptCompressor, which
>     throws the NoClassDefFoundError.
>
>      
>
>     Is there a way to configure which compressor to load?
>
>      
>
>     *From:* dmarginian@... <mailto:dmarginian@...>
>     [mailto:dmarginian@... <mailto:dmarginian@...>] *On
>     Behalf Of *David Marginian
>     *Sent:* Monday, June 15, 2009 11:19 AM
>     *To:* users@... <mailto:users@...>
>     *Subject:* Re: [dwr-user] trouble with setting debug to false in
>     3.0.RC1
>
>      
>
>     I would clear out your containers cache/temp and remove the
>     dwr.jar and make sure you don't have an older jar in the path
>     somewhere as well.
>
>     On Mon, Jun 15, 2009 at 10:14 AM, Laura Arhire <larhire@...
>     <mailto:larhire@...>> wrote:
>
>     I'll re-download the jar from the website and try again, maybe I
>     accidentally corrupted my artifactory. I'll also strip all
>     javascript from the page and see where that takes me. I'll report
>     here as soon as I manage to do everything.
>
>      
>
>     Thank you for the swift reply!
>
>      
>
>     On Mon, Jun 15, 2009 at 7:01 PM, David Marginian
>     <david@... <mailto:david@...>> wrote:
>
>     Are you absolutely certain you are using RC1?  I would certainly
>     not expect you to be seeing the stack trace you have included if
>     you are.  DWR will only try to use the Yahoo Compressor if it is
>     available in the classpath, a quick look a the code confirms this
>     behavior.  If it is not, a default compression
>     implementation should be used.  You can verify this
>     in StartupUtil.java (resolveMultipleImplementations and
>     resolveMultipleImplemenation methods).
>
>      
>
>     Despite everything above I would recommend trimming your html
>     file to just the basic DWR includes (remove all external
>     JavaScript etc.) and see if you get the same JavaScript errors.
>
>      
>
>      
>
>     On Mon, Jun 15, 2009 at 9:15 AM, Laura Arhire <larhire@...
>     <mailto:larhire@...>> wrote:
>
>     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
>
>     *Error! Filename not
>     specified.*if(window.dojo){dojo.provide("dwr.engine...Handler=function(handler){dwr.engine._wa
>
>     engine.js (line 1)
>
>     missing ; before statement
>
>     *Error! Filename not
>     specified.*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
>
>      
>
>      
>
>      
>
>      
>
>      
>
>      
>
>      
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...