Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Tim Ye
One issue after upgrade to liferay-portal-6.1.1-ce-ga2
January 29, 2013 8:07 PM
Answer

Tim Ye

Rank: New Member

Posts: 13

Join Date: December 5, 2012

Recent Posts

Hi friends .

After I upgraded the liferay from 6.1 GA1 to the 6.1 GA2 . Everything should be smoothly , but there is one exception when I deploy the test portlet that be build by the new SDK "liferay-portal-6.1.1-ce-ga2 " . The exception as below , Anybody meet this problem? please help to give some suggestions to solve it .

Test Porlet service.xml as below


 1
 2<?xml version="1.0" encoding="UTF-8"?>
 3<service-builder package-path="com.test.portlet">
 4    <author>test</author>
 5    <namespace>testPortlet</namespace>
 6    <entity name="Foo" local-service="true">
 7        <column name="id" type="String" primary="true"></column>
 8          <column name="name" type="String"></column>
 9    </entity>
10</service-builder>



The exception as below

16:42:14,830 INFO [PluginPackageUtil:1033] Reading plugin package for test-ga2-portlet
Loading file:/tmp/tomcat6-tmp/0-test-ga2-portlet/WEB-INF/classes/portlet.properties
Loading file:/tmp/tomcat6-tmp/0-test-ga2-portlet/WEB-INF/classes/service.properties
Loading file:/tmp/tomcat6-tmp/0-test-ga2-portlet/WEB-INF/classes/portlet.properties
Jan 23, 2013 4:42:15 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Loading file:/tmp/tomcat6-tmp/0-test-ga2-portlet/WEB-INF/classes/service.properties
16:42:15,425 ERROR [ConnectionProviderFactory:110] Could not instantiate connection provider
java.lang.ClassCastException: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider cannot be cast to org.hibernate.connection.ConnectionProvider
at org.hibernate.connection.ConnectionProviderFactory.initializeConnectionProviderFromConfig(ConnectionProviderFactory.java:174)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:102)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:90)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
at com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.buildSessionFactory(PortalHibernateConfiguration.java:65)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at com.liferay.portal.spring.context.PortletContextLoaderListener.contextInitialized(PortletContextLoaderListener.java:98)
at com.liferay.portal.deploy.hot.SpringHotDeployListener.doInvokeDeploy(SpringHotDeployListener.java:77)
at com.liferay.portal.deploy.hot.SpringHotDeployListener.invokeDeploy(SpringHotDeployListener.java:40)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:188)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:151)
at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:141)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:48)
at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:858)
at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:366)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayHibernateSessionFactory' defined in ServletContext resource [/WEB-INF/classes/META-INF/hibernate-spring.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Could not instantiate connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at com.liferay.portal.spring.context.PortletContextLoaderListener.contextInitialized(PortletContextLoaderListener.java:98)
at com.liferay.portal.deploy.hot.SpringHotDeployListener.doInvokeDeploy(SpringHotDeployListener.java:77)
at com.liferay.portal.deploy.hot.SpringHotDeployListener.invokeDeploy(SpringHotDeployListener.java:40)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:188)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:151)
at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:141)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:48)
at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:858)
at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:366)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.hibernate.HibernateException: Could not instantiate connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
at org.hibernate.connection.ConnectionProviderFactory.initializeConnectionProviderFromConfig(ConnectionProviderFactory.java:178)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:102)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:90)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
at com.liferay.portal.spring.hibernate.PortalHibernateConfiguration.buildSessionFactory(PortalHibernateConfiguration.java:65)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1479)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)
... 51 more
David H Nebinger
RE: One issue after upgrade to liferay-portal-6.1.1-ce-ga2
January 29, 2013 9:13 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9012

Join Date: September 1, 2006

Recent Posts

Looks like a classpath/version issue.

You must use liferay-plugin-package.properties to list the dependency jars rather than using your own copies in WEB-INF/lib...
Neha Goyal
RE: One issue after upgrade to liferay-portal-6.1.1-ce-ga2
November 11, 2014 2:03 AM
Answer

Neha Goyal

Rank: Junior Member

Posts: 73

Join Date: May 14, 2013

Recent Posts

David H Nebinger:
Looks like a classpath/version issue.

You must use liferay-plugin-package.properties to list the dependency jars rather than using your own copies in WEB-INF/lib...


Hi David,

I downloaded marketplace-portlet-6.1.2.4.war and deplyed it to liferay-portal-6.1 but i am also getting the same exception on console log and causing issue "not able to install ".Apps keep on loading and asking to wait.

Any help on this would be thankful.


Best Regard:
Neha.
David H Nebinger
RE: One issue after upgrade to liferay-portal-6.1.1-ce-ga2
November 11, 2014 5:49 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9012

Join Date: September 1, 2006

Recent Posts

When you get the "class cannot be cast to class" exception, it's usually due to a class/version conflict.

For example, Liferay uses a version of Hibernate and it's instance is created and defined in the Liferay context. If you have a different version of Hibernate locally in your own project, well you have a different class that is not the same as Liferay's. That's why you get the class cannot be cast message when both left and right appear to be the exact same class.

The only solution is to add the hibernate jar to liferay-plugin-package.properties as a dependency and get rid of your own hibernate jar. That way both hibernate jars will be the same version, and the class cannot be cast message will be resolved.
Neha Goyal
RE: One issue after upgrade to liferay-portal-6.1.1-ce-ga2
November 12, 2014 3:33 AM
Answer

Neha Goyal

Rank: Junior Member

Posts: 73

Join Date: May 14, 2013

Recent Posts

David H Nebinger:
When you get the "class cannot be cast to class" exception, it's usually due to a class/version conflict.

For example, Liferay uses a version of Hibernate and it's instance is created and defined in the Liferay context. If you have a different version of Hibernate locally in your own project, well you have a different class that is not the same as Liferay's. That's why you get the class cannot be cast message when both left and right appear to be the exact same class.

The only solution is to add the hibernate jar to liferay-plugin-package.properties as a dependency and get rid of your own hibernate jar. That way both hibernate jars will be the same version, and the class cannot be cast message will be resolved.


Hi David,

Thank you for the quick reply,You are awsome.
I tried the same approach,included hibernate jar to liferay-plugin-package.properties and restarted the server as well.But still getting the same issue.
Is there any other thing we need to do or configure something else.
Thanks in advance.

Regards:
Neha
David H Nebinger
RE: One issue after upgrade to liferay-portal-6.1.1-ce-ga2
November 12, 2014 5:21 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 9012

Join Date: September 1, 2006

Recent Posts

One thing with casting issues, they can actually be caused by parent classes or dependencies.

They truly are a pain trying to track down and resolve...

Also check the expanded war to see that you're not carrying holdover hib jar from previous deployment.
Neha Goyal
RE: One issue after upgrade to liferay-portal-6.1.1-ce-ga2
November 13, 2014 10:57 PM
Answer

Neha Goyal

Rank: Junior Member

Posts: 73

Join Date: May 14, 2013

Recent Posts

David H Nebinger:
One thing with casting issues, they can actually be caused by parent classes or dependencies.

They truly are a pain trying to track down and resolve...

Also check the expanded war to see that you're not carrying holdover hib jar from previous deployment.


Hi David,
Thank you once again.This is really very painfull. I will check it will all possible secnario.

Thanks.

Regards:
Neha.