[jboss-user] [JBoss jBPM] - Jbpm with tomcat and postgresql

jobu do-not-reply at jboss.com
Mon Jan 21 23:40:54 EST 2008


Please help me to know steps, 
1.integrate jbpm with postgresql ?
2. and deploy that project in tomcat ?

I have done the following things....
1.placed all jar files of ant,clover,dom4j,hibarnate,JBoss,Jbpm in WEB-INF/lib

2.hibernate.cfg.xml, jbpm.cfg.xml, jbpm.properties, jbpm-ds.xml, log4j.properties  are available in the project's classpath

3.hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>

<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
  <session-factory>

    <!-- jdbc connection properties -->
    org.hibernate.dialect.PostgreSQLDialect
    org.postgresql.Driver
    jdbc:postgresql://192.168.0.12:5432/JbpmDB
    dbuser
    dbuser

    org.hibernate.cache.HashtableCacheProvider
    org.hibernate.transaction.JDBCTransactionFactory
        
    <!-- other hibernate properties 
    true
    true
    true
    -->

    <!-- ############################################ -->
    <!-- # mapping files with external dependencies # -->
    <!-- ############################################ -->

    <!-- following mapping file has a dependendy on   -->
    <!-- 'bsh-{version}.jar'.                         -->
    <!-- uncomment this if you don't have bsh on your -->
    <!-- classpath.  you won't be able to use the     -->
    <!-- script element in process definition files   -->
    

    <!-- following mapping files have a dependendy on  -->
    <!-- 'jbpm-identity-{version}.jar', mapping files  -->
    <!-- of the pluggable jbpm identity component.     -->
    <!-- comment out the following 3 lines if you don't-->
    <!-- want to use the default jBPM identity mgmgt   -->
    <!-- component                                     -->
    
    
    

    <!-- ###################### -->
    <!-- # jbpm mapping files # -->
    <!-- ###################### -->

    <!-- hql queries and type defs -->
    
    
    <!-- graph.def mapping files -->
    
    
    
    
    
    
    
    

    <!-- graph.node mapping files -->
    
    
    
    
    
    
    
    

    <!-- context.def mapping files -->
    
    

    <!-- taskmgmt.def mapping files -->
    
    
    
    

    <!-- module.def mapping files -->
    

    <!-- bytes mapping files -->
    

    <!-- file.def mapping files -->
    

    <!-- scheduler.def mapping files -->
    
    

    <!-- graph.exe mapping files -->
    
    
    
    

    <!-- module.exe mapping files -->
    
        
    <!-- context.exe mapping files -->
    
    
    
    
    
    
    
    
    
    
    

    <!-- msg.db mapping files -->
    
    
    
    
    
    

    <!-- taskmgmt.exe mapping files -->
    
    
    
    

    <!-- scheduler.exe mapping files -->
    

    <!-- logging mapping files -->
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
  </session-factory>
</hibernate-configuration>
/*********************************************************/
4..jbpm.cfg.xml

<jbpm-configuration>

  <!-- 
    The default configurations can be found in org/jbpm/default.jbpm.cfg.xml 
    Those configurations can be overwritten by putting this file called 
    jbpm.cfg.xml on the root of the classpath and put in the customized values.
  -->

</jbpm-configuration>
/**************************************************************/
5.jbpm.properties

# In this file, you can overwrite the default jbpm configuration properties.
# See the javadocs of org.jbpm.JbpmConfiguration for more information about
# configuring jBpm.

### JBPM configs #########################################
jbpm.log.stdout=off

### HIBERNATE configs #########################################
#hibernate.connection.url=jdbc:hsqldb:hsql://localhost:1701
#hibernate.c3p0.min_size=2
#hibernate.c3p0.max_size=2
#hibernate.c3p0.timeout=120
#hibernate.c3p0.max_statements=50
#POSTGRESQL configs
hibernate.connection.url=jdbc:postgresql://192.168.0.12:5432/JbpmDB
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.c3p0.min_size=2
hibernate.c3p0.max_size=2
hibernate.c3p0.timeout=120
hibernate.c3p0.max_statements=50
/*****************************************************************/
6. jbpm-ds.xml

<?xml version="1.0" encoding="UTF-8"?>


  <local-tx-datasource>
    <jndi-name>JbpmDS</jndi-name>
    <connection-url>jdbc:postgresql://192.168.0.12:5432/JbpmDB</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
    <user-name>dbuser</user-name>
    dbuser
    
      <type-mapping>PostgreSQL 8.1</type-mapping>
    
  </local-tx-datasource>



7. after these all things... simply deployed the project into webapps in tomcat

/******************ERROR IS**********************************/

org.hibernate.HibernateException: Could not find datasource
	at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
	at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
	at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
	at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:366)
	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1859)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1152)
	at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91)
	at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:76)
	at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:80)
	at org.jbpm.persistence.db.DbPersistenceService.getTaskMgmtSession(DbPersistenceService.java:279)
	at org.jbpm.JbpmContext.getTaskMgmtSession(JbpmContext.java:547)
	at org.jbpm.JbpmContext.getTaskList(JbpmContext.java:189)
	at com.brainscript.workflow.service.WorkflowService.getTasks(WorkflowService.java:256)
	at com.brainscript.workflow.presentation.action.WorkflowAction.forwardToPage(WorkflowAction.java:58)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
	at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Thread.java:595)
Caused by: javax.naming.NameNotFoundException: Name DefaultDS is not bound in this Context
	at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
	at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
	at javax.naming.InitialContext.lookup(InitialContext.java:351)
	at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
	... 40 more

/*******************************************************/
But not Working.... Anybody please help me.....




View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122027#4122027

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122027



More information about the jboss-user mailing list