[JBoss jBPM] - Re: Invoke jBPM workflow from external app
by hkapoor@ciber.com
Hi,
I have deployed workflow in jBPM using jbpm-console.
but when I am using Java class to start it I am getting folloeing exception.
Exception in thread "main" org.hibernate.HibernateException: Could not locate TransactionManager
at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:26)
at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:325)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:105)
at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:95)
at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:99)
at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:355)
at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:639)
at com.sample.action.WFProcessFactory.startProcess(WFProcessFactory.java:77)
at com.sample.action.WFProcessFactory.main(WFProcessFactory.java:107)
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)
... 9 more
Please Help
-Harshit
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209942#4209942
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209942
17 years, 2 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: Create table warning... Need help!
by ablegreen27
Dear PeterJ,
Thanks for the info. I downloaded the source for
JBoss In Action, and built the Ch 15 production
database (from which I discovered some
minor configuring in the ch00/build.resources
file - designating MySQL as the target DB, as
well as providing MySQL root/pasword info).
In any case, the Ant build was successful, so
I now have a second production environment
with which to compare when encountering
issues going forward - thanks.
Unfortunately, when I executed the production
server configuration, I encountered the same
warning (i.e., ran the production server once,
which created the appropriate DB tables and
had no warning; then ran the production server
again, upon which the CREATE_TABLE warning
occurred).
It appears that the production implementation
provided by the example source for the
JBoss in Action book has the same issue
(i.e., a CREATE_TABLE warning on all
executions following the initial execution).
Thanks again for your suggestions.
...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209938#4209938
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209938
17 years, 2 months
[Persistence, JBoss/CMP, Hibernate, Database] - Dynamic Datasource invocation at runtime in JSF-EJB3-MySql a
by pragun@imcsystemsuk.com
This issue is regarding Dynamic Datasource invocation at runtime in JSF-EJB3-MySql application on Eclipse3.4.1-JBoss5.0.0 plateform.
I have created a sample JSF-EJB3-MySql application on JBoss5.0.0 AS. Application works fine which performs CRUD operation in database schema "schema1" on table "table1".
my JBoss5.0.0 server datasource file C:\jboss5.0.0\server\default\deploy\mysql-ds.xml looks like
<local-tx-datasource>
<jndi-name>DefaultDS</jndi-name>
<connection-url>jdbc:mysql://host1:3306/schema1</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>username</user-name>
password
<min-pool-size>1</min-pool-size>
<max-pool-size>2</max-pool-size>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
<type-mapping>mySQL</type-mapping>
</local-tx-datasource>
my sample application has persistence.xml which looks like
<persistence-unit name="pmtest">
org.hibernate.ejb.HibernatePersistence
<jta-data-source>java:/DefaultDS</jta-data-source>
</persistence-unit>
Primary requirement for my new application is as below,
(1) Use JBoss Seam Framework to develop JSF-EJB3-MySql application on Eclipse3.4.1-JBoss5.0.0
(2) There are multiple databases (having exactly same table design structure)
running on single database server "host1" placed in a central "Head Office" location i.e.
jdbc:mysql://host1:3306/schema1
jdbc:mysql://host1:3307/schema2
jdbc:mysql://host1:3308/schema3
All the schemas listed above have has different JNDI name defined in mysql-ds.xml (multiple datasource configuration in one mysql-ds.xm file). As "table1" design structure is same in all the schema, the table1.java entity class of the application can be common.
(3) The application will be deployed on one application server machine placed at the same central "Head Office" location where the database server "host1" is placed. This single application will access multiple databases running on database server "host1". This application will be called by various "Branch Office" from any other location say "Branch1", "Branch2" etc.
So, is there any way in JBoss Seam framework using which, the application can identify which datasource to be invoked on the basis of "Branch User" login information ? i.e.
Branch1 user --> invoke Schema1 datasource
Branch2 user --> invoke Schema2 datasource
I came across an article by Spring that provides the features as explained in http://blog.springsource.com/2007/01/23/dynamic-datasource-routing/
So, can we implement the Dynamic Datasource invocation logic in JBoss Seam using JSF-EJB3-MySql application on Eclipse3.4.1-JBoss5.0.0 plateform ?
Thanks for your help in advance.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209928#4209928
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209928
17 years, 2 months