Showing posts with label liferay. Show all posts
Showing posts with label liferay. Show all posts

Thursday, February 5, 2015

Liferay 6.2 - Post-Migration issues

Liferay 6.2 - issues, which may occur after Liferay migration (from 5.x, 6.x to 6.2)


1. Document Library links issue.

After migration to 6.2 download links to DL documents may be broken (even if those document are displayed in DL portlet, and there are appropriate files in data/document_library folder).

This issue and it's fix described here: DL broken link issue


2. Dockbar issue - Add, Edit buttons do not work.

Description:

For some communities in Liferay 6.2  'Add', 'Edit' buttons in dockbar may display empty content. So, it's not possible to add portlet on page or modify page settings.

There can be also such error in browser:

Chrome: Uncaught TypeError: Cannot read property 'ancestor' of null
Firefox: TypeError: a.one(...) is null

There is also similar LPS issue: https://issues.liferay.com/browse/LPS-38040

Fix:

At first sight, it seems to be a JS error.
But the issue may be in DB corrupted data. 

1) Check groupId for current community,  and get creatorUserId for that group_; 
2) Check if such user exists;
3) If there is no such user, change creatorUserId for that group_ for existing user (e.g. admin);
4) Clean DB cache;
5) Check if issue resolved;
6) Check if there are other communities with corrupted data:

SELECT creatorUserId, groupId, friendlyURL from group_ WHERE creatorUserId not in (SELECT userId from user_);
7) If there are such records - change creatorUserId for them also.


Wednesday, February 4, 2015

Liferay 6.2 - Unable to download DL documents


Liferay 6.2 - Unable to download DL documents

________________________________________________________________________________
Description:

Documents are available in DL, and there are appropriate files in /data/document_library folder, but download link is broken. When accessing link, like:

http://domain.com/documents/279794/304265/doc.xml/29d62ab3-c587-4a4e-9346-f9c9388430a2

such error is shown:


However, when accessing the same document using host:port URL, like:

http://host:port/documents/279794/304265/doc.xml/29d62ab3-c587-4a4e-9346-f9c9388430a2

files are downloaded successfully.


________________________________________________________________________________
Fix:

Patch com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter class:

(line 290):
/*forwardURL.append(_PRIVATE_GROUP_SERVLET_MAPPING);*/
/*patch:*/
if (isDocumentFriendlyURL(
        request, group.getGroupId(), friendlyURL)) {

    processFilter(
            VirtualHostFilter.class, request, response,
            filterChain);

    return;
}
else {
    forwardURL.append(_PRIVATE_GROUP_SERVLET_MAPPING);
}
/*patch:*/


Compile it, and place into /ROOT/WEB-INF/classes directory. Restart Liferay.
________________________________________________________________________________
More info:

1. Jira issue
2. Liferay form thread

Wednesday, January 28, 2015

Liferay 6.2 Error: Current URL null generates exception: java.lang.IllegalStateException: Page needs a session and none is available

Liferay 6.2 error:

Current URL null generates exception: java.lang.IllegalStateException: Page needs a session and none is available

Fix:

Add to portal-setup-wizard.properties:

layout.parallel.render.timeout=30000

More info:

https://www.liferay.com/community/forums/-/message_boards/message/34977579

Tuesday, January 27, 2015

Liferay 6.2 Error: java.lang.ClassNotFoundException: org.apache.jsp.html.portlet.dockbar.view_jsp


Liferay 6.2 Error:

java.lang.ClassNotFoundException: org.apache.jsp.html.portlet.dockbar.view_jsp

Fix:

1. Check /webapps/ROOT/html/portlet/dockbar/view_user_account.jspf file.

2. Check  if such line exists at the end:

<%@ include file="/html/portlet/dockbar/view_user_account.portal.jspf" %>

3. If so - create empty view_user_account.portal.jspf file.

More info:
https://www.liferay.com/community/forums/-/message_boards/message/26264574

Sunday, February 9, 2014

Liferay-Konakart Integration

Liferay-Konakart Integration


This is post about integration Konakart shop functionality with Liferay.

Konakart version: 7.1.1.1
Liferay version: 6.1.1


I. Steps for base Installation:


