Fórum

Minifier crashing

Paul Schyska, modificado 13 Anos atrás.

Minifier crashing

New Member Postagens: 10 Data de Entrada: 15/04/11 Postagens Recentes
Hi Forums,

i have problems with the minifier. I'm trying to deploy an GWT-based widget to the portal. Unfortunateley, the minifier chokes on the generated js file (I'm pretty sure it's syntactically correct as its from GWT compiler).

The top of trace is:

15:47:06,694 ERROR [MinifierFilter:136] java.lang.NullPointerException
java.lang.NullPointerException
	at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:78)
	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 com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
	at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

FYR, the request being made is
http://localhost:8080/contentbrowser/ContentBrowser/ContentBrowser.nocache.js?browserId=other&minifierType=js&languageId=en_US&t=1302882380000

I tried to put the following line
com.liferay.portal.servlet.filters.minifier.MinifierFilter=false

into liferay-portal-6.0.6/tomcat-6.0.29/webapps/ROOT/WEB-INF/classes/portal-ext.properties to no avail.

Any idea how to turn js minification off? GWT js is already minified.

Thanks,

Paul
thumbnail
Amos Fong, modificado 13 Anos atrás.

RE: Minifier crashing

Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
Hi Paul,

Could you post the full stacktrace so we can see the cause of the error?

You may also need to set this property to disable minifier in stripfilter:

    #
    # The strip filter will attempt to cache inline minified CSS and JavaScript
    # content. Set this property configure the maximum pieces of cached content.
    # Set this property to 0 to disable caching of inline minified content.
    #
minifier.inline.content.cache.size=0


If that doesn't work, you can try disabling stripfilter as well:

    com.liferay.portal.servlet.filters.strip.StripFilter=false
Paul Schyska, modificado 13 Anos atrás.

RE: Minifier crashing

New Member Postagens: 10 Data de Entrada: 15/04/11 Postagens Recentes
Hi Amos,

thanks for your reply.

I gisted the full exception: https://gist.github.com/926099
The browser gets an HTTP OK 200, but empty content when doing the request I stated above.

Where would I put these settings you mention, also in portal-ext.properties?

Tahnks,

Paul
Paul Schyska, modificado 13 Anos atrás.

RE: Minifier crashing

New Member Postagens: 10 Data de Entrada: 15/04/11 Postagens Recentes
Amos Fong:
Hi Paul,

You may also need to set this property to disable minifier in stripfilter:


I set both properties you mentioned in webapps/ROOT/WEB-INF/classes/portal-ext.properties and restarted the server, but I'm getting the same errors.
Paul Schyska, modificado 13 Anos atrás.

RE: Minifier crashing

New Member Postagens: 10 Data de Entrada: 15/04/11 Postagens Recentes
BTW, I've just noticed something very strange:
If I copy the the file to another location, or change it's name, it's working!
http://localhost:8080/ContentBrowser-portlet/ContentBrowserPortlet/ContentBrowserPortlet.nocache.js?browserId=other&minifierType=js&languageId=en_US&t=1302882380000

and

http://localhost:8080/ContentBrowser-portlet/ContentBrowserPortlet/ContentBrowser.nocache.js?browserId=other&minifierType=js&languageId=en_US&t=1302882380000

both did work. Is there some string interpolation gone wrong here? Really puzzled.
Paul Schyska, modificado 13 Anos atrás.

RE: Minifier crashing

New Member Postagens: 10 Data de Entrada: 15/04/11 Postagens Recentes
I will upload a zip archive of the exploded war, in case someone wants to check it.
thumbnail
Amos Fong, modificado 13 Anos atrás.

RE: Minifier crashing (Resposta)

Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
Maybe you need to clear your caches? (Browser cache and tomcat temp/work folders)
Paul Schyska, modificado 13 Anos atrás.

RE: Minifier crashing

New Member Postagens: 10 Data de Entrada: 15/04/11 Postagens Recentes
I used different browser and curl, so there should be no cache. I removed temp and work, but it didn't work. I reinstalled portal tomcat bundle and copied webapp over, and now it works?! Probably some configuration I did earlier leading to this - I'm unable to pin it down.
Most important it works now emoticon . Thank you for your help.

Paul
thumbnail
Massimiliano Assante, modificado 11 Anos atrás.

RE: Minifier crashing

Junior Member Postagens: 53 Data de Entrada: 04/03/10 Postagens Recentes
had the same problem with a GWT widget too, it turned out the problem was in my .gwt.xml, the rename-to attribute value of <module> for some unknown reason must be lowercase, example <module rename-to='mywidgetname'>
thumbnail
Massimiliano Assante, modificado 11 Anos atrás.

RE: Minifier crashing

Junior Member Postagens: 53 Data de Entrada: 04/03/10 Postagens Recentes
Massimiliano Assante:
had the same problem with a GWT widget too, it turned out the problem was in my .gwt.xml, the rename-to attribute value of <module> for some unknown reason must be lowercase, example <module rename-to='mywidgetname'>


Just a quick update on this, it seems that also having the gwt-module name and the portlet class name the same would make the Minifier crashing.