-
15. Re: change database
kukeltje Jan 24, 2007 12:46 PM (in response to jbmpuser)The documentation can...
-
16. Re: change database
fuligj Jan 25, 2007 4:24 AM (in response to jbmpuser)But for example in jbpm-jpdl-3.2.Beta1 there is no jbpm.sar in deploy directory, refered by the documentation section 8.1.5.
-
17. Re: change database
fuligj Jan 26, 2007 4:16 AM (in response to jbmpuser)I have tried to change th db in jbpm-jpdl-3.2.Beta1.
but...:10:05:30,047 DEBUG [JobExecutorThread] acquiring jobs for execution... 10:05:31,062 DEBUG [JbpmContextInfo] creating jbpm context with service factorie s '[tx, message, scheduler, logging, persistence, authentication]' 10:05:31,062 DEBUG [JbpmContext] creating org.jbpm.JbpmContext@193b604 10:05:31,062 DEBUG [DbPersistenceServiceFactory] creating persistence service 10:05:31,062 DEBUG [DbPersistenceService] creating hibernate session 10:05:31,078 DEBUG [DbPersistenceService] beginning hibernate transaction 10:05:31,078 DEBUG [JobExecutorThread] querying for acquirable job... 10:05:31,078 WARN [JDBCExceptionReporter] SQL Error: 1064, SQLState: 42000 10:05:31,078 ERROR [JDBCExceptionReporter] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right sy ntax to use near '1 job0_.ID_ as ID1_26_, job0_.VERSION_ as VERSION3_26_, job0_. DUEDATE_ as DUEDAT' at line 1 10:05:31,078 ERROR [JobSession] org.hibernate.exception.SQLGrammarException: cou ld not execute query 10:05:31,078 DEBUG [JbpmContext] closing JbpmContext 10:05:31,078 DEBUG [Services] closing service 'persistence': org.jbpm.persistenc e.db.DbPersistenceService@148ab5c 10:05:31,078 DEBUG [DbPersistenceService] committing hibernate transaction 10:05:31,078 DEBUG [DbPersistenceService] closing hibernate session 10:05:31,078 DEBUG [Services] closing service 'tx': org.jbpm.tx.TxService@1ea2de 1 10:05:31,078 ERROR [JobExecutorThread] exception in job executor thread. waiting 80000 milliseconds org.jbpm.JbpmException: couldn't get acquirable jobs at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:44) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread .java:111) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56 ) Caused by: org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j ava:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp er.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2148) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029) at org.hibernate.loader.Loader.list(Loader.java:2024) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.ja va:333) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java :172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.j ava:756) at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:40) ... 2 more Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an erro r in your SQL syntax; check the manual that corresponds to your MySQL server ver sion for the right syntax to use near '1 job0_.ID_ as ID1_26_, job0_.VERSION_ as VERSION3_26_, job0_.DUEDATE_ as DUEDAT' at line 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) at com.mysql.jdbc.Connection.execSQL(Connection.java:3176) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja va:1153) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java: 1266) at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery (WrappedPreparedStatement.java:236) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java: 186) at org.hibernate.loader.Loader.getResultSet(Loader.java:1669) at org.hibernate.loader.Loader.doQuery(Loader.java:662) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Lo ader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2145) ... 11 more
Can anyone help me? -
18. Re: change database
estaub Jan 26, 2007 8:02 AM (in response to jbmpuser)Search this forum for 'MySQL' and read the first thread you find, from 2 days ago. Use search before you post a problem.
The search button is one of the little blue buttons across the top of the screen. (I'm not being insulting - it's just not very obvious!)
-Ed Staub -
19. Re: change database
fuligj Jan 29, 2007 7:29 AM (in response to jbmpuser)Thanks for reply Ed Staub!
I have used the search button many times and I will too. I have succeeded the problem, in jBPM 3.1. there was no jbpm_job table in DB, but in 3.2 there is. Now zero error message appears in console, but I can't log in with any username in the webapp at http://localhost:8080/jbpm-console/.
The topic that you suggested deal with older jBPM.
I have used my jBPM 3.1.3 without rebuke.
Forasmuch no error message, i don't know what should i do to resolve my problem.
best regards! -
20. Re: change database
fuligj Feb 6, 2007 9:38 AM (in response to jbmpuser)I think jbpm-jpdl-3.2.Beta1's documentation is not correct, because for example there is no jbpm.sar in deploy directory, refered by the documentation section 8.1.5.
So has anybody a working solution to change the db in jbpm-jpdl-3.2.Beta1?
best regards! -
21. Re: change database
estaub Feb 6, 2007 10:12 AM (in response to jbmpuser)As you probably know, there is a .sar file in the 3.1.2 deploy directory.
In 3.1.2, you have to run antfile build.deploy.xml after running build.xml to build the deployment.
(I haven't tried 3.2 - I just thought these might point you at something you might have forgotten.)
-Ed Staub -
22. Re: change database
crussell42 Feb 6, 2007 11:09 AM (in response to jbmpuser)Two issues here
1. changing db for 3.2.beta1. Assuming you want to change the jbpm-enterprise.ear you can expand the ear and change hibernate.cfg.cml. Here is a ant build script I created to expand the ear, edit the config files then recreate the ear.
So "ant expand", edit expand/lib/jbpm-configs-jar/hibernate.cfg.xml, "ant build","ant deploy"<project name="hpfm-jbpm"> <property name="basedir" value="."/> <property name="built.dir" value="${basedir}/built"/> <property name="expand.dir" value="${basedir}/expand"/> <property name="jboss.deploy.dir" value="/usr/local/jboss/server/messaging/deploy"/> <target name="clean"> <delete dir="${built.dir}" /> </target> <target name="prepare"> <mkdir dir="${built.dir}" /> <mkdir dir="${expand.dir}" /> </target> <target name="expand" description="expand ear into the expand dir" depends="prepare"> <!-- UNZIP THE EAR FILE --> <unzip src="${basedir}/jbpm-enterprise.ear" dest="${expand.dir}" /> <mkdir dir="${expand.dir}/jbpm-console-war" /> <unzip src="${expand.dir}/jbpm-console.war" dest="${expand.dir}/jbpm-console-war" /> <mkdir dir="${expand.dir}/jbpm-enterprise-jar" /> <unzip src="${expand.dir}/jbpm-enterprise.jar" dest="${expand.dir}/jbpm-enterprise-jar" /> <mkdir dir="${expand.dir}/lib/jbpm-configs-jar" /> <unzip src="${expand.dir}/lib/jbpm-configs.jar" dest="${expand.dir}/lib/jbpm-configs-jar" /> <mkdir dir="${expand.dir}/lib/jbpm-identity-jar" /> <unzip src="${expand.dir}/lib/jbpm-identity.jar" dest="${expand.dir}/lib/jbpm-identity-jar" /> <mkdir dir="${expand.dir}/lib/jbpm-jpdl-jar" /> <unzip src="${expand.dir}/lib/jbpm-jpdl.jar" dest="${expand.dir}/lib/jbpm-jpdl-jar" /> </target> <target name="contract" description="remake all the parts to the parts directory" depends="prepare"> <!-- ZIP CONTENTS OF THE EXPAND/LIB DIRECTORY--> <zip destfile="${expand.dir}/lib/jbpm-jpdl.jar"> <fileset dir="${expand.dir}/lib/jbpm-jpdl-jar" /> </zip> <zip destfile="${expand.dir}/lib/jbpm-identity.jar"> <fileset dir="${expand.dir}/lib/jbpm-identity-jar" /> </zip> <zip destfile="${expand.dir}/lib/jbpm-configs.jar"> <fileset dir="${expand.dir}/lib/jbpm-configs-jar" /> </zip> <!-- ZIP CONTENTS OF THE EXPAND DIRECTORY--> <zip destfile="${expand.dir}/jbpm-enterprise.jar"> <fileset dir="${expand.dir}/jbpm-enterprise-jar" /> </zip> <zip destfile="${expand.dir}/jbpm-console.war"> <fileset dir="${expand.dir}/jbpm-console-war" /> </zip> </target> <!-- <target name="build" depends="prepare, make-parts"> <ear destfile="${built.dir}/jbpm-enterprise.ear" appxml="${parts.dir}/META-INF/application.xml"> <fileset dir="${parts.dir}"> <exclude name="META-INF/application.xml" /> </fileset> </ear> </target> --> <target name="build" depends="prepare, contract"> <ear destfile="${built.dir}/jbpm-enterprise.ear" appxml="${expand.dir}/META-INF/application.xml"> <fileset dir="${expand.dir}" includes="*.war,*.jar,lib/*.jar" > <!-- <exclude name="META-INF/application.xml" /> <exclude name="jbpm-enterprise-jar" /> <exclude name="jbpm-console-war" /> <exclude name="lib/jbpm-identity-jar" /> <exclude name="lib/jbpm-configs-jar" /> <exclude name="lib/jbpm-jpdl-jar" /> --> </fileset> </ear> </target> <target name="deploy" depends="build"> <copy file="${built.dir}/jbpm-enterprise.ear" todir="${jboss.deploy.dir}"/> </target> </project>
2. Create and populate the identity tablescreate table JBPM_ID_GROUP (ID_ bigint generated by default as identity (start with 1), CLASS_ char( 1) not null, NAME_ varchar(255), TYPE_ varchar(255), PARENT_ bigint, primary key (ID_)); create table JBPM_ID_MEMBERSHIP (ID_ bigint generated by default as identity (start with 1), CLASS_ char(1) not null, NAME_ varchar(255), ROLE_ varchar(255), USER_ bigint, GROUP_ bigint, primary key ( ID_)); create table JBPM_ID_PERMISSIONS (ENTITY_ bigint not null, CLASS_ varchar(255), NAME_ varchar(255), ACTION_ varchar(255)); create table JBPM_ID_USER (ID_ bigint generated by default as identity (start with 1), CLASS_ char(1 ) not null, NAME_ varchar(255), EMAIL_ varchar(255), PASSWORD_ varchar(255), primary key (ID_)); alter table JBPM_ID_GROUP add constraint FK_ID_GRP_PARENT foreign key (PARENT_) references JBPM_ID_G ROUP; alter table JBPM_ID_MEMBERSHIP add constraint FK_ID_MEMSHIP_GRP foreign key (GROUP_) references JBPM _ID_GROUP; alter table JBPM_ID_MEMBERSHIP add constraint FK_ID_MEMSHIP_USR foreign key (USER_) references JBPM_ ID_USER; INSERT INTO JBPM_ID_GROUP VALUES(1,'G','participant','security-role',NULL) INSERT INTO JBPM_ID_GROUP VALUES(2,'G','administrator','security-role',NULL) INSERT INTO JBPM_ID_GROUP VALUES(3,'G','hr','organisation',NULL) INSERT INTO JBPM_ID_GROUP VALUES(4,'G','sales','organisation',NULL) INSERT INTO JBPM_ID_GROUP VALUES(5,'G','manager','security-role',NULL) INSERT INTO JBPM_ID_MEMBERSHIP VALUES(1,'M',NULL,NULL,2,2) INSERT INTO JBPM_ID_MEMBERSHIP VALUES(2,'M',NULL,NULL,3,1) INSERT INTO JBPM_ID_MEMBERSHIP VALUES(3,'M',NULL,NULL,3,3) INSERT INTO JBPM_ID_MEMBERSHIP VALUES(4,'M',NULL,NULL,2,3) INSERT INTO JBPM_ID_MEMBERSHIP VALUES(5,'M',NULL,NULL,1,4) INSERT INTO JBPM_ID_MEMBERSHIP VALUES(6,'M',NULL,'boss',2,4) INSERT INTO JBPM_ID_MEMBERSHIP VALUES(7,'M',NULL,NULL,2,5) INSERT INTO JBPM_ID_MEMBERSHIP VALUES(8,'M',NULL,NULL,2,1) INSERT INTO JBPM_ID_MEMBERSHIP VALUES(9,'M',NULL,NULL,1,1) INSERT INTO JBPM_ID_USER VALUES(1,'U','cookie monster','cookie.monster@sesamestreet.tv','cookie mons ter') INSERT INTO JBPM_ID_USER VALUES(2,'U','ernie','ernie@sesamestreet.tv','ernie') INSERT INTO JBPM_ID_USER VALUES(3,'U','bert','bert@sesamestreet.tv','bert') INSERT INTO JBPM_ID_USER VALUES(4,'U','grover','grover@sesamestreet.tv','grover') insert into JBPM_ID_USER (ID_, CLASS_, NAME_, EMAIL_, PASSWORD_) values ('1', 'U', 'cookie monster', 'cookie.monster@sesamestreet.tv', 'cookie monster'); insert into JBPM_ID_USER (ID_,CLASS_, NAME_, EMAIL_, PASSWORD_) values ('2', 'U', 'ernie', 'ernie@sesamestreet.tv', 'ernie'); insert into JBPM_ID_USER (ID_,CLASS_, NAME_, EMAIL_, PASSWORD_) values ('3', 'U', 'bert', 'bert@sesamestreet.tv', 'bert'); insert into JBPM_ID_USER (ID_,CLASS_, NAME_, EMAIL_, PASSWORD_) values ('4', 'U', 'grover', 'grover@sesamestreet.tv', 'grover');
-
23. Re: change database
fuligj Feb 7, 2007 7:20 AM (in response to jbmpuser)Thanks for reply!
I have made all as you said and deployed the recreated ear file in server's deploy directory. But when I try to log in I receive an error message:/search/form/formtemplate.xhtml @14,73 session="#{jbpmBean.jbpmContext.session}": org.hibernate.HibernateException: Unable to locate current JTA transaction
. -
24. Re: change database
crussell42 Feb 7, 2007 8:19 AM (in response to jbmpuser)Yes, here is where it gets tricky. I also am having that problem and am trying to get a response on how to configure either CMT ot JTA for the ear.
I will add the reference posting here when If I ever get a response.
One thing you can do now to continue your journey however is
edit expand/lib/jbpm-configs-jar/jbpm.cfg.xml
Make sure the following two are set to false.<field name="isCurrentSessionEnabled"><false /></field> <field name="isTransactionEnabled"><false /></field>
-
25. Re: change database
fuligj Feb 7, 2007 9:31 AM (in response to jbmpuser)I tried to copy the jbpm-enterprise.ear to the deploy directory in an original 3.2.beta1 and the error message was the same, so i think something is wrong with it. I think that is not enough, change only the hibernate.cfg.xml, i think we should change the data source and much more.
It is most desirable, when we have a list, what should we to do, to change the database in jbpm-jpdl-3.2.Beta1.