Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Paul Schyska
Minifier crashing
April 15, 2011 8:53 AM
Answer

Paul Schyska

Rank: New Member

Posts: 10

Join Date: April 15, 2011

Recent Posts

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:
 1
 215:47:06,694 ERROR [MinifierFilter:136] java.lang.NullPointerException
 3java.lang.NullPointerException
 4    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:78)
 5    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 6    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 7    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 8    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196)
 9    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126)
10    at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53)
11    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
Amos Fong
RE: Minifier crashing
April 18, 2011 2:19 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1844

Join Date: October 7, 2008

Recent Posts

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:
1
2    #
3    # The strip filter will attempt to cache inline minified CSS and JavaScript
4    # content. Set this property configure the maximum pieces of cached content.
5    # Set this property to 0 to disable caching of inline minified content.
6    #
7minifier.inline.content.cache.size=0


If that doesn't work, you can try disabling stripfilter as well:
1
2    com.liferay.portal.servlet.filters.strip.StripFilter=false
Paul Schyska
RE: Minifier crashing
April 18, 2011 1:35 PM
Answer

Paul Schyska

Rank: New Member

Posts: 10

Join Date: April 15, 2011

Recent Posts

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
RE: Minifier crashing
April 18, 2011 1:42 PM
Answer

Paul Schyska

Rank: New Member

Posts: 10

Join Date: April 15, 2011

Recent Posts

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
RE: Minifier crashing
April 18, 2011 1:47 PM
Answer

Paul Schyska

Rank: New Member

Posts: 10

Join Date: April 15, 2011

Recent Posts

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
RE: Minifier crashing
April 18, 2011 1:57 PM
Answer

Paul Schyska

Rank: New Member

Posts: 10

Join Date: April 15, 2011

Recent Posts

I will upload a zip archive of the exploded war, in case someone wants to check it.
Attachments: ContentBrowser-portlet.zip (13,826.5k)
Amos Fong
RE: Minifier crashing
April 18, 2011 9:35 PM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1844

Join Date: October 7, 2008

Recent Posts

Maybe you need to clear your caches? (Browser cache and tomcat temp/work folders)
Paul Schyska
RE: Minifier crashing
April 18, 2011 11:54 PM
Answer

Paul Schyska

Rank: New Member

Posts: 10

Join Date: April 15, 2011

Recent Posts

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
Massimiliano Assante
RE: Minifier crashing
November 6, 2012 7:21 AM
Answer

Massimiliano Assante

Rank: Junior Member

Posts: 47

Join Date: March 4, 2010

Recent Posts

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'>
Massimiliano Assante
RE: Minifier crashing
December 24, 2012 3:05 AM
Answer

Massimiliano Assante

Rank: Junior Member

Posts: 47

Join Date: March 4, 2010

Recent Posts

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.