掲示板

Exception in PollerServlet

13年前 に fastbob fastbob によって更新されました。

Exception in PollerServlet

Regular Member 投稿: 221 参加年月日: 05/05/16 最新の投稿
I'm trying to port an ICEFaces and Hibernate-based portlet to LR 6.0.1 (and GA shortly). The portlet deploys and functions correctly under Tomcat now. However, once my portlet loads, I start getting the following exception from PollerServlet every few seconds:

17:23:39,118 ERROR [PollerServlet:81] java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.util.Map;
java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.util.Map;
	at com.liferay.portal.poller.PollerServlet.getContent(PollerServlet.java:97)
	at com.liferay.portal.poller.PollerServlet.service(PollerServlet.java:66)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
[...]

The code in question looks like:
		Map<string, object>[] pollerRequestChunks =
			(Map<string, object>[])JSONFactoryUtil.deserialize(
				pollerRequestString);
</string,></string,>

I suspect this is being caused by a duplicate jar file being loaded, but I have no idea which one. Any suggestions on how to solve this problem? Thanks.
13年前 に Pavel Andreevich Tihomirov によって更新されました。

RE: Exception in PollerServlet

New Member 投稿: 6 参加年月日: 09/08/17 最新の投稿
I have same problems.
Details: when user is not logged, this error is not exist.
13年前 に fastbob fastbob によって更新されました。

RE: Exception in PollerServlet

Regular Member 投稿: 221 参加年月日: 05/05/16 最新の投稿
Pavel,
Are you adding any additional portlets? What app server are you using? Thanks.
13年前 に Pavel Andreevich Tikhomirov によって更新されました。

RE: Exception in PollerServlet

New Member 投稿: 6 参加年月日: 09/08/17 最新の投稿
We are using Liferay 6 RC2 (database: mysql 5.0.77) + JBOSS AS. We added only several our developed portlets (Icefaces 1.8.2 gaP01 + hibernate 3.5.1).
13年前 に Pavel Andreevich Tikhomirov によって更新されました。

RE: Exception in PollerServlet

New Member 投稿: 6 参加年月日: 09/08/17 最新の投稿
We updated portal from Liferay 6 RC2 to Liferay 6 CE GA1, but the problem still occurs. Are there any ideas how to fix this problem?
thumbnail
13年前 に Hubert Vogten によって更新されました。

RE: Exception in PollerServlet

New Member 投稿: 11 参加年月日: 08/12/02 最新の投稿
We encountered the same problem. I created an issue in JIRA for this. See http://issues.liferay.com/browse/LPS-11469.

We looked into the issue and found that the problem is caused by a conflict between the prototype framework and Alloy. We patched two files in Liferay so solve this issue for now. This workaround is cirtainly not ideal. The prototype library is actually causing the problems and not the libraries used by Alloy. But we didn't know what the side effects would be of modifying the prototype library, therefore we choosed to modify the libraries used by Alloy.

The following files where changed:
portal-web/docroot/html/js/aui/json/json.js
portal-web/docroot/html/js/aui/json/json-stringify.js

I will describe the changes in these files. They have to applied to the minified and debug versions as well.


In json.js

line 365: we modified as follows:

        if (t === DATE) {
        	if (isObject(value) &amp;&amp; isFunction(value.toJSON)) {
        		value = value.toJSON(key);
        	} else {
        		value = _date(value);
        	}
    	}


line 464 we modified as follows:

   useNativeStringify : false,




We did a similar thing to json-stringify.js

line 142: we modified as follows:

        if (t === DATE) {
        	if (isObject(value) &amp;&amp; isFunction(value.toJSON)) {
        		value = value.toJSON(key);
        	} else {
        		value = _date(value);
        	}
    	}


line 241:
   useNativeStringify : false,
13年前 に Pavel Andreevich Tikhomirov によって更新されました。

RE: Exception in PollerServlet

New Member 投稿: 6 参加年月日: 09/08/17 最新の投稿
This solution does not work for liferay on jboss.
13年前 に Pavel Andreevich Tikhomirov によって更新されました。

