cancel
Showing results for 
Search instead for 
Did you mean: 

Help with SQL Server Database Configuration

wmfinamore
Champ in-the-making
Champ in-the-making
Hi

I'm trying to config the activiti engine for use a sql server 2008 database, but I don't know what I'm mistaken:
-I put the sqljdbc4.jar in acitivi "C:\Java\tomcat7\webapps\activiti-explorer\WEB-INF\lib", but i'm not sure that this is right
-I change the database configuration in C:\Java\tomcat7\webapps\activiti-explorer\WEB-INF\classes\db.properties

db=mssql
jdbc.driver=com.microsoft.sqlsever.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://localhost:1433/activiti
jdbc.username=sa
jdbc.password=activiti

-Then, I try start the application with the Tomcat but not work. Follow the log:

Abr 18, 2013 11:45:20 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Abr 18, 2013 11:45:20 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/activiti-explorer] startup failed due to previous errors
Abr 18, 2013 11:45:20 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/activiti-explorer] registered the JDBC driver [org.h2.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Abr 18, 2013 11:45:20 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/activiti-explorer] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@b224de]) and a value of type [org.apache.ibatis.executor.ErrorContext] (value [
### The error may exist in org/activiti/db/mapping/entity/EventSubscription.xml
### The error occurred while processing mapper_resultMap[compensateResultMap]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

Thanks for any help!
5 REPLIES 5

frederikherema1
Star Contributor
Star Contributor
What are the "due to previous errors". The error you pasted is when tomcat is going down and can? See if you can find a stack trace earlier in the logs (perhaps in catalina.out).

Hi frederikheremans

The due to previous error happen is referencing the "SEVERE: Error listenerStart"

If I use the default configuration with h2 in memory work no problems. But I'm trying use with SQL Server 2008 for approximate my tests to my production enviroment.

I attached the catalina when I booted the virtual machine today.

jbarrez
Star Contributor
Star Contributor
Hmmm it doesn't really say anything that stacktrace … besides

> SEVERE: Error listenerStart

Aren't there any other relevant logs in the logs/ folder of tomcat?

wmfinamore
Champ in-the-making
Champ in-the-making
For example…

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoDataGenerator' defined in ServletContext resource [/WEB-INF/activiti-standalone-context.xml]: Cannot resolve reference to bean 'processEngine' while setting bean property 'processEngine'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.microsoft.sqlsever.jdbc.SQLServerDriver'

jbarrez
Star Contributor
Star Contributor
> Cannot load JDBC driver class 'com.microsoft.sqlsever.jdbc.SQLServerDriver'

Well, this is pretty obvious. You don't have the SQL Server database driver on your classpath.
Drop the driver in the tomcat shared lib or the WEB-INF lib and you'll be able to connect to your DB.