I cannot start drools 6.2 in tomcat (version 7.x) for Windows. This was working fine in my linux machine. But in windows I keep getting the following error
Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [java:comp/env/jdbc/jbpm]
at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68)
at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:116)
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:85)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:184)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:156)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89)
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:85)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:184)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:156)
at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1827)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1785)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915)
... 94 more
Caused by: javax.naming.NamingException: no resource registered with uniqueName 'jdbc/jbpm', available resources: []
at bitronix.tm.resource.ResourceObjectFactory.getObjectInstance(ResourceObjectFactory.java:55)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:141)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
Safely wrapped inside the drools war file is a README.txt. Make sure you read it before you continue from here.I followed most of the instructions. And it works pretty well in linux in the first try. But for windows things are a bit different:
STEP 3 in README.txt
In the above note this:
NOTE: this is an example for unix like systems for Windows $CATALINA_HOME needs to be replaced with windows env variable or absolute path
This applies for all files. Here, things get complicated if you are not (like me) an expert with batch and windows. So I will tell you 2 things and give the exact change I made to make it work.
Here are the exact steps I followed:
In the resources.properties change the path of this prop to be in windows format instead of linux. (~ in linux means home directory)
resource.ds1.driverProperties.url=jdbc:h2:file:C:/Users/nanospeck/Downloads/apache-tomcat-7.0.54/temp2
In the catalina.bat add the full content of line 'set CATALINA_OPTS' above CATALINA_HOME ( or you may try adding it to setenv.bat too, might work). Of course change the path to suit the locations in you machine.
echo Using CATALINA_BASE: "%CATALINA_BASE%"