RE: Exception in PollerServlet

New Member 投稿: 6 参加年月日: 09/08/17 最新の投稿
It is suspected that the problem is caused by the conflict portlet "Chat" and IceFaces-portlet.

How to disable Chat Portlet?
thumbnail
13年前 に Eric P Tiongson によって更新されました。

RE: Exception in PollerServlet

New Member 投稿: 3 参加年月日: 08/01/23 最新の投稿
Pavel Andreevich Tikhomirov:
It is suspected that the problem is caused by the conflict portlet "Chat" and IceFaces-portlet.

How to disable Chat Portlet?


Chat portlet is just a war, I undeployed ours using Glassfish's Admin Console. But within Liferay you should be unable to uninstall it under Control Panel --> (Server) Update Manager.

I can confirm though, I simply undeployed the chat portlet and the exceptions went away. I did not have to apply any patch.
thumbnail
13年前 に Ralph Soika によって更新されました。

RE: Exception in PollerServlet

Junior Member 投稿: 34 参加年月日: 08/10/28 最新の投稿
Hi,
I have the same issue with a RichFaces Portlet. The portlet works fine but when it starts the exception posted below is thrown. Here is a link to my portlet.war file so you can test this. I am using Liferay Portal Community Edition 6.0.3 CE


Ralph



13:05:43,440 ERROR [PollerServlet:79] java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.util.Map;
java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.util.Map;
	at com.liferay.portal.poller.PollerServlet.getContent(PollerServlet.java:95)
	at com.liferay.portal.poller.PollerServlet.service(PollerServlet.java:64)
	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:177)
	at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:81)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
	at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:179)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:241)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
	at com.liferay.portal.servlet.filters.threadlocal.ThreadLocalFilter.processFilter(ThreadLocalFilter.java:35)
	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
	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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	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:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:619)
13年前 に Pavel Andreevich Tikhomirov によって更新されました。

RE: Exception in PollerServlet

New Member 投稿: 6 参加年月日: 09/08/17 最新の投稿
In Liferay 6.0.4 exceptions still occur. As before uninstalling chat-portlet solves this problem.
thumbnail
13年前 に Balazs Zsoldos によって更新されました。

RE: Exception in PollerServlet

Junior Member 投稿: 41 参加年月日: 06/04/12 最新の投稿
Hi,

to solve this issue you must append to the end of prototype.js with the content of this fix file.
The linked fix is part of the this issue.

Regards,
Balazs
thumbnail
13年前 に Balazs Zsoldos によって更新されました。

RE: Exception in PollerServlet

Junior Member 投稿: 41 参加年月日: 06/04/12 最新の投稿
Hi Ralph,

in case of Richfaces please see this post where you can download a working Richfaces portlet with the appended prototype.js.

In case you need a simple fixed richfaces jar you can download it here.

Also I created a jira issue on jboss site: jira issue.

Regards,
Balazs
13年前 に fastbob fastbob によって更新されました。

RE: Exception in PollerServlet

Regular Member 投稿: 221 参加年月日: 05/05/16 最新の投稿
I just noticed tonight that http://issues.liferay.com/browse/LPS-11469 has been closed. While I appreciate Nate's thoughtful comments, I think he missed the point. I'll state my case here rather than in a closed JIRA issue in the hope it will be heard.

Nate makes the case that this is an issue with the Prototype library used by ICEFaces. That may be true, but those of us concerned with this issue are using ICEFaces and have no say over its implementation. Nor does Liferay, of course.

However, some patches have been posted in this thread that may fix the issue - maybe, maybe not. I have a feeling Nate may not have seen these proposed fixes, probably because they weren't associated with the issue. I hope he can reconsider.

If the issue is not reopened, what does it mean? Based on my limited understanding, rejecting this issue means Liferay no longer supports ICEFaces and RichFaces portlets because of the Prototype library. Is this really the intent?
thumbnail
13年前 に Nate Cavanaugh によって更新されました。