1. Download clean Konakart ( http://www.konakart.com ) and Liferay ( https://www.liferay.com/ )

2. Install Konakart (into Konakart folder).

3. Go to the Konakart/custom folder.

4. Genarate KonakartStore and KonakartAdmin portlets with the following ant commands:

bin/kkant make_admin_liferay_portlet_war -DLR611=true -DnoAXIS=true

bin/kkant make_liferay_portlet_war -DLR611=true -DnoAXIS=true

(-DLR option specifies Liferay's version; -DnoAXIS option is to disable AXIS web services)

5. The konakart.war and konakartadmin.war files will be generated in Konakart/custom/portlet_war and Konakart/custom/admin_portlet_war folders.

6. Unzip liferay, and copy generated war files into liferay/deploy directory.

7. Startup Liferay, and konakart portlet will be deployed.



II. PayPal module integration:


1. Go to Konakart Administration portlet. Select Modules -> Payment -> Paypal.
2. Fill the PayPal configuration options:

Sort order of display: 1
PayPal Payment Zone: --none--
Callback username: admin@konakart.com
Callback Password: princess
Callback URL: http://[YOUR_DOMAIN]/konakart/PayPalCallback.action
Return URL: http://[YOUR_DOMAIN]/konakart/CheckoutFinished.action
Cancel URL: http://[YOUR_DOMAIN]/konakart/CatalogCheckoutExternalPaymentErrorPage.action
Test Mode: true
PayPal Id: [YOUR_EMAIL]
Transaction Currency: USD

3. Go to KonaKart Storefront portet. Try to buy product.

Possible issue:

Error 'There has been an unexpected problem Unfortunately we have encountered a malfunction.' when you try to pay with PayPal in KonaKart Storefront portet.

Links with the same issue:

http://www.konakart.com/forum/index.php/topic,1911.0.html
http://www.konakart.com/forum/index.php/topic,1910.msg7369.html
https://www.liferay.com/community/forums/-/message_boards/message/33936472

How To Fix:

1. Check your tomcat logs, if you have 'com.konakart.app.KKException: The String parameter called hostPort must be given a value. It cannot be set to null or be left empty.' exception.

If so, go to Konakart/custom/modules/src/com/konakart/bl/modules/payment directory, open PaymentMgr.java class, and add the following code at the beginning of getPaymentDetails method:

if (hostAndPort == null || hostAndPort.length() == 0) {
    hostAndPort = "YOUR DOMAIN HERE...";
}

Compile classes with ant 'compile_modules' command, and replace this class inside konakart/WEB-INF/lib/konakart.jar file.

This code will avoid the above exception.

2. Add the following code to your konakart/WEB-INF/web.xml file:


<filter>
<filter-name>struts2</filter-name>
<filterclass>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>



3. Change konakart/WEB-INF/jsp/CatalogCheckoutExternalPaymentBody.jsp file - replace
document.forms[0].submit(); code with document.getElementById('konakartPaymentForm').submit(); and specify the id for the form below. This will submit the paypal form to the PayPal instead of first form on the portal page.

4. Modify konakart/WEB-INF/classes/konakart-logging.properties file to enable DEBUG:



# Modules

log4j.logger.com.konakart.bl.modules.payment = DEBUG

log4j.logger.com.konakart.bl.modules.ordertotal = DEBUG

#log4j.logger.com.konakart.bl.modules.shipping = DEBUG

# Gateways
log4j.logger.com.konakart.actions.gateways = DEBUG
log4j.logger.com.konakart.actions.ipn = DEBUG

5. Restart Liferay, and try it again :)




Friday, January 17, 2014

Liferay Migration form 5.2.3 to 6.2


Liferay Migration from 5.2.3. to 6.2




Step 1. Liferay Migration to 6.0.6


1. Create 5.2.3 DB dump (db.sql).

2. Create database for LR 6.0.6 (db606).

3. Load 5.2.3 dump into 6.0.6 database:

mysql -uroot -p1 db606 < db.sql;

Delete all database views (if any).

4. Unzip clean Liferay 6.0.6.
5. Delete all folders from 'webapps' (except 'ROOT' and 'tunnel-web'); delete jre from tomcat folder.

6. Copy 'data' folder from Liferay 5.2.3 to Liferay 6.0.6.

7. Startup Liferay 6.0.6 (with default Hypersonic database settings).

8. Shutdown Liferay 6.0.6.

9. Create portal-ext.properties file:

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost:3306/db606?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=1

permissions.user.check.algorithm=5
image.hook.impl=com.liferay.portal.image.DatabaseHook


10. Startup Liferay 6.0.6. Wait until Liferay's upgrade process has upgraded database to 6.0.6.

11. Check if there is no " ' " symbol in resourcecode.name DB field.
Go to Control Panel → Server Administration → Data Migration. Click 'Execute' under 'Convert legacy permission algorithm'.

12. Once permission algorithm is upgraded, remove permissions.user.check.algorithm property
from portal-ext.properties file and restart server.

13. Go to Control Panel → Server Administration → Data Migration. Select 'FileSystemHook' inside Migrate images section, and click 'Execute' button.

14. Change image.hook.impl to com.liferay.portal.image.FileSystemHook in portal-ext.properties file and restart server.


Step 2. Liferay  Migration to 6.2.


1. Create 6.1 DB dump (db61.sql).

2. Create database for LR 6.2 (db62).

3. Load 6.1 dump into 6.2 database:
mysql -uroot -p1 db62 < db61.sql;

Check if there is no " ' " symbol in organization_.name DB field.

4. Unzip clean Liferay 6.2.

5. Startup Liferay 6.2 (with default Hypersonic database settings).

6. Shutdown Liferay 6.2.

7. Copy 'data' folder from Liferay 6.1 to Liferay 6.2.

8. Modify portal-setup-wizard.properties file, add db configuration:

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost:3306/db62?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=1

passwords.encryption.algorithm.legacy=SHA

#For Themes:
theme.css.fast.load=false
theme.images.fast.load=false
javascript.fast.load=true
javascript.log.enabled=false
layout.template.cache.enabled=false
combo.check.timestamp=true
freemarker.engine.cache.storage=soft:1
freemarker.engine.modification.check.interval=0
velocity.engine.resource.manager.cache.enabled=false
com.liferay.portal.servlet.filters.cache.CacheFilter=false
velocity.engine.resource.modification.check.interval=0
com.liferay.portal.servlet.filters.minifier.MinifierFilter=false
setup.wizard.enabled=false

velocity.engine.restricted.classes=
velocity.engine.restricted.variables=
freemarker.engine.restricted.classes=

freemarker.engine.restricted.variables=


9. Startup Liferay 6.2. Wait until Liferay's upgrade process has upgraded database to 6.2.


Step 3. Portlets and Themes Migration.



3.1. Migrate portlets from 5.2.3 to 6.2 version.

3.2. Migrate themes from 5.2.3 to 6.2 version. Make sure, that themeId is the same in 5.2.3 and 6.2 versions, otherwise themes will be not applied for pages.


P.S. Post-Migration issues.

Issues, which may occur after migration described here: Post-migration issues