Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Erik Forsström
How to technically apply a fix to a resolved issue?
May 22, 2013 11:49 PM
Answer

Erik Forsström

Rank: Junior Member

Posts: 59

Join Date: March 25, 2010

Recent Posts

We are setting up a sharded Liferay portal production environment using the Liferay 6.1.1 CE.

We are currently experiencing this exact issue:
http://issues.liferay.com/browse/LPS-27449?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel

According to the ticket, this issue is resolved for 6.0.X EE, 6.1.X EE, 6.2.0 CE M2, but not for 6.1.X CE.

Is there any practical way for me to apply the created fix to our existing environment somehow? Could someone give me a general description of the steps required if it is at all possible?

Thank you for any assistance.
Regards,
Erik
Raja Nagendra Kumar
RE: How to technically apply a fix to a resolved issue?
May 23, 2013 1:05 AM
Answer

Raja Nagendra Kumar

Rank: Expert

Posts: 484

Join Date: March 1, 2006

Recent Posts

Have you read this

http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/patching-liferay

It applies to Liferay EE versions.

Regards,
Raja Nagendra Kumar
www.tejasoft.com
-Java Code Quality Engineering
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
May 23, 2013 1:08 AM
Answer

Erik Forsström

Rank: Junior Member

Posts: 59

Join Date: March 25, 2010

Recent Posts

Unfortunately we are using the Community Edition so it looks like I won't be able to use the patching tool... if I understand this correctly.
Raja Nagendra Kumar
RE: How to technically apply a fix to a resolved issue?
May 23, 2013 1:16 AM
Answer

Raja Nagendra Kumar

Rank: Expert

Posts: 484

Join Date: March 1, 2006

Recent Posts

Can you try ext approach.. this is applicable to CE too

http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/creating-an-ext-plug-4

Regards,
Nagendra
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
May 23, 2013 1:20 AM
Answer

Erik Forsström

Rank: Junior Member

Posts: 59

Join Date: March 25, 2010

Recent Posts

That is most likely the way I have to take.

Now I just have to find out what to actually fix...
Thank you for your help!
James Falkner
RE: How to technically apply a fix to a resolved issue?
May 23, 2013 6:46 AM
Answer

James Falkner

Community Moderator

Rank: Liferay Legend

Posts: 1406

Join Date: September 17, 2010

Recent Posts

Erik Forsström:
That is most likely the way I have to take.

Now I just have to find out what to actually fix...
Thank you for your help!


This looks like a relatively simple fix: there were two commits for this bug (look for the two labeled with LPS-27449), which you would have to apply in your ext plugin in that particular file.
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
May 23, 2013 11:27 PM
Answer

Erik Forsström

Rank: Junior Member

Posts: 59

Join Date: March 25, 2010

Recent Posts

Thank you very much for your answer.

However I have not been able to resolve the issue. I am still getting the same error messages and the add-button is not showing.
These are the steps I have taken so far:

1) I created an ext-plugin
2) I added the file docroot/WEB-INF/ext-impl/src/com/liferay/portal/dao/shard/advice/ShardIterativelyAdvice.java
3) I added the contents of https://raw.github.com/liferay/liferay-portal/154a48ca6a81bd15b7842626d0698255d0d8d977/portal-impl/src/com/liferay/portal/dao/shard/advice/ShardIterativelyAdvice.java to the file. This is the version where the relevant line is in the finally block
4) I added the aopalliance.jar from my development Liferay-environment to the build path to get rid of the Eclipse import errors concerning the org.aopalliance -packages
5) I deployed via the Liferay IDE the ext-plugin to my local test environment. This process also created the war-file.
6) I put the created war-file to the production environments deploy-directory
7) I restarted the production server
8) I received no error messages and the ext-plugin was deployed ok

This however didn't change anything. It's too bad I have actually no real way of knowing whether the portal is actually using the code from the ext-plugin...
James Falkner
RE: How to technically apply a fix to a resolved issue?
May 24, 2013 8:20 AM
Answer

James Falkner

Community Moderator

Rank: Liferay Legend

Posts: 1406

Join Date: September 17, 2010

Recent Posts

Erik Forsström:
Thank you very much for your answer.

