[jBPM Development] - Trunk build failure
by Maciej Swiderski
Maciej Swiderski [http://community.jboss.org/people/swiderski.maciej] created the discussion
"Trunk build failure"
To view the discussion, visit: http://community.jboss.org/message/547615#547615
--------------------------------------------------------------
Seems like latest revision (6404 - fix hudson job) can broke the build. At least it broke for me (MacOS, Java 1.5, HSQLDB) I checked Hudson build but looks like that revision was not yet built.
The error occurs in RepositoryServiceTest with following error:
20:15:22,136 FIN | [RepositoryServiceTest] === starting testNonLatinProcessName =============================
20:15:22,137 FIN | [HibernateSessionResource] ----- beginning hibernate tx 7581301 --------------------------------------------------------
### EXCEPTION ###########################################
20:15:22,148 INF | [DefaultCommandService] exception while executing command org.jbpm.test.process.RepositoryServiceTest$1@66c122
java.sql.SQLException: Unexpected token: @ in statement [select ]
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.jdbcStatement.executeQuery(Unknown Source)
at org.jbpm.test.process.RepositoryServiceTest$1.execute(RepositoryServiceTest.java:394)
at org.jbpm.test.process.RepositoryServiceTest$1.execute(RepositoryServiceTest.java:1)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.processengine.ProcessEngineImpl.execute(ProcessEngineImpl.java:300)
at org.jbpm.test.process.RepositoryServiceTest.testNonLatinProcessName(RepositoryServiceTest.java:388)
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:592)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
### EXCEPTION ###########################################
20:15:22,149 FIN | [HibernateSessionResource] ----- rolling back hibernate tx 1159510 -----------------------------------------------------
20:15:22,151 FIN | [RepositoryServiceTest] === ending testNonLatinProcessName =============================
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/547615#547615]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
Re: [jboss-user] [JNDI and Naming] - $Proxy60 - returned by JBOSS JNDI Context
by Anand Krishnan
Anand Krishnan [http://community.jboss.org/people/anandhakrishnank] replied to the discussion
"$Proxy60 - returned by JBOSS JNDI Context"
To view the discussion, visit: http://community.jboss.org/message/547602#547602
--------------------------------------------------------------
I had come across the $proxy60, by using Context{line 3}, instead of InitialContext as given below:
/*[1]*/PrintWriter w = response.getWriter();
/*[2]*/NamingContext envCtx = (NamingContext) intialCtx.lookup("java:");
/*[3]*/Context ldapCtx = (Context) envCtx.lookup("external/ldap/jboss");
/*[4]*/InitialContext initialContext = new InitialContext(ldapCtx.getEnvironment());
/*[5]*/w.println(initialContext.toString()+"<br/>");
/*[6]*/w.println(initialContext.getEnvironment());
{line 5 prints :}
javax.naming.InitialContext@1cece51
{line 6 prints :}
{java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces}
I need to convert this object to LocalOnlyContextFactory, thats how I could use in my application.
Please suggest!
If try type-casting, it gives ClassCastException:
LocalOnlyContextFactory typeCtx =(LocalOnlyContextFactory)ldapctx;{ldapCtx from line:3}
Please suggest solution to get the right context to use in my application.
Thanks,
Anand
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/547602#547602]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
Re: [jboss-user] [jBPM] - Manual reroute in Jbpm 4.3
by Martin Pradny
Martin Pradny [http://community.jboss.org/people/mpradny] replied to the discussion
"Manual reroute in Jbpm 4.3"
To view the discussion, visit: http://community.jboss.org/message/547600#547600
--------------------------------------------------------------
THANK YOU :) This works.
In case anyone is looking for something similar, here si the code.
import org.jbpm.api.ProcessDefinitionQuery;
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.cmd.Environment;
import org.jbpm.api.model.Event;
import org.jbpm.pvm.internal.client.ClientExecution;
import org.jbpm.pvm.internal.cmd.AbstractCommand;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.model.TransitionImpl;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.processengine.ProcessEngineImpl;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
public class RerouteCmd extends AbstractCommand<ProcessInstance> {
/**
*
*/
private static final long serialVersionUID = 1L;
private static final String REROUTE = "#reroute#";
private String executionId;
private String newActivityName;
private String taskId;
public RerouteCmd(String executionId, String newActivityName, String taskId){
this.executionId=executionId;
this.newActivityName=newActivityName;
this.taskId=taskId;
}
@Override
public ProcessInstance execute(Environment environment) throws Exception {
ExecutionImpl execution = null;
DbSession dbSession = environment.get(DbSession.class);
execution = (ExecutionImpl) dbSession.findExecutionById(executionId);
ProcessDefinitionImpl pd=execution.getProcessDefinition();
ActivityImpl endActivity=pd.getActivity(newActivityName);
ActivityImpl startActivity=execution.getActivity();
TransitionImpl trans=startActivity.createOutgoingTransition();
trans.setDestination(endActivity);
trans.setName(REROUTE);
if (taskId==null){
execution.signal(REROUTE);
}else{
TaskImpl task=dbSession.get(TaskImpl.class, Long.parseLong(taskId));
if (task!=null){
task.complete(REROUTE);
dbSession.delete(task);
}
}
startActivity.removeOutgoingTransition(trans);
return null;
}
}
I have tried to casue minimal damage to existing logic. May be the signal and complete operations could be done again using commands, but I wasn't able to get processEngine (and didn't bother too much, since this works).
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/547600#547600]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
Re: [jboss-user] [Spring Integration] - JBoss 5.1.0 and Multiple EARs and EJBs using the SpringBeanAutowiringInterceptor issue
by Kyle Bober
Kyle Bober [http://community.jboss.org/people/kyle.bober] replied to the discussion
"JBoss 5.1.0 and Multiple EARs and EJBs using the SpringBeanAutowiringInterceptor issue"
To view the discussion, visit: http://community.jboss.org/message/547577#547577
--------------------------------------------------------------
Okay I have found a solution to my issue. I am not sure if this is the best way of handling this but it works for now and I have yet to run into any issue.
We overrode the getBeanFactoryLocator method in the SpringBeanAutowiringInterceptor class. We then used the new Interceptor in our EJB
@Interceptors(AnotherSpringBeanAutowiringInterceptor.class)
package com.somepackage;
import org.springframework.beans.factory.access.BeanFactoryLocator;
import org.springframework.context.access.ContextSingletonBeanFactoryLocator;
import org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor;
public class AnotherSpringBeanAutowiringInterceptor extends SpringBeanAutowiringInterceptor {
private static final String DEFAULT_RESOURCE_LOCATION = "classpath*:anotherBeanRefContext.xml";
/**
* Determine the BeanFactoryLocator to obtain the BeanFactoryReference from.
* <p>The default implementation exposes Spring's default
* {@link ContextSingletonBeanFactoryLocator}.
* @param target the target bean to autowire
* @return the BeanFactoryLocator to use (never <code>null</code>)
* @see org.springframework.context.access.ContextSingletonBeanFactoryLocator#getInstance()
*/
protected BeanFactoryLocator getBeanFactoryLocator(Object target) {
return ContextSingletonBeanFactoryLocator.getInstance(DEFAULT_RESOURCE_LOCATION);
}
}
This worked for our multiple EARs which each contained a diffrent beanRefContext.xml. We needed to make the names beanRefContext.xml file unique per EAR and then override the SpringBeanAutowiringInterceptor getBeanFactoryLocator method. We also changed the DEFAULT_RESOURCE_LOCATION string to reference out EARs specific beanRefContext.xml file. If anyone sees an issue with this please let me know as to what side affects we may run into. For now this has been running just fine.
Thanks for everyones help and insight into this issue.
-Kyle Bober
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/547577#547577]
Start a new discussion in Spring Integration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years