Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
sudhakara SG
StrutsPortlet Issues
22. Dezember 2011 05:08
Antwort

sudhakara SG

Rang: New Member

Nachrichten: 1

Eintrittsdatum: 9. November 2011

Neue Beiträge

Hi,

Can anybody explain how to create StrutsPortlet as i am new to Liferay.I attached my sample StrutsPortlet application war file.I am getting error as

[HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for First-Struts1-portlet
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for First-Struts1-portlet
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:105)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:183)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletContextListener.java:99)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:41)
at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:827)
at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:367)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassCastException: com.test.StrutsFormPortlet1 cannot be cast to javax.portlet.Portlet
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:126)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:469)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:256)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:102)
... 35 more

If you done any StrutsPortlet,please attach the Zip file of the application.Plz do the needful
Anhänge: First-Struts1-portlet.war (16,2k)
Subhasis Roy
RE: StrutsPortlet Issues
8. August 2012 23:51
Antwort

Subhasis Roy

Rang: Regular Member

Nachrichten: 234

Eintrittsdatum: 19. Januar 2012

Neue Beiträge

put jsr286dispatcher entry in your web.xml and portlet.xml file

web.xml entry:

<servlet>
<servlet-name>struts2</servlet-name>
<servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
<init-param>
<param-name>portlet-class</param-name>
<param-value>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>struts2</servlet-name>
<url-pattern>/struts2/*</url-pattern>
</servlet-mapping>

portlet.xml entry:

<display-name>TestPortlet</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
<init-param>
<name>defaultViewAction</name>
<value>init</value>
</init-param>
<expiration-cache>0</expiration-cache>

And check whether you have all struts related jar files in your portlet or not

struts2-core-2.2.3.jar , struts2-portlet-plugin-2.3.1.1.jar , xwork-core-2.2.3.jar, ognl-3.0.1.jar, freemarker-2.3.19.jar, javassist.jar