掲示板

Upgrade liferay-portal-6.2-ce-ga6 to liferay-ce-portal-7.0-ga4 - Linux

thumbnail
6年前 に Mohammed Rawoof Shaik によって更新されました。

Upgrade liferay-portal-6.2-ce-ga6 to liferay-ce-portal-7.0-ga4 - Linux

Junior Member 投稿: 37 参加年月日: 16/09/25 最新の投稿
Hello LR Community,

Requirement:
Upgrade liferay-portal-6.2-ce-ga6 to liferay-ce-portal-7.0-ga4. I initially performed the steps on Windows as posted here, prior to performing the same on a Linux machine. I zipped the jar files and FTP-ed it over to the linux machine.

Environment:
centos-release-6-6.el6.centos.12.2.x86_64

Issue:

When I run the jar I get the below error,

Exception in thread "main" java.lang.NoSuchMethodError: com.liferay.portal.kernel.util.ArrayUtil.reverse

[root@liferay portal-tools-db-upgrade-client]# java -jar com.liferay.portal.tools.db.upgrade.client.jar
Loading jar:file:/portal/liferay-ce-portal-tools-7.0-ga4/portal-tools-db-upgrade-client/lib/portal-impl.jar!/system.properties
Aug 14, 2017 6:18:10 PM com.liferay.portal.kernel.log.Jdk14LogImpl error
SEVERE: Portal ClassLoader is null
Aug 14, 2017 6:18:10 PM com.liferay.portal.kernel.log.Jdk14LogImpl info
INFO: Global shared lib directory /portal/liferay-ce-portal-tools-7.0-ga4/portal-tools-db-upgrade-client/lib/
Aug 14, 2017 6:18:10 PM com.liferay.portal.kernel.log.Jdk14LogImpl info
INFO: Global lib directory /portal/liferay-ce-portal-tools-7.0-ga4/portal-tools-db-upgrade-client/lib/
Aug 14, 2017 6:18:10 PM com.liferay.portal.kernel.log.Jdk14LogImpl info
INFO: Portal lib directory /portal/liferay-ce-portal-tools-7.0-ga4/portal-tools-db-upgrade-client/lib/util-java.jar!/
Exception in thread "main" java.lang.NoSuchMethodError: com.liferay.portal.kernel.util.ArrayUtil.reverse([Ljava/lang/Object;)V
        at com.liferay.portal.configuration.easyconf.ClassLoaderAggregateProperties._addIncludedPropertiesSources(ClassLoaderAggregateProperties.java:226)
        at com.liferay.portal.configuration.easyconf.ClassLoaderAggregateProperties._addURLProperties(ClassLoaderAggregateProperties.java:364)
        at com.liferay.portal.configuration.easyconf.ClassLoaderAggregateProperties._addPropertiesSource(ClassLoaderAggregateProperties.java:268)
        at com.liferay.portal.configuration.easyconf.ClassLoaderAggregateProperties.addBaseFileName(ClassLoaderAggregateProperties.java:69)
        at com.liferay.portal.configuration.easyconf.ClassLoaderComponentConfiguration._getAvailableProperties(ClassLoaderComponentConfiguration.java:120)
        at com.liferay.portal.configuration.easyconf.ClassLoaderComponentConfiguration.getProperties(ClassLoaderComponentConfiguration.java:78)
        at com.liferay.portal.configuration.ConfigurationImpl.getComponentProperties(ConfigurationImpl.java:386)
        at com.liferay.portal.configuration.ConfigurationImpl.printSources(ConfigurationImpl.java:401)
        at com.liferay.portal.configuration.ConfigurationImpl.<init>(ConfigurationImpl.java:99)
        at com.liferay.portal.util.PropsUtil.<clinit>(PropsUtil.java:438)
        at com.liferay.portal.util.InitUtil.initWithSpring(InitUtil.java:199)
        at com.liferay.portal.tools.DBUpgrader.main(DBUpgrader.java:97)</clinit></init>


Question:
What am I missing here?
thumbnail
6年前 に Olaf Kock によって更新されました。

RE: Upgrade liferay-portal-6.2-ce-ga6 to liferay-ce-portal-7.0-ga4 - Linux

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
If you went through the same copy/paste frenzy as in the other post (I hope you didn't), you might have picked a library from the wrong Liferay version - e.g. portal-service.jar from 6.2, and mix it with other Jars from 7.0 - as a guess.

On Linux you certainly used forward-slashes, I guess, and have tried without copying and pasting the individual jars?
thumbnail
6年前 に Mohammed Rawoof Shaik によって更新されました。

RE: Upgrade liferay-portal-6.2-ce-ga6 to liferay-ce-portal-7.0-ga4 - Linux

Junior Member 投稿: 37 参加年月日: 16/09/25 最新の投稿
Hi Olaf,

I looked for the JARs that would have com.liferay.portal.kernel.util.ArrayUtil.class.

[root@liferay portal-tools-db-upgrade-client]# find . -name "*.jar" | xargs grep com.liferay.portal.kernel.util.ArrayUtil.class
Binary file ./lib/portal-service-6.2.5.jar matches
Binary file ./lib/ext/portal-kernel.jar matches
Binary file ./lib/com.liferay.portal.kernel-2.41.0.jar matches


I removed portal-service-6.2.5.jar, ran the upgrade after which,

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(6)' at line 1

java.lang.IllegalStateException: The database contains changes from a previous upgrade attempt that failed. Please restore the old database and file system and retry the upgrade. A patch may be required if the upgrade failed due to a bug or an unforeseen data permutation that resulted from a corrupt database.


Restored a snapshot, upgraded my MySQL server from 5.1 to 5.7, after which the upgrade ended with,

19:57:45,031 INFO  [main][VerifyProcess:79] Completed verification process com.liferay.portal.security.service.access.policy.internal.verify.SAPServiceVerifyProcess in 247ms
INFO - Completed verification process com.liferay.portal.security.service.access.policy.internal.verify.SAPServiceVerifyProcess in 247ms

Completed Liferay core upgrade and verify processes in 1675 seconds
Checking to see if all upgrades have completed... your upgrades have failed, have not started, or are still running.
You are connected to Gogo shell.

Upgrade commands:
exit or quit - Exit Gogo Shell
upgrade:check - List upgrades that have failed, have not started, or are still running
upgrade:execute {module_name} - Execute upgrade for specified module
upgrade:help - Show upgrade commands
upgrade:list - List registered upgrades
upgrade:list {module_name} - List upgrade steps required for specified module
upgrade:list | grep Registered - List registered upgrades and their current version
upgrade:list | grep Registered | grep steps - List upgrades in progress
verify:execute {module_name} - Execute verifier for specified module
verify:list - List registered verifiers
g!


When I ran the upgrade previously on Windows the logs ended with,

16:20:23,251 INFO  [main][VerifyProcess:79] Completed verification process com.liferay.portal.security.service.access.policy.internal.verify.SAPServiceVerifyProcess in 384ms
INFO - Completed verification process com.liferay.portal.security.service.access.policy.internal.verify.SAPServiceVerifyProcess in 384ms

Completed Liferay core upgrade and verify processes in 1348 seconds
Checking to see if all upgrades have completed... done.


I investigated the upgrade.log and found this below exception,

Caused by: org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
        at org.dom4j.io.SAXReader.read(SAXReader.java:482)
        at org.dom4j.io.SAXReader.read(SAXReader.java:365)
        at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:407)
        ... 86 more


I'm assuming it's a file, encoding in UTF-8 with/without BOM, something I must've copied over from Windows. Attached log.

Any word of advice, how do I find the needle in the haystack?

添付ファイル:

thumbnail
6年前 に Mohammed Rawoof Shaik によって更新されました。

RE: Upgrade liferay-portal-6.2-ce-ga6 to liferay-ce-portal-7.0-ga4 - Linux

Junior Member 投稿: 37 参加年月日: 16/09/25 最新の投稿
Hi,

So I decided to hit the reset button since I'm hitting a wall. I restored a snapshot of the VM. Below is the my system config,


java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Server version: 5.7.19 MySQL Community Server (GPL)


Downloaded a fresh copy of liferay-ce-portal-tomcat-7.0-ga4-20170613175008905.zip. FTP-ed, unzipped the package and disabled the index.

vi liferay-ce-portal-7.0-ga4/osgi/configs/com.liferay.portal.search.configuration.IndexStatusManagerConfiguration.cfg
with the below content
indexReadOnly=true

- Shut down Liferay 6. This time I used the tools with the tomcat bundle.
- cd liferay-ce-portal-7.0-ga4/tools/portal-tools-db-upgrade-client/
java -jar com.liferay.portal.tools.db.upgrade.client.jar

Got the below error,

Error: Could not find or load main class com.liferay.portal.tools.DBUpgrader


Did the below,
mkdir lib
cp -r ../../tomcat-8.0.32/webapps/ROOT/WEB-INF/lib/* ./lib/

Ran the upgrade again,
java -jar com.liferay.portal.tools.db.upgrade.client.jar

The upgrade ran and stumbled across the same issue. Attached upgrade.log,

Caused by: org.dom4j.DocumentException: Error on line x of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.


I went ahead and started the tomcat server and it started successfully, with the basic configuration screen. I gave the database details and restarted the server, invoked localhost in the browser, after which the logs were having the "org.dom4j.DocumentException: Error on line x of document : Content is not allowed in prolog." exception. Attached catalina.out.