[JBoss jBPM] - Re: JBPM IDentity
by cheets
hi OM,
in order to use ur own tables for user mgmnt,
u need to implement AssignmentHandler urself, and use it as:
<task-node name="TASK1">
| <task name="TASK1">
| <assignment class="a.b.c.d.TaskAssignmentHandler"/>
| </task>
| <transition name="" to="NEXT_NODE"></transition>
| </task-node>
the class itself would be something like this:
| public class TaskAssignmentHandler implements AssignmentHandler{
|
| private static final long serialVersionUID = 1L;
|
| public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception {
| String taskName = executionContext.getTaskInstance().getTask().getName();
| long id = executionContext.getProcessInstance().getId();
|
| //GET POOLED ACTORS AS STRING[] HERE AND ASSIGN.
| String pooledActors = util.getPooledActorsForTask(taskName);
| //util is a class i have created to
| //interact with my tables, and return the pooled actors for the given taskname.
| //it contains a mapping for taskname-user role, and based on user role,
| //it returns a comma-separated string of all users in that role.
| if( pooledActors != null ){
| log.debug(" Assigning task ="+taskName+" to group ="+pooledActors);
| assignable.setPooledActors(pooledActors.split(","));
| }
| else{
| System.out.println("COULD NOT ASSIGN POOL TO TASK");
| }
| //u can also set the actorId here explicitly, i am doing it in another class as:
| /*TaskInstance task = jbpmContext.getTaskInstanceForUpdate
| (taskId.longValue());
| task.setActorId(actorId);
| jbpmContext.save(task); */
| }
| }
|
that's it, u r ready to use ur user tables with jbpm now! :)
(at least, this works for me ;) )
HTH..
:)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068995#4068995
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068995
18Â years, 8Â months
[JBoss Tools (users)] - Re: Seam Project on Jboss 4.0.5
by dgolovin
Hello
For now Seam wizard uses seam-gen templates for project. It works only for JBoss AS 4.2.X. To have it worked you need the patched version of seam-gen. You can get it from :pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jboss/jboss-seam/seam-gen Seam_1_2_AP (Branch). It contains all fixes related to Seam wizard.
Replace your seam-gen folder inside seam home folder with one from 1_2_AP branch and try last nightly build. You will able create a seam projects in war and ear deployment configurations.
On JSF Capabilities wizard step select 'Server supplied implementation', it ifacet is required to enable JSF functionality from WTP on created project.
Use JBoss AS 4.2 Server Adapter from WTP. There are several problems in JBoss AS server adapter provided by RHDS.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068993#4068993
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068993
18Â years, 8Â months
[JBoss jBPM] - Re: Stale state problem kills process instance?
by justin.zhou
I have the similar problem with hibernate323, jbpm321, jboss420.
anonymous wrote : 2007-07-30 23:14:20,714 5742606 ERROR [com.rrd.pmt.workflow.service.Task] (pool-6-thread-1:)
| org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.graph.exe.Token#11804]
| at org.hibernate.persister.entity.AbstractEntityPersister.forceVersionIncrement(AbstractEntityPersister.java:1235)
| at org.hibernate.event.def.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:82)
| at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:64)
| at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:584)
| at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:576)
| at org.jbpm.graph.node.Join.execute(Join.java:109)
| at org.jbpm.graph.def.Node.enter(Node.java:318)
| 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.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| at org.jbpm.graph.def.Node_$$_javassist_544.enter(Node_$$_javassist_544.java)
| at org.jbpm.graph.def.Transition.take(Transition.java:151)
| at org.jbpm.graph.def.Node.leave(Node.java:393)
| 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.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
| at org.jbpm.graph.def.Node_$$_javassist_544.leave(Node_$$_javassist_544.java)
| at org.jbpm.graph.exe.Token.signal(Token.java:194)
| at org.jbpm.graph.exe.Token.signal(Token.java:139)
| at com.rrd.pmt.workflow.service.AbstractTaskExecutorService.doTranstion(AbstractTaskExecutorService.java:123)
| at com.rrd.pmt.workflow.service.Task.run(Task.java:40)
| at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
| at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
| at java.util.concurrent.FutureTask.run(FutureTask.java:123)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
| at java.lang.Thread.run(Thread.java:613)
|
The strange thing is if I use ejb timers to execute all the fork steps, everything is fine. However, if driving one of the fork steps with external jbpmconfigure, although still using the same hibernate session factory as other timers steps, it will have this error, my external jbpmconfig code looks like:
caller:
|
| public void doTranstion(long id, String tokenPath, String path) throws Exception {
| JbpmContext jbpmContext = JbpmUtil.getJbpmConfig().createJbpmContext();
| try {
| ProcessInstance processInstance = jbpmContext.loadProcessInstanceForUpdate(id);
| if (processInstance == null) {
| logger.debug("ProcessInstance " + id + " does not exist anymore. Ignore it");
| return;
| }
|
| Token token = processInstance.findToken(tokenPath);
| logger.info("ProcessIntance " + processInstance.getId() + " changing from node[" + token.getNode().getDefaultLeavingTransition().getFrom().getName() + "] to node["
| + token.getNode().getDefaultLeavingTransition().getTo().getName() + "]" + ". File=" + path);
| token.signal();
| } catch (Exception e) {
| logger.error("", e);
| throw e;
| } finally {
| jbpmContext.close();
| }
| }
|
|
|
| public class JbpmUtil {
| static Logger logger = Logger.getLogger(JbpmUtil.class);
| static private JbpmConfiguration jbpmConfiguration = null;
|
| synchronized static public JbpmConfiguration getJbpmConfig() {
| if (jbpmConfiguration == null) {
| jbpmConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml");
| }
|
| return jbpmConfiguration;
| }
| ...}
Using treecache with serializable isolation. Token used in the code is retrieved from
ExecutionContext.getToken().getFullName();
Still wondering what is difference here? Should treecache take care this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068989#4068989
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068989
18Â years, 8Â months
[Messaging, JMS & JBossMQ] - MDB run error
by pansw2
JMSClient.java
package com;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class JMSClient {
/**
* @param args
*/
private QueueConnection queueConnection=null;
private QueueSender queueSender=null;
private QueueSession queueSession=null;
private Queue queue=null;
private TextMessage msg = null;
public JMSClient(String[] argv) throws Exception {
try {
InitialContext ctx=new InitialContext();
QueueConnectionFactory factory=(QueueConnectionFactory)ctx.lookup("java:comp:/env/jms/QueueConnectionFactory");
queueConnection = factory.createQueueConnection();
// Create a non-transacted JMS Session
queueSession =queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
queue = (Queue) ctx.lookup("Queue/TempMDB");
queueSender = queueSession.createSender(queue);
msg = queueSession.createTextMessage();
queueConnection.start();
} catch (Exception e) {
System.err.println(
"Error while attempting to "
+ "connect to the server and look up the JMS"
+ " QueueConnectionFactory.");
System.err.println(
"Please make sure that you have"
+ " deployed the JMS Queue and specified the correct"
+ " server URL.");
e.printStackTrace();
throw e;
}
}
public void send(String message) throws JMSException {
try {
msg.setText(message);
queueSender.send(msg);
} catch (JMSException e) {
System.err.println(
"Exception raised while sending" + "to queue: " );
e.printStackTrace();
throw e;
}
}
public static void main(String[] argv) throws Exception {
JMSClient tmsc = new JMSClient(argv);
tmsc.send("Hello");
}
}
----------------------------------------------------------------------------------------------------------------------
TempMDB.java
package com;
import javax.ejb.EJBException;
import javax.ejb.MessageDrivenBean;
import javax.ejb.MessageDrivenContext;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
public class TempMDB implements MessageDrivenBean, MessageListener {
/** The MessageDrivenContext */
private MessageDrivenContext context;
public TempMDB() {
// TODO Auto-generated constructor stub
}
public void ejbRemove() throws EJBException {
// TODO Auto-generated method stub
}
public void setMessageDrivenContext(MessageDrivenContext newContext)
throws EJBException {
context = newContext;
}
public void onMessage(Message inMessage) {
// TODO Auto-generated method stub
TextMessage msg = null;
try {
if (inMessage instanceof TextMessage) {
msg = (TextMessage) inMessage;
System.out.println
("MESSAGE BEAN: Message received: "
+ msg.getText());
} else {
System.out.println
("Message of wrong type: "
+ inMessage.getClass().getName());
}
} catch (JMSException e) {
e.printStackTrace();
} catch (Throwable te) {
te.printStackTrace();
}
}
public void ejbCreate() {
}
}
----------------------------------------------------------------------------------------------------------------------
E:\jboss-4.0.0\server\default\deploy\jms\jbossmq2-destinations-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Destination without a configured SecurityManager or without a
a SecurityConf will default to role guest with read=true, write=true,
create=false.
-->
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager
----------------------------------------------------------------------------------------------------------------------
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<message-driven>
<ejb-name>TempMDB</ejb-name>
<ejb-class>com.TempMDB</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
<subscription-durability>NonDurable</subscription-durability>
</message-driven-destination>
<resource-ref>
<res-ref-name>jms/QCF</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</message-driven>
</enterprise-beans>
</ejb-jar>
----------------------------------------------------------------------------------------------------------------------
jboss.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
<enterprise-beans>
<message-driven>
<ejb-name>TempMDB</ejb-name>
<destination-jndi-name>queue/TempMDB</destination-jndi-name>
<configuration-name>Standard Message Driven Bean</configuration-name>
<resource-ref>
<res-ref-name>jms/QCF</res-ref-name>
<jndi-name>QueueConnectionFactory</jndi-name>
</resource-ref>
</message-driven>
</enterprise-beans>
----------------------------------------------------------------------------------------------------------------------
After deploying the project and run "JMSClient.java", it occured the error which are the following.
Error while attempting to connect to the server and look up the JMS QueueConnectionFactory.
Please make sure that you have deployed the JMS Queue and specified the correct server URL.
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory ]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.(InitialContext.java:175)
at com.JMSClient.(JMSClient.java:30)
at com.JMSClient.main(JMSClient.java:77)
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
... 5 more
Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory ]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.(InitialContext.java:175)
at com.JMSClient.(JMSClient.java:30)
at com.JMSClient.main(JMSClient.java:77)
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
... 5 more
I have tried the project all day,but it occured all the time.People who is researching MDB ,please help me.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068988#4068988
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068988
18Â years, 8Â months
[JBoss Seam] - GWT example: WebRemote method always returns failure
by kingcu
This is an issue regarding @WebRemote in the seam-gwt example, running on JBoss 4.2.0 with Seam 2.0.0 B1. The GWT compilation output files are shipped with seam 2.0 under examples/remoting/gwt/view and there are 16 files, when I just run "ant deploy" (which uses the shipped GWT files). It works fine: when clicking on the "Add" button, I get the following message from the server:
42. Its the real question that you seek now.
However, if I first run "ant gwt-compile" (using the source shipped with seam 2.0 distribution), it compiles the gwt code and generates 22 files under /view. Then, after I deploy it, when I click on the "Ask" button, I got the following message:
{OK}[1,["42. Its the real question that you seek now."],0,2]
Since, in the AsyncCallback object, both onFailure() and onSuccess() call Window.alert() to display a message, to distinguish, I changed the message text:
public void onFailure(Throwable t)
| {
| Window.alert("Failure - " + t.getMessage());
| }
|
| public void onSuccess(Object data)
| {
| Window.alert("Success - " + (String) data);
| }
|
Then, I get the following message:
Failure - {OK}[1,["42. Its the real question that you seek now."],0,2]
which indicates that the @WebRemote method is always returning failure. I tried both GWT 1.3.3 and GWT 1.4.10 and got the same result.
It seems to me that the gwt example source and the shipped gwt-compilation output are out-of-sync: 22 files vs. 16 files and the obviously different behavior. Can someone please clarify? Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068987#4068987
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068987
18Â years, 8Â months