Fórum

How to technically apply a fix to a resolved issue?

thumbnail
Erik Forsström, modificado 10 Anos atrás.

How to technically apply a fix to a resolved issue?

Junior Member Postagens: 59 Data de Entrada: 25/03/10 Postagens Recentes
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
thumbnail
Raja Nagendra Kumar, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue?

Expert Postagens: 484 Data de Entrada: 02/03/06 Postagens Recentes
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
thumbnail
Erik Forsström, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue?

Junior Member Postagens: 59 Data de Entrada: 25/03/10 Postagens Recentes
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.
thumbnail
Raja Nagendra Kumar, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue?

Expert Postagens: 484 Data de Entrada: 02/03/06 Postagens Recentes
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
thumbnail
Erik Forsström, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue?

Junior Member Postagens: 59 Data de Entrada: 25/03/10 Postagens Recentes
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!
thumbnail
James Falkner, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue?

Liferay Legend Postagens: 1399 Data de Entrada: 17/09/10 Postagens Recentes
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.
thumbnail
Erik Forsström, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue?

Junior Member Postagens: 59 Data de Entrada: 25/03/10 Postagens Recentes
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...
thumbnail
James Falkner, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue?

Liferay Legend Postagens: 1399 Data de Entrada: 17/09/10 Postagens Recentes
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.
thumbnail
Erik Forsström, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue?

Junior Member Postagens: 59 Data de Entrada: 25/03/10 Postagens Recentes
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.


07: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
07:23:24,963 ERROR [http-bio-8080-exec-10][IncludeTag:154] java.lang.NullPointerException
	at org.apache.jsp.html.portlet.document_005flibrary.add_005fbutton_jsp._jspService(add_005fbutton_jsp.java:1383)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

....
...

	at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86)
	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.
thumbnail
Erik Forsström, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue?

Junior Member Postagens: 59 Data de Entrada: 25/03/10 Postagens Recentes
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.
thumbnail
Erik Forsström, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue? (Resposta)

Junior Member Postagens: 59 Data de Entrada: 25/03/10 Postagens Recentes
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.
thumbnail
James Falkner, modificado 10 Anos atrás.

RE: How to technically apply a fix to a resolved issue?

Liferay Legend Postagens: 1399 Data de Entrada: 17/09/10 Postagens Recentes
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!