cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 4.2e: SQLException caused by ClassNotFound during startup

beppegg
Champ in-the-making
Champ in-the-making
Hi all,

I'm trying to deploy an alfresco installation on my own linux machine.
The computer run a linux Debian "Jessie (Testing)" distribution, with mysql and tomcat 7 installed by means of regular "apt-get" architecture.

I've downloaded alfresco zip file, customized tomcat 7 installation as described <HERE> adding the required shared/classes, shared/lib and customizing catalina.properties and server.xml according instuctions. I added a "lib" directory and copied mysql-connector-5.1.27.jar in it. I created an empty schema and a user for alfresco in MySQL, granting him "create table" rights.
Finally, I copied share.war and alfresco.war into webapps/ directory.

When I start my servlet container, "share" starts succesfully but "alfresco" fails with the attached stacktrace.

Initially, I thought MySQL Driver class couldn't be found. So I tried writing a small JSP that loads the class, but it succeded: so the  Driver class can actually be loaded by deployed applications.


Any help would be greatly appreciated!
8 REPLIES 8

jpotts
World-Class Innovator
World-Class Innovator
Please post your alfresco-global.properties or at least your values for db.name, db.driver, and db.url. Also include the location of your alfresco-global.properties file.

Jeff

beppegg
Champ in-the-making
Champ in-the-making
Hi Jeff!

Thanks for your help.
I took some screenshot in order to answer your question in the most faithfull way; I've attached it since my proxy blocks me from using any "personal repository" service Smiley Sad

Hi beppegg,
so if I correctly understood your situation you put the MySQL driver under tomcat7/lib, then started MySQL instance and then started Alfresco, right?

Regards,
Andrea

mrogers
Star Contributor
Star Contributor
Sorry,  I can't see anything wrong with what you have posted.   All looks O.K. to me.  

Comparing your install with mine, which works, I put my sql connector library in the main "lib" directory ${TOMCAT_HOME}/lib (rather than the "shared/lib)"

Check you can login to the database with alfresco/alfresco ?

Also have you any earlier errors in your log, in particular out of memory errors?   I'd expect you to need to increase the permgen memory settings as well.

bisana
Champ on-the-rise
Champ on-the-rise
please check when you created 'alfresco' db and user 'alfresco' what permsision u gave
can u login in from command line
mysql -uusername -ppassword databasename

beppegg
Champ in-the-making
Champ in-the-making
Thank you all for your help.

I've tried and I can actually connect to MySQL with provided credentials,also I can confirm mysql-connector.jar lives in tomcat7/lib and can be successfully loaded by webapps, since I tried with a simple JSP I wrote for debug purposes.

Edit: The error seems caused by tomcat's own connection pool; as far as I can understand, Alfresco tries to ask for connection via JNDI but Tomcat fails creating it. I suppose I should configure some other tomcat parameter, I tried looking in META-INF/context.xml but everything related to JNDI datasources is commented out. Should I look somewhere else?
My tomcat log doesn't shows any other exception, and MySQL server is started during bootstrap so it's available and running whe tomcat starts.

beppegg
Champ in-the-making
Champ in-the-making
Ok, I managed to overcome that problem!!

Debian package for tomcat sets CATALINA_BASE and CATALINA_HOME to different directories, so I shouldn't have copied mysql.jar in /var/lib/tomcat7/lib but I should have copied it in /usr/share/tomcat7/lib instead.

The bad news is that error message is now more cryptic:
INFO: Deploying configuration descriptor /etc/tomcat7/Catalina/localhost/alfresco.xml
dic 11, 2013 4:01:57 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
dic 11, 2013 4:01:57 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/alfresco] startup failed due to previous errors

any advice on where should I look for more details?

Hi,
please give more us full log in order to find out what's going wrong.

Rgeards,
Andrea