Foros de discusión

IPC with Netbeans & Portlet Eventing StoryBoard

zay zay zay, modificado hace 15 años.

IPC with Netbeans & Portlet Eventing StoryBoard

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
Hi,

I used Netbeans 6.1 and "Portlet Eventing StoryBoard" to communicate two Portlets :

- Portlet 1 : Publish an Event
The Type of Event is com.test.Employee (a class Serializable)

- Portlet 2 : Process this Event to get "Employee" info
(you can see this link of Eventing StoryBoard)

I deployed these 2 portlets on Liferay Portal 5.1.1, I got this error :

java.lang.ClassCastException: com.test.Employee cannot be cast to com.test.Employee


I have tested the same sample with Open Portal Portlet Container and it worked fine !!

Please do you have any idea about this issue?

Thanks
thumbnail
sriram krishnan, modificado hace 15 años.

RE: IPC with Netbeans & Portlet Eventing StoryBoard

New Member Mensajes: 11 Fecha de incorporación: 20/05/08 Mensajes recientes
Hi,
Please add the follwing to portal-ext.properties under webapps\ROOT\WEB-INF\classes so that liferay will invoke sun's portlet container implementation.

portlet.container.impl=sun
OSPC already used sun's implemetaion may be thats the reason you don't see the exception there.
Please try this and let us know.

Thanks,
Sriram
zay zay zay, modificado hace 15 años.

RE: IPC with Netbeans & Portlet Eventing StoryBoard

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
Thank for your reply,

I don't find neither "webapps\ROOT\WEB-INF\classes" nor "portal-ext.properties"

I use Liferay 5.1.1 Bundled with Glassfish 2 for Linux.

Where can I find this file in my case?

Thanks.
thumbnail
sriram krishnan, modificado hace 15 años.

Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portlet Eventi

New Member Mensajes: 11 Fecha de incorporación: 20/05/08 Mensajes recientes
I thought you are using tomcat-liferay.If you are using
glassfish-liferay then you'll have to create a portal-ext.properties
file under
glassfish/domains/domain1/applications/j2ee-modules/liferay-portal/WEB-INF/classes/

and then add portlet.container.impl=sun

Thanks,
Sriram


.
zay zay zay, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
Hi,

I created the file "portal-ext.properties" under "glassfish/domains/domain1/applications/j2ee-modules/liferay-portal/WEB-INF/classes/ "
then I added the line "portlet.container.impl=sun" to "portal-ext.properties" , I started the server, I deployed the 2 portlets, but I got the same Error :

java.lang.ClassCastException: com.test.Employee cannot be cast to com.test.Employee


!!!
I don't know what to do!! It's urgent

Thanks
thumbnail
Deepak Gothe, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

Junior Member Mensajes: 44 Fecha de incorporación: 19/05/08 Mensajes recientes
Are these two portlets two different webapplications. If yes..Make sure that the Employee class is present in both webapps.

Regards,
Deepak
zay zay zay, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
Yes the two portlets are two different webapplications and the Employee class is present in both webapps.

I think that it isn't a content problem since 2 portlets work fine with Open Portal Portlet Container, I think that it's a problem of Liferay Portal config.

Thank you for your reply.
thumbnail
Manish Kumar Gupta, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

Liferay Master Mensajes: 535 Fecha de incorporación: 16/05/08 Mensajes recientes
I suspect that your install is not using Sun's PC.

Can you please open web.xml of your deployed portlet (glassfish\domains\domain1\applications\j2ee-modules\<your-portlet>\WEB-INF\web.xml) to verify whether it has entry for "PortletAppEngineFilter"?
zay zay zay, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
Hi,
Actually it hasn't an entry for "PortletAppEngineFilter" !

Here is the content of "web.xml" of the Portlet publishing event (EmployeeInfo) :


