[EJB3] - Singleton in clustered JBoss AS 6 Final
by Dan Osterrath
Dan Osterrath [http://community.jboss.org/people/DanOsterrath] created the discussion
"Singleton in clustered JBoss AS 6 Final"
To view the discussion, visit: http://community.jboss.org/message/583084#583084
--------------------------------------------------------------
Hello to everyone,
I have a singleton session bean that handles some nightly database cleanup and import. This is done via @Singleton and @Schedule annotation. Unfortunately when deploying in a cluster this bean is executed on all nodes.
package session;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;
import javax.ejb.Schedule;
import javax.ejb.Singleton;
import org.jboss.ejb3.annotation.Clustered;
@Singleton
@Clustered
public class MyScheduler {
@Schedule(second = "*/20", minute = "*", hour = "*", persistent = false)
public void printTime() {
System.out.println(getHostName() + ": " + new Date());
}
private String getHostName() {
try {
InetAddress addr = InetAddress.getLocalHost();
return addr.getHostName();
} catch (UnknownHostException e) {
}
return "";
}
}
This example prints the hostname and the current time on all nodes.
That behaviour seems to fit the EJB 3.1 requirements but is quite useless for me (and probably others). So how can I implement an high available singleton in a cluster? If there is no way how can I block the other nodes singleton instances so that only one gets executed?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/583084#583084]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 5 months
[jBPM] - Problem with Orchestration projects
by Dnyanesh ginde
Dnyanesh ginde [http://community.jboss.org/people/dnyanesh.ginde] created the discussion
"Problem with Orchestration projects"
To view the discussion, visit: http://community.jboss.org/message/583203#583203
--------------------------------------------------------------
Hello,
I am using Jboss AS 5.1.0GA(jdk 6 version) and Jboss ESB-4.9. I have deployed Jboss ESB on the Jboss AS. I have changed the database from hsql DB to Oracle. Everything seems to be fine when I start the server. All the .esb are deployed in the default server profile. All the ESB and JBPM tables are created in the Oracle DB. There are no exceptions on server startup.
When I try to run the Orchestration projects given in the samples directory of the Jboss-4.9 distribution the following happens
1) ant deploy process runs fine.
2) ant deployProcess runs fine.
3) The ant startProcess fails with the following exception:
03:45:15,377 ERROR [GraphElement] action threw exception: null
java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.jbpm.instantiation.Delegation.instantiate(Delegation.java:162)
at org.jbpm.instantiation.Delegation.getInstance(Delegation.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(Ja
vassistLazyInitializer.java:197)
at org.jbpm.instantiation.Delegation_$$_javassist_57.getInstance(Delegat
ion_$$_javassist_57.java)
at org.jbpm.graph.def.Action.execute(Action.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(Ja
vassistLazyInitializer.java:197)
at org.jbpm.graph.def.Action_$$_javassist_80.execute(Action_$$_javassist
_80.java)
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(Ja
vassistLazyInitializer.java:197)
at org.jbpm.graph.def.Node_$$_javassist_127.executeAction(Node_$$_javass
ist_127.java)
at org.jbpm.job.ExecuteActionJob.execute(ExecuteActionJob.java:33)
at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.
java:172)
at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:63
)
The process is deployed in the database and I can view the process in the jbpm-console.
Can anybody kindly help me with this error? I am a newbie to Jboss ESB.
Thanks & Regards,
Dnyanesh Ginde
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/583203#583203]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 5 months
[jBPM] - How to Launching Workflows from (jms) events
by Brian Wallis
Brian Wallis [http://community.jboss.org/people/bwallis42] created the discussion
"How to Launching Workflows from (jms) events"
To view the discussion, visit: http://community.jboss.org/message/582243#582243
--------------------------------------------------------------
One integration point for our system is that we have an event bus from which state change and other interesting events about system activities can be received. One of these events is called a "Discharge" and contains some info about a person and an event that happened at a point it time.
We need to launch a workflow instance on reception of this event. In the future we may need to launch two or more different workflows from this same event or other events available in the system.
So when I introduce a new workflow (via guvnor I suppose) the workflow needs to register itself somehow so that new instances are created when events matching specified criteria are received.
* Is there a mechanism for doing something like this or is it up to me to implement it.
* Where would this "workflow launch" metadata live, it should be packaged with the workflow.
* Can I query guvnor for which workflows are available and get metadata from them so i can setup the JMS filter
ok, I'm out of my depth now. Not sure of the correct approach.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/582243#582243]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 5 months