However I have not been able to resolve the issue. I am still getting the same error messages and the add-button is not showing.
These are the steps I have taken so far:

1) I created an ext-plugin
2) I added the file docroot/WEB-INF/ext-impl/src/com/liferay/portal/dao/shard/advice/ShardIterativelyAdvice.java
3) I added the contents of https://raw.github.com/liferay/liferay-portal/154a48ca6a81bd15b7842626d0698255d0d8d977/portal-impl/src/com/liferay/portal/dao/shard/advice/ShardIterativelyAdvice.java to the file. This is the version where the relevant line is in the finally block
4) I added the aopalliance.jar from my development Liferay-environment to the build path to get rid of the Eclipse import errors concerning the org.aopalliance -packages
5) I deployed via the Liferay IDE the ext-plugin to my local test environment. This process also created the war-file.
6) I put the created war-file to the production environments deploy-directory
7) I restarted the production server
8) I received no error messages and the ext-plugin was deployed ok

This however didn't change anything. It's too bad I have actually no real way of knowing whether the portal is actually using the code from the ext-plugin...



The process you followed sounds correct to me.

Just stick a System.out.println in that finally block to quickly see if the update took effect. It should show up in the log file.
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
May 27, 2013 12:26 AM
Answer

Erik Forsström

Rank: Junior Member

Posts: 59

Join Date: March 25, 2010

Recent Posts

I added a bunch of System.out.println -lines to the ShardIterativelyAdvice.java and sure enough they show up when I START UP the portal.
Once for every three shards I have set up.

However while accessing the document library there is only the following error message. The println-outputs do not show up here.
 1
 2
 307:23:24,961 ERROR [http-bio-8080-exec-10][IncludeTag:253] Current URL /group/control_panel/manage?p_p_id=20&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&doAsGroupId=10794&refererPlid=10797 generates exception: null
 407:23:24,963 ERROR [http-bio-8080-exec-10][IncludeTag:154] java.lang.NullPointerException
 5    at org.apache.jsp.html.portlet.document_005flibrary.add_005fbutton_jsp._jspService(add_005fbutton_jsp.java:1383)
 6    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 7    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 8
 9....
10...
11
12    at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86)
13    at org.apache.jsp.html.portlet.document_005flibrary.view_jsp._jspx_meth_liferay_002dutil_005finclude_005f2(view_jsp.java:1303)


I'll keep trying to find the solution, but at least to me it looks like, that the above mentioned commits don't actually fix the problem.
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
May 27, 2013 12:40 AM
Answer

Erik Forsström

Rank: Junior Member

Posts: 59

Join Date: March 25, 2010

Recent Posts

Hold on!

Actually the fix might have worked... in a way.
I emptied all the three shards and created them over from scratch.

This time it _looks_ like the fix actually worked. When the shards are created by the tomcat which already has the ext-plugin installed, the problem seemed to disappear. So that's good. Now I still gotta try to work this in with the production environment.
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
May 27, 2013 4:32 AM
Answer

Erik Forsström

Rank: Junior Member

Posts: 59

Join Date: March 25, 2010

Recent Posts

I can now confirm, that the solution is to first apply the ext-plugin where the ShardIterativelyAdvice.java has been upgraded and only after that you should create the shards for the portal. Only then the tables are created correctly and the document library works as intended.

I successfully applied the ext-plugin war to the production environment and then cleared ALL shards and recreated them with the create-sharded-sql -scripts. Then after restarting the portal everything worked as intended.
James Falkner
RE: How to technically apply a fix to a resolved issue?
May 28, 2013 6:54 AM
Answer

James Falkner

Community Moderator

Rank: Liferay Legend

Posts: 1406

Join Date: September 17, 2010

Recent Posts

Erik Forsström:
I can now confirm, that the solution is to first apply the ext-plugin where the ShardIterativelyAdvice.java has been upgraded and only after that you should create the shards for the portal. Only then the tables are created correctly and the document library works as intended.

I successfully applied the ext-plugin war to the production environment and then cleared ALL shards and recreated them with the create-sharded-sql -scripts. Then after restarting the portal everything worked as intended.


Great, and thanks for the follow-up tip about re-creating the shards!