Message Boards

Migrating 6.1 to 6.2

David Aragones, modified 7 Years ago.

Migrating 6.1 to 6.2

New Member Posts: 10 Join Date: 11/23/16 Recent Posts
Hello,
I'm migrating liferay-ce 6.1.1 GA2 to liferay-ce 6.2.1 GA5 as a previous step to version 7
Use Jdk1.6.0_24, MySQL 5.7 and the corresponding mysql connector.
Since version 6.1 I have been able to change to security algorithm 6.
I have unzipped liferay-ce 6.2.1 GA5 and copied the data folder and all directories from the webapps folder except ROOT. The BBDD is the same.
When running the new version I have updated the BBDD with no problems, but when it displays it gives me the error that is described behind this explanation.
I have read the solution to the problem and it is this:

The problem is that you have the portal-impl.jar on your classpath portlet. Portal-impl.jar contains the core classes of Liferay and should not be referenced directly by portlet. It is explicit forbidden add this jar to your portlet's classpath. Unknown problems can be raised like the one that you are facing.

But I have the following doubt: if this were so I would have failed with the previous version of liferay, no ?.
Then I do not know what the problem is. What's going on?..

Thanks in advance.

ERROR Could not create an Appender. Reported error follows.
java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender
at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)
at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)
at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:492)
at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1001)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:867)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:815)
at com.liferay.util.log4j.Log4JUtil.configureLog4J(Log4JUtil.java:113)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.initLogger(PluginPackageHotDeployListener.java:182)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.doInvokeDeploy(PluginPackageHotDeployListener.java:130)
at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.invokeDeploy(PluginPackageHotDeployListener.java:61)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:230)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:28)
at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:164)
at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:154)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:74)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:58)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:54)
at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:116)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5528)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1948)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
thumbnail
Olaf Kock, modified 7 Years ago.

RE: Migrating 6.1 to 6.2

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts
You're mentioning two issues:

David Aragones:
The problem is that you have the portal-impl.jar on your classpath portlet. Portal-impl.jar contains the core classes of Liferay and should not be referenced directly by portlet. It is explicit forbidden add this jar to your portlet's classpath. Unknown problems can be raised like the one that you are facing.

But I have the following doubt: if this were so I would have failed with the previous version of liferay, no ?.
Then I do not know what the problem is. What's going on?..


portal-impl.jar simply must not be on the classpath for any portlet. There's no exhaustive documentation on what can and what can't go wrong, or if anything goes wrong at all. portal-impl.jar is just the wrong solution and you might have been lucky that nothing went wrong earlier, but it was still never supposed to work. If you indeed have portal-impl.jar on the classpath for any of your portlets: Stop worrying about how to make it work. You won't be able to make it work. Period.

Also, depending on the use of Liferay APIs that you might or might not have within your portlets and plugins, you might have to do more than just copy all of the plugins from the old webapps to the new webapps folder - recompile might be in order, along with adopting to any changed APIs. This is definitely the case if you have any hooks, themes or other changes to the default Liferay functionality deployed.

David Aragones:
ERROR Could not create an Appender. Reported error follows.
java.lang.ClassCastException: org.apache.log4j.ConsoleAppender cannot be cast to org.apache.log4j.Appender


You have log4j on the classpath at least twice, leading to this message. This is a classic exception that clearly indicates conflicting classloaders. The message only makes sense when you take into account that ConsoleAppender is the legitimate subclass of a version of Appender that is loaded from a different classloader than the one cited in this message - e.g. by the global classpath. Remove one.