[jBPM] - problem with JPAKnowledgeService and LocalTaskService
by Ted Pan
Ted Pan [https://community.jboss.org/people/ted.pan] created the discussion
"problem with JPAKnowledgeService and LocalTaskService"
To view the discussion, visit: https://community.jboss.org/message/773504#773504
--------------------------------------------------------------
hi,
When I use JPAKnowledgeService and LocalTaskService, the process won't continue when complete the 2nd Human Task.
the following is the code fragment
| | Environment env = KnowledgeBaseFactory.newEnvironment()…
[View More]; |
| | env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa")); |
| | env.set( EnvironmentName.TRANSACTION_MANAGER,TransactionManagerServices.getTransactionManager()); |
| | | | |
| | Properties properties = new Properties(); |
| | properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory"); |
| | properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory"); |
| | KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties); |
| | KnowledgeBase kbase = readKnowledgeBase(); -- read knowledgebase |
| | |
| | ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); |
| | |
| | EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task"); |
| | org.jbpm.task.service.TaskService taskService = new org.jbpm.task.service.TaskService(emf, SystemEventListenerFactory.getSystemEventListener()); |
| | |
| | LocalTaskService localTaskService = new LocalTaskService(taskService); |
| | LocalHTWorkItemHandler localHTWorkItemHandler = new LocalHTWorkItemHandler(localTaskService,ksession, OnErrorAction.RETHROW); |
| | localHTWorkItemHandler.setLocal(true); |
| | localHTWorkItemHandler.connect(); |
| | ksession.getWorkItemManager().registerWorkItemHandler("Human Task", localHTWorkItemHandler); |
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/773504#773504]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
[View Less]
12 years, 4 months
[JBoss Remoting] - How to verify that an remote interface on client and server side is the same?
by windigo
windigo [https://community.jboss.org/people/windigo] created the discussion
"How to verify that an remote interface on client and server side is the same?"
To view the discussion, visit: https://community.jboss.org/message/773459#773459
--------------------------------------------------------------
Hi,
I've a fatclient consuming a @Remote ejb-service at jboss 6.1.0. Both client and server are sharing the same remote-interface.
To get a proxyobject for the service on client-side looks …
[View More]something like this:
Context context = new ...
EJBService service = context.lookup("jndiurl");
Since the EJBservice was sucessfully deployed at jboss and the jndi-url is sucessfully published I will always get a valid proxy-object on client side. The problem I'm facing quite often is that we update our cilentcode and forget to redeploy the updated server-application which is using this changed EJBService.
For.example after changing a method signature or add a new method in the interface its still possible on client-side to lookup a valid remote-proxy-object from an outversioned @Remote-EJBService on server-side. Only after invoking the changed methods on client side I got a stacktrace like this:
Exception in thread "main" java.lang.NullPointerException
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:345)
at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:586)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:218)
at org.jboss.remoting.Client.invoke(Client.java:2070)
at org.jboss.remoting.Client.invoke(Client.java:879)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
at $Proxy8.invoke(Unknown Source)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
at $Proxy7.bla(Unknown Source)
at EJBServiceClient.main(EJBServiceClient.java:33)
at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
at $Proxy8.invoke(Unknown Source)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
at $Proxy7.bla(Unknown Source)
at EJBServiceClient.main(EJBServiceClient.java:33)
Is it possible to check wether the packaged interface in the application-jars/ears/wars on client and server side are the same - something like the serialversionUID on entities?
thanks
Felix
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/773459#773459]
Start a new discussion in JBoss Remoting at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
[View Less]
12 years, 4 months
[JBoss Tools] - It's Beta Time for JBoss Tools and Developer Studio
by Max Rydahl Andersen
Max Rydahl Andersen [https://community.jboss.org/people/maxandersen] modified the blog post:
"It's Beta Time for JBoss Tools and Developer Studio"
To view the blog post, visit: https://community.jboss.org/community/tools/blog/2012/11/01/its-beta-time...
--------------------------------------------------------------
It's Beta time for JBoss Tools 4 and JBoss Developer Studio 6!
https://community.jboss.org/servlet/JiveServlet/showImage/38-4854-18193/j... https://community.jboss.org/servlet/…
[View More]JiveServlet/downloadImage/38-4854-181...
h4. Beta 1
Developer Studio: [ http://devstudio.jboss.com/earlyaccess Download] | Tools: [ http://www.jboss.org/tools/download Download] [ http://download.jboss.org/jbosstools/updates/development/juno/ Update Site] | [ http://docs.jboss.org/tools/whatsnew What's New] [ http://www.jboss.com/index.html?module=bb&op=viewforum&f=201 Forums] [ http://jira.jboss.com/jira/browse/JBIDE JIRA] [ http://twitter.com/jbosstools Twitter]
JBoss Tools is a set of plugins for Eclipse that complements, enhances and goes beyond the support that exists for JBoss and related technologies in the default Eclipse distribution.
JBoss Developer Studio is a fully bundled Eclipse distribution which not only includes the majority of JBoss Tools but also all its needed dependencies and 3rd party plugins allowing for an easy one-click and no-fuss installation.
If you are into doing your own bleeding edge eclipse plugin assembly, JBoss Tools is for you; if you are more into having something that "Just Works" then JBoss Developer Studio is the way to go.
h2. Installation
+JBoss Developer Studio+ comes with everything pre-bundled in its installer. Simply http://devstudio.jboss.com/earlyaccess download it from our early access site and run it like this:
java -jar jbdevstudio-<installername>.jar
*Note:* if you are on Windows or Mac OSX 64-bit we recommend you ensure to select the 32-bit option in the multi-platform installer to get Visual Page editor working and use much less memory.
+JBoss Tools+ requires a bit more:
This release requires at least Eclipse 4.2 but we recommend using the http://www.eclipse.org/downloads/packages/release/juno/sr1 Eclipse 4.2 JEE Bundle since then you get most of the dependencies preinstalled.
Once you have installed Eclipse, you either find us on /marketplace.eclipse.org/node/420896 Eclipse Marketplace under "JBoss Tools (Juno)" or use our update site directly.
The update site URL to use from Help > Install New Software... is:
http://download.jboss.org/jbosstools/updates/stable/juno/ http://download.jboss.org/jbosstools/updates/development/juno/
Note: SOA tooling for BPEL, Drools, Guvnor, jBPM, ESB, Modeshape, pi4soa, Savara, SwitchYard & Teiid are no longer included in the JBoss Tools release. They will become available separately later.
h2. Bring Your Own Eclipse
This beta introduces JBoss Developer Studio BYOE (Bring Your Own Eclipse) which allow you to install the plugins provided and supported in JBoss Developer Studio to your own existing Eclipse installation from Eclipse Marketplace.
We are currently waiting for it to be approved on Eclipse Marketplace so I cannot provide a direct link at time of writing this, but it should be available soon from "Help > Eclipse Marketplace..."
We are eager to hear how this BYOE option work for you and do please let us know ASAP if you spot issues with this new and more flexible way of installing Developer Studio! Thank you!
h2. Multiple OpenShift Servers
OpenShift now allows you to connect to multiple OpenShift servers, i.e. your own Origin server as well as hosted openshift.
h2. And more...
See the full list of changes in Alpha1, Alpha2 and now Beta1 at the http://docs.jboss.org/tools/whatsnew/ What's New and Noteworthy and of course a good bunch of bug fixes and adjustments for running well in Eclipse 4.2/Juno.
Have fun!
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/community/tools/blog/2012/11/01/its-beta-time...]
[View Less]
12 years, 4 months
[Beginner's Corner] - Mapping global jndi to enc
by Tomas Toss
Tomas Toss [https://community.jboss.org/people/tomas_toss] created the discussion
"Mapping global jndi to enc"
To view the discussion, visit: https://community.jboss.org/message/773430#773430
--------------------------------------------------------------
Hi!
I apologize in advance if the answear to my question is obvious. I started to use jboss as7 (and Java EE) last week, so I'm not that familiar with the terminology and concepts.
I have made some sample ejb3 applications (like …
[View More]helloWorld) and have got them running. However, I'm still (very) confused regarding the configuration of the resources (datasource) and the corresponding injection in the beans.
For instance, I have created a simple statless bean which only task is to extract some values from a mysql database:
[code]
package logic;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.sql.DataSource;
/**
* Session Bean implementation class SimpleBean
*/
@Stateless
public class SimpleBean implements SimpleBeanRemote {
@Resource(name="mysqlDS", mappedName = "java:jboss/datasources/mysqlDS")
private DataSource dataSource;
private Connection connection;
@PostConstruct
public void openConnection() {
try {
connection = dataSource.getConnection();
} catch (SQLException e) {
e.printStackTrace();
}
}
@PreDestroy
public void closeConnection() {
try {
if(connection!=null){
connection.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
public String test() {
String msg = "";
try {
Statement statement = connection.createStatement();
String sql = "SELECT * from test";
statement.execute(sql);
ResultSet rs = statement.getResultSet();
rs.first();
msg = rs.getString(1);
msg += " " + rs.getInt(2);
} catch (SQLException e) {
e.printStackTrace();
}
return "SimpleBean: " + msg;
}
}
}
[/code]
I have been able to run this code successfully, but I feel that the explicit lookup with *jboss:java/datasources/mysqlDS* is not a good (portable) solution. From what I have gathered, it is possible to map the global resource name to a logical application specific name (e.g. *jdbc/mysql*).
I have tried using jboss-ejb3.xml and ejb-jar.xml to create this mapping, but can't figure out how to make it work. Am I on the right track, and if so could you give me a concrete example of such a mapping?
(I find it very hard to find well structured information about these kind of issues. Are there any online resources for beginners that covers ejb3/jboss as7?)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/773430#773430]
Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
[View Less]
12 years, 4 months