<!--?xml version="1.0" encoding="UTF-8"?-->

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
	<display-name>EmployeeInfo</display-name>
	<listener>
		<listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
	</listener>
	<servlet>
		<servlet-name>EmployeeInfo</servlet-name>
		<servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
		<init-param>
			<param-name>portlet-class</param-name>
			<param-value>com.test.EmployeeInfo</param-value>
		</init-param>
		<load-on-startup>0</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>EmployeeInfo</servlet-name>
		<url-pattern>/EmployeeInfo/*</url-pattern>
	</servlet-mapping>
	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
	<jsp-config>
		<taglib>
			<taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://liferay.com/tld/portlet</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-portlet-ext.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://liferay.com/tld/security</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-security.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://liferay.com/tld/theme</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-theme.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://liferay.com/tld/ui</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-ui.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://liferay.com/tld/util</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-util.tld</taglib-location>
		</taglib>
	</jsp-config>
</web-app>


Here is the content of "web.xml" of the Portlet processing event (Health) :


<!--?xml version="1.0" encoding="UTF-8"?-->

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
	<display-name>Health</display-name>
	<listener>
		<listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
	</listener>
	<servlet>
		<servlet-name>Health</servlet-name>
		<servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
		<init-param>
			<param-name>portlet-class</param-name>
			<param-value>com.test.Health</param-value>
		</init-param>
		<load-on-startup>0</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>Health</servlet-name>
		<url-pattern>/Health/*</url-pattern>
	</servlet-mapping>
	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
	<jsp-config>
		<taglib>
			<taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://liferay.com/tld/portlet</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-portlet-ext.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://liferay.com/tld/security</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-security.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://liferay.com/tld/theme</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-theme.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://liferay.com/tld/ui</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-ui.tld</taglib-location>
		</taglib>
		<taglib>
			<taglib-uri>http://liferay.com/tld/util</taglib-uri>
			<taglib-location>/WEB-INF/tld/liferay-util.tld</taglib-location>
		</taglib>
	</jsp-config>
</web-app>


What can I do in this case?
Thanks
thumbnail
Manish Kumar Gupta, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

Liferay Master Mensajes: 535 Fecha de incorporación: 16/05/08 Mensajes recientes
This means, either your installation is still missing portlet.container.impl=sun entry or you haven't redeployed your portlet after adding this entry in portal-ext.properties.

When you deploy a portlet with Sun PC, you will get message like PSPL_PAECSPPAI0012 : Portlet Initialized:

try undeploy and deploy again and see whether you are getting this message.
zay zay zay, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
No I don't have this message !!!

So how can I resolve missing installation?
thumbnail
Manish Kumar Gupta, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

Liferay Master Mensajes: 535 Fecha de incorporación: 16/05/08 Mensajes recientes
Ok. Please follow these steps :

1. Undeploy your portlets.
2. Stop glassfish.
3. Move portal-ext.properties (containing portlet.container.impl=sun entry ) to glassfish\domains\domain1\lib\classes.
4. Start glassfish.
5. Deploy your portlets
6. See whether you are getting the message that I mentioned in my last post.
zay zay zay, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
Hi Thank for your reply,

Also After following these steps, I don't have the message !

Thanks
zay zay zay, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
I followed the steps indicated in the "Liferay Portal 4 - Installation Guide" section "Installing a Liferay Bundle"

Is there any file missing in my installation?
thumbnail
Manish Kumar Gupta, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

Liferay Master Mensajes: 535 Fecha de incorporación: 16/05/08 Mensajes recientes
Let's go one more step back...are you able to see message "PSPL_PCCSPCPCI0003 : Starting PortletContainer" in the server.log??
zay zay zay, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
Hi,

when I started glassfish, I got this message :

PSPL_PCCSPCPCI0003 : Starting PortletContainer 2.0_01
Starting Liferay Portal 5.1.1 (Calvin / Build 5101 / August 11, 2008)
zay zay zay, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
when I started glassfish, I got this message :

PSPL_PCCSPCPCI0003 : Starting PortletContainer 2.0_01
Starting Liferay Portal 5.1.1 (Calvin / Build 5101 / August 11, 2008)

So what is the problem?
zay zay zay, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
There is no solution?

I can't waste more time!!!

Shall I work with Open Portal Portlet Container?

Thank you for your reply.
thumbnail
Manish Kumar Gupta, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

Liferay Master Mensajes: 535 Fecha de incorporación: 16/05/08 Mensajes recientes
There may be some problem with switching of portlet container in 5.1.1 release as this was the first release after Sun's PC integration with LR. Is it possible for you download trunk/5.2 branch and build it locally? I am suggesting this because there is no LR 5.1.2 release for Glassfish. If it is not feasible for you, you can try 5.1.2 tomcat bundle.
zay zay zay, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 16 Fecha de incorporación: 25/11/08 Mensajes recientes
Thank you
A L, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 4 Fecha de incorporación: 14/04/09 Mensajes recientes
Any new information on how this can be resolved would be helpful.

I get java.lang.ClassCastException during run when its processing the event in the target portlet. I get the error when typecasting the object retrieved from the javax.portlet.Event's getValue() method. The class exists in my target portlet's source packages, I have also validated that it exists (as .class) in the Target Portlet's jar file.

I am using liferay 5.2.2, netbeans 6.1 and portal pack 3.0

Thanks for any help.
thumbnail
Manish Kumar Gupta, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

Liferay Master Mensajes: 535 Fecha de incorporación: 16/05/08 Mensajes recientes
a quick solution is to move your event payload class in the server/global classpath and remove from your webapps.
A L, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 4 Fecha de incorporación: 14/04/09 Mensajes recientes
Manish - I yanked the payload class out of both portlets. And added a jar file with the package+payload class to tomcat/common/lib. Didn't work.
I tried moving the jar file to tomcat/common/lib/ext and restarted tomcat, no dice. (Wasnt sure where the payload jar belonged).
No change in error message.

What should I look for next?
A L, modificado hace 15 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

New Member Mensajes: 4 Fecha de incorporación: 14/04/09 Mensajes recientes
I've 'solved' this. The work around may or may not work for you.
I've created a ArrayList of strings that I am able to extract in my target portlet.
Hope this is helpful to others.
thumbnail
path finder liferay, modificado hace 14 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

Expert Mensajes: 262 Fecha de incorporación: 18/09/09 Mensajes recientes
A L:
I've 'solved' this. The work around may or may not work for you.
I've created a ArrayList of strings that I am able to extract in my target portlet.
Hope this is helpful to others.



Can u please elaborate what u have done.... still struggling to find solution...
thumbnail
path finder liferay, modificado hace 14 años.

RE: Re: [Liferay Forums][3. Development] RE: IPC with Netbeans & Portle

Expert Mensajes: 262 Fecha de incorporación: 18/09/09 Mensajes recientes
solved see this post for answer
Alexander Pornel, modificado hace 13 años.

RE: IPC with Netbeans & Portlet Eventing StoryBoard

New Member Mensaje: 1 Fecha de incorporación: 24/06/10 Mensajes recientes
Hi,

I have a problem. I followed everything in this site http://contrib.netbeans.org/portalpack/tutorials/eventing/EventingStoryBoardTutorial.html, with some changes

-Liferay Portal Server 5.1x/5.2x
-GlassFish2v

The problem is, after i press save button, nothing happens. Pls give advice as soon as possible.

Thank you