Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
O U
Another Struts / Plugins - sdk Question
February 21, 2011 11:50 PM
Answer

O U

Rank: New Member

Posts: 13

Join Date: February 21, 2011

Recent Posts

I am using Liferay 6 and trying desperatly to create a struts portlet using the plugins SDK.

First try:

1<portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>


This is literrally impossible because this is part of the Liferay portal-impl.jar which is not meant to be included in any plugin.

Second try:

1<portlet-class>org.apache.portals.bridges.struts.StrutsPortlet</portlet-class>


Actually this should work but I get a "java.lang.ClassNotFoundException: org.apache.portals.bridges.struts.StrutsPortlet" exception.

It is actually quite weird because I include it in my build:

1
2##
3## Libraries
4##
5
6    required.portal.jars=commons-logging.jar,log4j.jar,[b]portals-bridges.jar[/b],util-bridges.jar,struts.jar,util-java.jar,util-taglib.jar


Does anyone have a clue about what I am doing wrong here ?

Thanks for your help !
Andrés Cerezo
RE: Another Struts / Plugins - sdk Question
February 22, 2011 2:31 AM
Answer

Andrés Cerezo

Rank: Junior Member

Posts: 92

Join Date: November 11, 2010

Recent Posts

I Had this error, and I follow the instrucciones of this link, perhaps it can help you. Look deployable=true
O U
RE: Another Struts / Plugins - sdk Question
February 23, 2011 1:55 AM
Answer

O U

Rank: New Member

Posts: 13

Join Date: February 21, 2011

Recent Posts

It is not working...

But I have to say, it is not that surprising. I mean, I do not get the same error as in this link.

I am more likely having a problem including the portal-bridge.jar.

Does anyone already succeded in doing a struts portlet in plugins-sdk.
If so, I'd really like to know how you managed this !

Thanks again !
Andrés Cerezo
RE: Another Struts / Plugins - sdk Question
February 23, 2011 2:47 AM
Answer

Andrés Cerezo

Rank: Junior Member

Posts: 92

Join Date: November 11, 2010

Recent Posts

Have you test the sample-struts-liferay-portlet portlet ? It's in the repository of liferay.
ankit yakkundi
RE: Another Struts / Plugins - sdk Question
February 23, 2011 3:08 AM
Answer

ankit yakkundi

Rank: Regular Member

Posts: 221

Join Date: March 4, 2010

Recent Posts

hi..
i am using liferay bundle 6 and plugin sdk 6.
i am also trying t5o create a struts portlet from plugin sdk.
is it the same as we create a jsp or any other portlet through sdk?? ie going till portlet folder of sdk and typing "create a "a".then going to the portlet folder then deploying it.

is it the way strut portlet is created???
what all files has to be modified,created for creating simple struts portlet,db struts portlet,etc.

any idea or suggestions are welcome..
thanks in advance..
O U
RE: Another Struts / Plugins - sdk Question
February 23, 2011 10:05 PM
Answer

O U

Rank: New Member

Posts: 13

Join Date: February 21, 2011

Recent Posts

Andrés Cerezo:
Have you test the sample-struts-liferay-portlet portlet ? It's in the repository of liferay.


Hi, thank you for your answer.
I do not have the time to try this portlet today I'll do it tomorrow for sure.

Anyway, I had a quick look on this portlet and it appears that the portlet class extends the com.liferay.portlet.StrutsPortlet.

And I already tried this and I couldn't deploy my portlet for Liferay does not allow the plugins to include the portal-impl.jar...

I'll try the portlet soon anyway, maybe there is some easy explanations in it, who knows ?
O U
RE: Another Struts / Plugins - sdk Question
February 26, 2011 10:01 PM
Answer

O U

Rank: New Member

Posts: 13

Join Date: February 21, 2011

Recent Posts

Hi all,

Actually I tried to deploy the sample-struts-liferay portlet on a liferay 6 but I got an error:

105:49:31,029 ERROR [PortletBagFactory:115] java.lang.NoClassDefFoundError: com/liferay/portlet/StrutsPortlet
2java.lang.NoClassDefFoundError: com/liferay/portlet/StrutsPortlet


I then tried to include the portal-impl in this portlet but I got another error when deploying :

 1Detected inclusion of portal-impl.jar in WEB-INF/lib.
 2
 3portal-impl.jar is designed with a large number of singleton classes which are
 4instantiated on the basis that they will exist alone in the application server.
 5
 6While compile time issues may be resolved, portlets cannot be made to work by
 7simply adding portal-impl.jar, because doing so violates the above assumption,
 8and the resulting problems will be extremely difficult to debug.
 9
10Please find a solution that does not require portal-impl.jar.


So, is there a solution here? Did you already managed to deploy this portlet on a liferay 6 ?
Deepjyoti Deepjyoti
RE: Another Struts / Plugins - sdk Question
August 23, 2011 10:37 PM
Answer

Deepjyoti Deepjyoti

Rank: Junior Member

Posts: 80

Join Date: November 1, 2010

Recent Posts

Hi,

Have you got any solution? If yes, plz share.
Rahul Jaiswal
RE: Another Struts / Plugins - sdk Question
November 11, 2011 1:43 AM
Answer

Rahul Jaiswal

Rank: New Member

Posts: 10

Join Date: July 6, 2011

Recent Posts

Hi all,

I got a resolution for this issue. You just need to create a XML file, same as your portlet name.
For example: If portlet name is my-struts-portlet then name of XML file will be my-struts-portlet.xml

Save this xml file on location CATALINA_HOME\conf\Catalina\localhost\
Now put the follwing content and save it.

<Context>
<Loader delegate="true" loaderClass="com.liferay.support.tomcat.loader.PortalClassLoader"/>
</Context>

Don't forget to restart your server...
Deploy your portlet, now it will not throw error StrutsPortlet not found.