« Return to Thread: trouble with setting debug to false in 3.0.RC1
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
« Return to Thread: trouble with setting debug to false in 3.0.RC1
| Free embeddable forum powered by Nabble | Forum Help |