[JBoss JIRA] Created: (JBPM-1148) jBPM Classloading
by Bjoern Wand (JIRA)
jBPM Classloading
-----------------
Key: JBPM-1148
URL: http://jira.jboss.com/jira/browse/JBPM-1148
Project: JBoss jBPM
Issue Type: Patch
Components: Core Engine
Reporter: Bjoern Wand
Assigned To: Tom Baeyens
jBPM does not use ContextClassloader for classloading. The class ClassLoaderUtil.java has a comment that class loading could be made configurable. This is the patch I provided in the forum and I agreed with Koen Ars th open a JIRA for this.
package org.jbpm.util;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmException;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.instantiation.ProcessClassLoader;
/**
* provides centralized classloader lookup.
*/
public class ClassLoaderUtil {
private static Log log = LogFactory.getLog(ClassLoaderUtil.class);
public static Class loadClass(String className) {
try {
return getClassLoader().loadClass(className);
} catch (ClassNotFoundException e) {
throw new JbpmException("class not found '" + className + "'", e);
}
}
public static ClassLoader getClassLoader() {
if (JbpmConfiguration.Configs.hasObject("jbpm.classloader")) {
String jbpmClassloader = JbpmConfiguration.Configs.getString("jbpm.classloader");
String jbpmClassloaderClassname = JbpmConfiguration.Configs.getString("jbpm.classloader.classname");
if (jbpmClassloader.equals("jbpm")) {
return ClassLoaderUtil.class.getClassLoader();
} else if (jbpmClassloader.equals("context")) {
return Thread.currentThread().getContextClassLoader();
} else if (jbpmClassloader.equals("custom")) {
try {
if (jbpmClassloaderClassname == null) {
throw new JbpmException(
"'jbpm.classloader' property set to 'custom' but 'jbpm.classloader.classname' is empty!");
}
return (ClassLoader) Thread.currentThread().getContextClassLoader().loadClass(
jbpmClassloaderClassname).newInstance();
} catch (InstantiationException e) {
throw new JbpmException("Error instantiating custom classloader " + jbpmClassloaderClassname, e);
} catch (IllegalAccessException e) {
throw new JbpmException("Error accessing custom classloader " + jbpmClassloaderClassname, e);
} catch (ClassNotFoundException e) {
throw new JbpmException("Custom classloader " + jbpmClassloaderClassname + " not found ", e);
}
} else {
throw new JbpmException("'jbpm.classloader' property set to '" + jbpmClassloader
+ "' but only the values 'jbpm'/'context'/'custom' are supported!");
}
} else {
return ClassLoaderUtil.class.getClassLoader();
}
}
public static InputStream getStream(String resource) {
return getClassLoader().getResourceAsStream(resource);
}
public static Properties getProperties(String resource) {
Properties properties = new Properties();
try {
properties.load(getStream(resource));
} catch (IOException e) {
throw new JbpmException("couldn't load properties file '" + resource + "'", e);
}
return properties;
}
/**
* searches the given resource, first on the root of the classpath and if
* not not found there, in the given directory. public static InputStream
* getStream(String resource, String directory) { InputStream is =
* getClassLoader().getResourceAsStream(resource); if (is==null) { is =
* getClassLoader().getResourceAsStream(directory+"/"+resource); } return
* is; }
*
* public static Properties getProperties(String resource, String directory) {
* Properties properties = new Properties(); try {
* properties.load(getStream(resource, directory)); } catch (IOException e) {
* throw new JbpmException("couldn't load properties file '"+resource+"'",
* e); } return properties; }
*/
public static ClassLoader getProcessClassLoader(ProcessDefinition processDefinition) {
return new ProcessClassLoader(getClassLoader(), processDefinition);
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month
[JBoss JIRA] Created: (JBPM-1307) jBPM tries to use Hibernate transaction even if configured with isTransactionEnabled = false
by Mauro Molinari (JIRA)
jBPM tries to use Hibernate transaction even if configured with isTransactionEnabled = false
--------------------------------------------------------------------------------------------
Key: JBPM-1307
URL: http://jira.jboss.com/jira/browse/JBPM-1307
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Core Engine
Affects Versions: jPDL 3.2.2
Reporter: Mauro Molinari
The method org.jbpm.scheduler.db.DbSchedulerService.deleteTimersByProcessInstance(ProcessInstance) is accessing the Hibernate transaction even if jBPM is configured not to use transactions:
<service name="persistence">
<factory>
<bean
class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
<field name="isTransactionEnabled">
<false />
</field>
<field name="isCurrentSessionEnabled">
<true />
</field>
</bean>
</factory>
</service>
This causes a serious problem when you're using jBPM inside a JTA environment and you want to control JTA transactions by yourself. For instance, we're using Spring to manage transactions a JBoss Transactions as the JTA implementation. We are not using JNDI in any way, but when we try to call processInstance.end(), a call to org.jbpm.scheduler.db.DbSchedulerService.deleteTimersByProcessInstance(ProcessInstance) is performed and Hibernate tries to create a new JTATransaction by querying an empty JNDI InitialContext.
The only workaround we could find is the one outlined here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117325#4117325
that is, subclassing JobSession in order to use Spring TransactionSynchronizationManager.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month
[JBoss JIRA] Created: (JBPM-1887) ExceptionHandler may cause infinite loop (when unavailable or throwing an Exception itself)
by Marko Petersen (JIRA)
ExceptionHandler may cause infinite loop (when unavailable or throwing an Exception itself)
-------------------------------------------------------------------------------------------
Key: JBPM-1887
URL: https://jira.jboss.org/jira/browse/JBPM-1887
Project: JBoss jBPM
Issue Type: Quality Risk
Security Level: Public (Everyone can see)
Components: Core Engine
Affects Versions: jBPM 3.3.0 GA, jBPM 3.2.3, jBPM 3.2.2
Environment: Windows XP, Java 1.6
Reporter: Marko Petersen
In case an exception handler class is not available (or causes an exception itself), 3.1.2 and 3.2GA stopped executing the process flow. After upgrading to 3.2.2 or above (have not tried 3.2.1), if the exception handler class is not available or causes an exception, that exception seems to be handled by the same exception handler - causing an (infinite ?) loop. Might this be a bug or is the new behaviour intended? Or am I missing something?
Thanks for any help.
Marko
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month
[JBoss JIRA] Closed: (JBPM-826) Incorrect action exception handling
by Bernd Ruecker (JIRA)
[ https://jira.jboss.org/jira/browse/JBPM-826?page=com.atlassian.jira.plugi... ]
Bernd Ruecker closed JBPM-826.
------------------------------
Fix Version/s: (was: jBPM 3.3.2 GA )
Resolution: Rejected
There is no bug. An Exceptionb in a ActionHandler is nested in a DelegationException which is thrown correctly to the client (if no exception handler is in place).
So closed.
> Incorrect action exception handling
> -----------------------------------
>
> Key: JBPM-826
> URL: https://jira.jboss.org/jira/browse/JBPM-826
> Project: JBoss jBPM
> Issue Type: Bug
> Components: Core Engine
> Affects Versions: jBPM 3.1.3
> Environment: Eclipse + Tomcat + JDK 6.0
> Reporter: Pedro Silva
> Priority: Critical
>
> If an action in a process definition throws an exception it doesn't correctly reach the client class, e.g. the class doing the signalling.
> Imagine that you have a process definition that in one of the task as an action that opens a file for reading. If the file cannot be found there will be an exception. Te exception is thrown and when it reaches the class, where the code for signalling is, you can't see the exception message. If you try to do, in the catch block, System.err.println(e.getMessage()) the result is null! However if you print System.err.println(e.getCause().getMessage()) the result is the file not found exception.
> This is worst in the case when you caught the exception in the action delegated class and you throw your own exception by explicitly doing: throw new MyException("Some error"); and the message still is null.
> In the case where the exception occurs in another class than the one of the action (if the execute code of the action invokes another class), even the code System.err.println(e.getCause().getMessage()) outputs null.
> The documentattion clearly states in 9.7 Exception Handling:
> "...Uncaught exceptions are thrown to the client (e.g. the client that called the token.signal()) or the exception is caught by a jBPM exception-handler. ..."
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month