Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Anurag Piyush
Could not load driverClass jdbc driver Class
February 20, 2013 12:41 AM
Answer

Anurag Piyush

Rank: New Member

Posts: 24

Join Date: July 19, 2012

Recent Posts

Hi

I am using liferay6.1. I am trying to migrate database into MySql using control panel->Server->Data migration tab.
I have filled following details

jdbc driver ClassName=com.mysql.jdbc.Driver
jdbc url=jdbc:mysql://localhost:3306/lportal
jdbc username=root
jdbc password=root

When I clicked on Execute button it throws following error and database doesnot migrate.

08:28:07,134 WARN [DriverManagerDataSource:107] Could not load driverClass jdbc driver Class
Name=com.mysql.jdbc.Driver
java.lang.ClassNotFoundException: jdbc driver ClassName=com.mysql.jdbc.Driver
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688
)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533
)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(DriverManagerDataSo
urce.java:100)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.
java:132)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperCon
nectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolMan
ager.acquireResource(C3P0PooledConnectionPool.java:148)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:101
4)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32
)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.ja
va:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchr
onousRunner.java:547)




Someone on the forum wiritten that it happens due to mysql jar file not found. but i have checked in my liferay bundle, Mysql jar file is there. I have also set class path explicitly but it is not working

Can anybody help me.

Thanks
Anurag
Subhash Pavuskar
RE: Could not load driverClass jdbc driver Class
February 20, 2013 2:25 AM
Answer

Subhash Pavuskar

Rank: Regular Member

Posts: 234

Join Date: March 12, 2012

Recent Posts

Hi Anurag ,

Did you set the portal-ext.properties from classes folder and Root.xml from Tomcat config folder?
i.e
for portal-ext.properties File
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/Liferay6.1.1?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root


And Root.xml File
<Resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/Liferay6.1.1?useUnicode=true&amp;characterEncoding=UTF-8"
username="root"
password="root"
maxActive="20"
/>


After setting these Then Restart your server !!
Adeel Aslam
RE: Could not load driverClass jdbc driver Class
February 20, 2013 4:27 AM
Answer

Adeel Aslam

Rank: New Member

Posts: 18

Join Date: December 8, 2012

Recent Posts

Make sure that you have Setup Wizard Disabled.
Hitoshi Ozawa
RE: Could not load driverClass jdbc driver Class
February 21, 2013 3:34 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

You don't need to modify root.xml file if you've set the jdbc url string in portal-ext.properties
Jitendra Rajput
RE: Could not load driverClass jdbc driver Class
February 21, 2013 4:02 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 649

Join Date: January 7, 2011

Recent Posts

You dont need to specify database connection in both the places .
Either use portal-ext or root.xml for database connection setting.
Jitendra Rajput
RE: Could not load driverClass jdbc driver Class
February 21, 2013 4:04 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 649

Join Date: January 7, 2011

Recent Posts


Could not load driverClass jdbc driver Class
Name=com.mysql.jdbc.Driver
java.lang.ClassNotFoundException: jdbc driver ClassName=com.mysql.jdbc.Driver



Seems like you have pasted complete "jdbc driver ClassName=com.mysql.jdbc.Driver" in text box.
Correct it or specify setting inside portal-ext.