[JBoss jBPM] - Re: change database
by crussell42
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 tables
| create 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(a)sesamestreet.tv','cookie mons
| ter')
| INSERT INTO JBPM_ID_USER VALUES(2,'U','ernie','ernie(a)sesamestreet.tv','ernie')
| INSERT INTO JBPM_ID_USER VALUES(3,'U','bert','bert(a)sesamestreet.tv','bert')
| INSERT INTO JBPM_ID_USER VALUES(4,'U','grover','grover(a)sesamestreet.tv','grover')
|
| insert into JBPM_ID_USER (ID_, CLASS_, NAME_, EMAIL_, PASSWORD_)
| values ('1', 'U', 'cookie monster', 'cookie.monster(a)sesamestreet.tv', 'cookie monster');
| insert into JBPM_ID_USER (ID_,CLASS_, NAME_, EMAIL_, PASSWORD_)
| values ('2', 'U', 'ernie', 'ernie(a)sesamestreet.tv', 'ernie');
| insert into JBPM_ID_USER (ID_,CLASS_, NAME_, EMAIL_, PASSWORD_)
| values ('3', 'U', 'bert', 'bert(a)sesamestreet.tv', 'bert');
| insert into JBPM_ID_USER (ID_,CLASS_, NAME_, EMAIL_, PASSWORD_)
| values ('4', 'U', 'grover', 'grover(a)sesamestreet.tv', 'grover');
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011993#4011993
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011993
19Â years, 2Â months
[Tomcat, HTTPD, Servlets & JSP] - JSP refresh problem via proxy...
by dgout73
Hello...
I am working with jsp pages and ejbs.
The problem that i have is when i am trying to call a specific jsp
page from server in a network without passing thru a proxy the page
is changing as i have programmed(Changing labels from English to Greek
and vice versa).
While i am trying to call the same page thru a proxy then the page
dosen't change and give me the same result.(Labels in English always)
In my jsp exists :
response.setHeader("pragma","no-cache");
response.setHeader("Cache-Control","no-cache");
response.setHeader("Cache-Control","no-store");
response.addDateHeader("Expires", 0);
response.setDateHeader("max-age", 0);
response.setIntHeader("Expires", -1); //prevents caching at the proxy server
response.addHeader("cache-Control", "private"); //IE5.x only;
It look like caching problem?
Should i change something into the standardjboss.xml file?
Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011987#4011987
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011987
19Â years, 2Â months
[JBoss Seam] - Transaction Exception with Seam and EJB3
by nloomis
Hi, I'm having problems synchronizing with the JTA Transaction Manager from within a Seam component when I come from an MDB that is not a Seam component. I tried making the MDB a Seam component but Seam didn't like that (another issue I'm not concerned about at the moment because I switched it to use all EJB3 annotations). Now, I keep getting a Transaction Exception when my stateless beans try to process. The code is below. I've tried changing the Transaction Attribute of the MDB to unsupported and the method attribute to Required but I still get the error. Any help is greatly appreciated.
Exception
---------------------------------------------------------------------------
09:40:26,295 WARN [TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=3Q9HWB1/14, BranchQual=, localId=14] timed out. status=STATUS_ACTIVE
09:40:28,185 INFO [ProvisionSuccessBean] confirmProvisioning: 24243
09:40:36,888 INFO [ProvisionSuccessBean] injected jbpmConext -> org.jbpm.JbpmContext@1885947
09:40:45,560 ERROR [STDERR] org.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:174)
at org.hibernate.impl.SessionImpl.checkTransactionSynchStatus(SessionImpl.java:1850)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:868)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:801)
at org.jbpm.db.GraphSession.getProcessInstance(GraphSession.java:291)
at org.jbpm.JbpmContext.getProcessInstance(JbpmContext.java:331)
at com.evergreen.accesscontrol.impl.ProvisionSuccessBean.confirmProvisioning(ProvisionSuccessBean.java:67)
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.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:51)
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.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
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.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:51)
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.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
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.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:112)
at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
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.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:201)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:227)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:59)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
at $Proxy202.confirmProvisioning(Unknown Source)
at com.evergreen.accesscontrol.impl.AccessControlReceiveMDB.onMessage(AccessControlReceiveMDB.java:77)
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.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:97)
at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
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.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocat
09:40:45,592 ERROR [STDERR] ion.java:101)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:201)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.mdb.MDB.localInvoke(MDB.java:865)
at org.jboss.ejb3.mdb.MDB.localInvoke(MDB.java:844)
at org.jboss.ejb3.mdb.MDB$MessageListenerImpl.onMessage(MDB.java:1074)
at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
at progress.message.jimpl.Session.dU_(Unknown Source)
at progress.message.jimpl.Session.run(Unknown Source)
at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.transaction.RollbackException: Already marked for rollback TransactionImpl:XidImpl[FormatId=257, GlobalId=3Q9HWB1/14, BranchQual=, localId=14]
at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:635)
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:164)
... 115 more
MDB
------------------------------------------------------------------------------
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/SonicJMS/Queues/AccessControl/Receive"),
@ActivationConfigProperty(propertyName = "providerAdapterJNDI", propertyValue = "java:/SonicJMSProvider"),
@ActivationConfigProperty(propertyName = "useDLQ", propertyValue = "false")
}
)
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class AccessControlReceiveMDB implements MessageListener {
// public static final String ACCESS_DATA_XPATH = "declare namespace
// ac='http://www.evergreeninvestments.com/accessControl' "
// + "declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance' "
// + ".//ac:accessData";
private Log log = LogFactory.getLog(AccessControlReceiveMDB.class);
@EJB(beanName="ProvisionSuccessBean")
private ProvisionSuccess successfulResponse;
@EJB(beanName="ProvisionFailureBean")
private ProvisionFailure failedResponse;
/*
* (non-Javadoc)
*
* @see com.evergreen.accesscontrol.impl.AccessControlReceive#onMessage(javax.jms.Message)
*/
//(a)TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void onMessage(javax.jms.Message message) {
log.info("Message Received!");
log.info(message);
try {
// Grab Message Type from header.
MessageTypes messageType = null;
try {
messageType = MessageTypes.valueOf(message
.getStringProperty(MessageHeaderKeys.MessageType
.toString()));
} catch (Exception e) {
messageType = MessageTypes.ProvisionFailure;
}
log.info("MessageType -> " + messageType.toString());
Long processId = null;
switch (messageType) {
case ProvisionSuccess:
// Grab process id from header.
try {
processId = Long.valueOf(message.getStringProperty(MessageHeaderKeys.ProcessId.toString()));
} catch (Exception e) {
throw new Exception("Missing Process Id in Message Header. " + e);
}
successfulResponse.confirmProvisioning(processId);
break;
ProvisionSuccessBean - Stateless EJB
----------------------------------------------------------------------------------
@Stateless
@Name("provisionSuccess")
public class ProvisionSuccessBean implements ProvisionSuccess {
@Logger
protected Log log;
@PersistenceContext(unitName = "controlDatabase")
protected EntityManager em;
@In(create = true)
private JbpmContext jbpmContext;
/*
* (non-Javadoc)
*
* @see com.evergreen.accesscontrol.message.ProvisionResponse#confirmProvisioning()
*/
public String confirmProvisioning(Long processId) {
log.info("confirmProvisioning: " + processId);
// Load the JBPM context and the task
log.info("injected jbpmConext -> " + jbpmContext);
try {
ProcessInstance process = jbpmContext.getProcessInstance(processId); <--------- exception occurs here
Long accessRequestId = (Long) process.getContextInstance()
.getVariable("accessRequestId");
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011975#4011975
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011975
19Â years, 2Â months