0 Replies Latest reply on Feb 25, 2008 8:41 AM by yairfr

    jbpm.cfg.xml default is taken instead of mine!!

    yairfr

      hi,
      i am working on SqlServer on Jboss .
      i have in my project a config directory these files :
      SqlServer_hibernate.cfg.xml
      jbpm.cfg.xml
      hibernate.properties

      jbpm.cfg.xml code:

      <jbpm-configuration>
       <jbpm-context>
       <service name='persistence' factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />
       <service name='scheduler' factory='org.jbpm.scheduler.db.DbSchedulerServiceFactory' />
       </jbpm-context>
       <string name='resource.hibernate.properties'
       value='hibernate.properties' />
       <string name='resource.hibernate.cfg.xml' value='SqlServer_hibernate.cfg.xml' />
      
      </jbpm-configuration>
      

      i have a StartupServlet that loads the hibernate configurations.
      Web.xml code :
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.5"
       xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
       http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
       <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
       </welcome-file-list>
      
       <servlet>
       <servlet-name>HibernateStartupLoad</servlet-name>
       <servlet-class>com.mts.dblayer.HibernateTools.HibernateStartupLoad</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
      
       <servlet>
       <servlet-name>dwr-invoker</servlet-name>
       <display-name>DWR Servlet</display-name>
       <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
       <init-param>
       <param-name>debug</param-name>
       <param-value>true</param-value>
       </init-param>
       </servlet>
      
       <servlet-mapping>
       <servlet-name>dwr-invoker</servlet-name>
       <url-pattern>/dwr/*</url-pattern>
       </servlet-mapping>
      
       <taglib>
       <taglib-uri>com.mts.WF.UI.ProcessImageJbpmTag</taglib-uri>
       <taglib-location>jbpm.tld</taglib-location>
       </taglib>
      
      </web-app>
      

      the problem is that after the hibernate is loaded ok , the Default JBPM
      configuration is loaded again (i have mapping to the jbpm in SqlServer_hibernate.cfg.xml too).
      in the end of the log i see even it loads Oracle configuration from the default instead the SqlServer onces .

      the console log on startup :
      the good loading :
      
      15:34:33,184 INFO [STDOUT] 15:34:33,184 INFO [Environment] Hibernate 3.2 cr2
      15:34:33,215 INFO [STDOUT] 15:34:33,215 INFO [Environment] loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.microsoft.sqlserver.jdbc.SQLServerDriver, hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider, hibernate.cache.use_query_cache=true, hibernate.c3p0.max_size=20, hibernate.dialect=org.hibernate.dialect.SQLServerDialect, hibernate.cache.use_second_level_cache=true, hibernate.c3p0.min_size=5, hibernate.query.substitutions=true 1, false 0, hibernate.connection.username=TabsUser, hibernate.bytecode.use_reflection_optimizer=false, hibernate.show_sql=true, hibernate.connection.password=****}
      15:34:33,215 INFO [STDOUT] 15:34:33,215 INFO [Environment] Bytecode provider name : cglib
      15:34:33,231 INFO [STDOUT] 15:34:33,231 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      15:34:33,497 INFO [STDOUT] 15:34:33,497 INFO [Configuration] configuring from file: SqlServer_hibernate.cfg.xml
      15:34:33,731 INFO [STDOUT] 15:34:33,731 INFO [Configuration] Reading mappings from resource: com/mts/dblayer/entities/wf/WfNotes.hbm.xml
      15:34:33,981 INFO [STDOUT] 15:34:33,981 INFO [HbmBinder] Mapping class: com.mts.dblayer.entities.wf.WfNotes -> WF_NOTES
      15:34:34,059 INFO [STDOUT] 15:34:34,059 INFO [Configuration] Reading mappings from resource: com/mts/dblayer/entities/wf/WfInstances.hbm.xml
      15:34:34,137 INFO [STDOUT] 15:34:34,137 INFO [HbmBinder] Mapping class: com.mts.dblayer.entities.wf.WfInstances -> WF_INSTANCES
      ....
      ....
      .....
      ...
      the wrong loading :
      
      15:34:52,840 INFO [STDOUT] 15:34:52,840 INFO [JbpmConfiguration] using jbpm configuration resource 'jbpm.cfg.xml'
      15:34:53,153 INFO [STDOUT] 15:34:53,153 INFO [Environment] Hibernate 3.1
      15:34:53,168 INFO [STDOUT] 15:34:53,168 INFO [Environment] loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider, hibernate.cache.use_query_cache=true, hibernate.c3p0.max_size=20, hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, hibernate.cache.use_second_level_cache=true, hibernate.c3p0.min_size=5, hibernate.query.substitutions=true 1, false 0, hibernate.connection.username=im1online, hibernate.connection.url=jdbc:oracle:thin:@10.10.2.68:1521:b3, hibernate.show_sql=true, hibernate.connection.password=****}
      15:34:53,168 INFO [STDOUT] 15:34:53,168 INFO [Environment] using CGLIB reflection optimizer
      15:34:53,168 INFO [STDOUT] 15:34:53,168 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      15:34:53,497 INFO [STDOUT] 15:34:53,497 INFO [Configuration] configuring from resource: hibernate.cfg.xml
      15:34:53,497 INFO [STDOUT] 15:34:53,497 INFO [Configuration] Configuration resource: hibernate.cfg.xml
      15:34:53,731 INFO [STDOUT] 15:34:53,731 INFO [Configuration] Reading mappings from resource: org/jbpm/graph/action/Script.hbm.xml
      15:34:53,965 INFO [STDOUT] 15:34:53,965 INFO [Configuration] Reading mappings from resource: org/jbpm/identity/User.hbm.xml
      15:34:54,075 INFO [STDOUT] 15:34:54,075 INFO [HbmBinder] Mapping class: org.jbpm.identity.User -> JBPM_ID_USER
      15:34:54,653 INFO [STDOUT] 15:34:54,653 INFO [HbmBinder] Mapping collection: org.jbpm.identity.User.permissions -> JBPM_ID_PERMISSIONS
      ...
      ...
      ..
      15:34:57,403 INFO [STDOUT] 15:34:57,403 INFO [Configuration] processing association property references
      15:34:57,403 INFO [STDOUT] 15:34:57,403 INFO [Configuration] processing foreign key constraints
      15:34:57,809 INFO [STDOUT] 15:34:57,809 INFO [C3P0ConnectionProvider] C3P0 using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@myIP:1521:DB
      15:34:57,809 INFO [STDOUT] 15:34:57,809 INFO [C3P0ConnectionProvider] Connection properties: {user=MyUSER, password=****}
      15:34:57,809 INFO [STDOUT] 15:34:57,809 INFO [C3P0ConnectionProvider] autocommit mode: false
      ....