Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Erik Forsström
How to technically apply a fix to a resolved issue?
22 de Maio de 2013 23:49
Resposta

Erik Forsström

Ranking: Junior Member

Mensagens: 59

Data de entrada: 25 de Março de 2010

Mensagens 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
Raja Nagendra Kumar
RE: How to technically apply a fix to a resolved issue?
23 de Maio de 2013 01:05
Resposta

Raja Nagendra Kumar

Ranking: Expert

Mensagens: 484

Data de entrada: 1 de Março de 2006

Mensagens 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
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
23 de Maio de 2013 01:08
Resposta

Erik Forsström

Ranking: Junior Member

Mensagens: 59

Data de entrada: 25 de Março de 2010

Mensagens 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.
Raja Nagendra Kumar
RE: How to technically apply a fix to a resolved issue?
23 de Maio de 2013 01:16
Resposta

Raja Nagendra Kumar

Ranking: Expert

Mensagens: 484

Data de entrada: 1 de Março de 2006

Mensagens 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
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
23 de Maio de 2013 01:20
Resposta

Erik Forsström

Ranking: Junior Member

Mensagens: 59

Data de entrada: 25 de Março de 2010

Mensagens 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!
James Falkner
RE: How to technically apply a fix to a resolved issue?
23 de Maio de 2013 06:46
Resposta

James Falkner

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1231

Data de entrada: 17 de Setembro de 2010

Mensagens 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.
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
23 de Maio de 2013 23:27
Resposta

Erik Forsström

Ranking: Junior Member

Mensagens: 59

Data de entrada: 25 de Março de 2010

Mensagens 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...
James Falkner
RE: How to technically apply a fix to a resolved issue?
24 de Maio de 2013 08:20
Resposta

James Falkner

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1231

Data de entrada: 17 de Setembro de 2010

Mensagens 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.
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
27 de Maio de 2013 00:26
Resposta

Erik Forsström

Ranking: Junior Member

Mensagens: 59

Data de entrada: 25 de Março de 2010

Mensagens 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.
 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?
27 de Maio de 2013 00:40
Resposta

Erik Forsström

Ranking: Junior Member

Mensagens: 59

Data de entrada: 25 de Março de 2010

Mensagens 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.
Erik Forsström
RE: How to technically apply a fix to a resolved issue?
27 de Maio de 2013 04:32
Resposta

Erik Forsström

Ranking: Junior Member

Mensagens: 59

Data de entrada: 25 de Março de 2010

Mensagens 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.
James Falkner
RE: How to technically apply a fix to a resolved issue?
28 de Maio de 2013 06:54
Resposta

James Falkner

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1231

Data de entrada: 17 de Setembro de 2010

Mensagens 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!