RE: Exception in PollerServlet

Junior Member 投稿: 94 参加年月日: 06/11/27 最新の投稿
Hi Bob,
Thanks for letting me know about this forum post.

I had not seen these proposed patches, and while I appreciate Hubert's proposed patch above, it's not a solution that we can deliver to everyone.

We're currently working with the ICEFaces team to see about what solutions could be provided, and thank you Balazs for including details on the RichFaces fix.

The intent of closing that specific ticket is not to drop support for ICEFaces or RichFaces, but rather to say that we're not able to fix it in the portal layer itself because the nature of the problem isn't in the portal layer, but rather in a deployed application.

When we hear word back from and get a fix from ICEFaces, we'll probably commit it to the other ticket linked to this one, since it's specifically in reference to issue with the application.

However, I did some quick hacking around and I do have a workaround that I believe will work (at least it works for the sample applications):
(function() {
		var iframe = document.createElement('iframe');

		iframe.style.display = 'none';
		document.body.appendChild(iframe);

		var frameDoc = frames[frames.length - 1].document;
		frameDoc.open();
		frameDoc.write(
		  "<script>var natives = ['String', 'Array', 'Object', 'Date', 'Function', 'RegExp', 'Boolean']; i = natives.length; while(i--){var nativeName = natives[i];var parentObj = parent[nativeName]; var windowObj = window[nativeName];if(parentObj.prototype.toJSON+'' != windowObj.prototype.toJSON+''){parentObj.prototype.toJSON = windowObj.prototype.toJSON;}}<\/script>"
		);
		frameDoc.close();
	})();
</code></pre><br /><br />If you add that script block to the bottom of your Liferay theme (into a script tag right above the closing of your body tag), it will fix the issue. There is one caveat, and that is if the ICEFaces application relies upon the toJSON method of the object behaving as defined by Prototype, then there&#39;s the possibility of breakage.<br />But what this code does is restore the toJSON methods to the browser defaults.<br /><br />This is just one possible work around that may work for you, but the root issue of the ICEFaces application being patched is the best long term solution.<br />If I hear anything definitive I&#39;ll make sure to keep you guys updated, and if some enterprising community member like Balazs wants to patch it, that will also probably help speed things along.<br /><br />Thanks Bob,</script>
13年前 に fastbob fastbob によって更新されました。

RE: Exception in PollerServlet

Regular Member 投稿: 221 参加年月日: 05/05/16 最新の投稿
Terrific, thanks Nate! I really appreciate you looking into this so quickly.

I understand the root cause is in ICEFaces and RichFaces, but sometimes including a workaround can really help those who come along later and haven't seen this posting. Do you think your workaround would be okay to include in the general release? I suppose an alternative would be to put this in the wiki as a warning for developers using ICEFaces/RichFaces, but that means such portlets aren't very portable (theme modification needed). Also, does this affect the Chat portlet since the exception goes away when Chat is disabled?

Since you're obviously a lot more familiar with the details, would you kindly create a JIRA issue so this doesn't get lost? Thanks.
13年前 に fastbob fastbob によって更新されました。

RE: Exception in PollerServlet

Regular Member 投稿: 221 参加年月日: 05/05/16 最新の投稿
I've asked that the workaround be added to Liferay so ICEFaces is supported. See LPS-12344
thumbnail
13年前 に Palani Venkat によって更新されました。

RE: Exception in PollerServlet

Junior Member 投稿: 32 参加年月日: 10/11/10 最新の投稿
Hi ,

I have a query on Database Exception handlinng. I need to implement this in production server(Enterprise Edition of Liferay).

At the time of using portal if the Database goes down then if we click on any tab, it displays blank page to the user

But instead of blank page i have to display any message like "Please contact Administrator.. " within the portal.

I have tried to catch using error page tag in tomcat-6.0.26\webapps\ROOT\WEB-INF\web.xml but its not working.

Could you please help me in this regard how to catch and display the error page.

Your help will be greatly aprreciated..

Regards,
Palanivel