[JBoss jBPM] - User cancels while actioning a task
by slienert
We have just started a new project using JBPM 3.1 and need some advice on how to handle a common situation.
We have a simple process definition with a start, a task and an end. The user actions the task via a screen which allows them to add indexing information to a document. The case we are not sure about is when the user presses the cancel button.
The user chooses a task from a worklist screen. When they pick a task we start the task using TaskInstance.start() which sets the startDate on the task instance (this means we can prevent other users from choosing this task). If we then use the TaskInstance.cancel() method when the user clicks the cancel button, the task endDate and isCancelled are also set.
>From a functional point of view we want a cancelled task to appear in the worklist again ready for actioning. What is the "standard" way to achieve this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976205#3976205
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976205
19 years, 7 months
[JCA/JBoss] - connection.setAutoCommit(true) doesn't seems to bubble up th
by dangelo1
I have a no-tx-datasource in JBOSS 4.0.4 and I do the following:
DataSource datasource = (DataSource) context.lookup("noTxDatasource")
Connection connection = null;
try{
datasource.getConnection();
connection.setAutoCommit(false)
//do some stuff with connection
connection.commit();
}
finally{
if(connection != null){
try{
connection.setAutoCommit(true);
connection.close()
}
catch(SqlException e){
//log warning
}
}
}
The reason I'm calling the setAutoCommit(true) in the connection just before closing (or returning it to the pool) is that the Inet driver that I'm using seems to be opening a transaction after closing the connection (if autocommit is set to false). I inferred this because I debugged through the code and obtained a connection from DriverManager and inspected the autocommit flag and the open transactions in the database and after commit there is indeed a new transaction, but as soon as I have set AutoCommit back to true is closes the transaction.
But my problem is doing this through JBOSS doesn't seem to work. I tried to set the AutoCommit back to true but looking at the database is still seems to appear the calling setAutoCommit(true) doesn't do anything because I still have an open transaction in the database.
Can anyone help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976204#3976204
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976204
19 years, 7 months
[Installation, Configuration & Deployment] - springframework unknownHostException
by jamieg99
Hello,
if anyone can point me in the right direction with this, I'd be very grateful.
I'm trying to deploy my application offline, but keep hitting an java.net.UnknownHostException exception because jboss can't resolve the spring dtd (http://www.springframework.org/dtd/spring-beans.dtd). I've added it to the entity map on the JBossEntityResolverMgr service, but doesn't seem to make a difference, even when I put a jar containing the spring-bean.dtd in the jre lib/ext dir.
It's not an issue with an internet connection.
I'm using jboss-4.0.3SP1 with jdk1.5 and xerces 2.8
cheers
-Jamie
2006-10-05 11:32:16,624 WARN [org.jboss.util.xml.JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://www.springframework.org/dtd/spring-beans.dtd
2006-10-05 11:32:16,811 DEBUG [org.jboss.util.xml.JBossEntityResolver] Failed to obtain URL.InputStream from systemId: http://www.springframework.org/dtd/spring-beans.dtd
java.net.UnknownHostException: www.springframework.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
at sun.net.www.http.HttpClient.(HttpClient.java:214)
at sun.net.www.http.HttpClient.New(HttpClient.java:287)
at sun.net.www.http.HttpClient.New(HttpClient.java:299)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:913)
at java.net.URL.openStream(URL.java:1007)
at org.jboss.util.xml.JBossEntityResolver.resolveSystemIDasURL(JBossEntityResolver.java:326)
at org.jboss.util.xml.JBossEntityResolver.resolveEntity(JBossEntityResolver.java:198)
at org.apache.xerces.util.EntityResolverWrapper.resolveEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.jboss.deployment.SARDeployer.parseDocument(SARDeployer.java:586)
at org.jboss.deployment.SARDeployer.init(SARDeployer.java:164)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:843)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:863)
at org.jboss.deployment.MainDeployer.init(MainDeployer.java:863)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:780)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy6.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:489)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976203#3976203
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976203
19 years, 7 months
[EJB 3.0] - EntityManagerFactory null from JNDI?
by rocken7
EntityManagerFactory is null in jndi. No errors, no warnings, notta just null or "not found" etc.
Yep I've seen posts on this, but no good answer.
jboss-4.0.4.GA
So far my SLSB beans work remotely for unit tests.
But ...
How do you get an EntitManagerFactory from outside the container?
JNDI always returns either not found or null.
In my META-INF/persistence.xml file (of the deployed test jar):
<?xml version="1.0" encoding="UTF-8"?>
| <persistence>
| <persistence-unit name="fudb">
| <jta-data-source>java:/MySqlDS</jta-data-source>
| <exclude-unlisted-classes>false</exclude-unlisted-classes>
| <class>com.fubar.ads.clicks.model.DataDemographic</class>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="update"/>
| <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
| <property name="jboss.entity.manager.jndi.name" value="fudb"/>
| <property name="jboss.entity.manager.factory.jndi.name" value="fudbFactory"/>
| </properties>
| </persistence-unit>
| </persistence>
All of the following test methods fail:
| // testEMF() blows with javax.persistence.PersistenceException: No Persistence provider for EntityManager named
|
| public void testEMF() throws Exception
| {
| EntityManagerFactory emf = Persistence.createEntityManagerFactory("fudb");
| assertNotNull("EntityManagerFactory not accessible.", emf );
| }
|
| public void testEMF2() throws Exception
| {
| InitialContext ctx = getInitialContext();
| Object em = ctx.lookup("java:/fudb");
| assertNotNull("obj is null.", em );
| }
|
| public void testEMF2b() throws Exception
| {
| InitialContext ctx = getInitialContext();
| Object em = ctx.lookup("fudb");
| assertNotNull("obj is null.", em );
| }
|
| public void testEMF3() throws Exception
| {
| InitialContext ctx = getInitialContext();
| Object em = ctx.lookup("java:/fudbFactory");
| assertNotNull("obj is null.", em );
| }
|
| public void testEMF3b() throws Exception
| {
| InitialContext ctx = getInitialContext();
| Object em = ctx.lookup("fudbFactory");
| assertNotNull("obj is null.", em );
| }
|
| public static InitialContext getInitialContext() throws Exception
| {
| Hashtable props = getInitialContextProperties();
| return new InitialContext(props);
| }
|
| private static Hashtable getInitialContextProperties()
| {
| Hashtable<String, Object> props = new Hashtable<String, Object>();
| props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
| //"org.jnp.interfaces.LocalOnlyContextFactory"
| props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
| props.put("java.naming.provider.url", "jnp://localhost:1099/");
| return props;
| }
|
And in JNDIView for Global Bindings:
fudbFactory: org.jboss.ejb3.entity.InjectedEntityManagerFactory:Reference Class Name: org.jboss.ejb3.entity.InjectedEntityManagerFactory Type: nns Content: /fudbFactory
|
| fudb: org.jboss.ejb3.entity.TransactionScopedEntityManager:Reference Class Name: org.jboss.ejb3.entity.TransactionScopedEntityManager Type: nns Content: /fudb
|
I've tried lots of random things due to my lack of full docs, so maybe my approach totally wrong ... Why null in jndi? Is this a bug?
-Jud
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976196#3976196
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976196
19 years, 7 months