[JBoss Tools] - Starting/Stoping Jboss 5.1 using web profile
by Rodrigo Uchoa
Rodrigo Uchoa [http://community.jboss.org/people/rodrigo.uchoa] created the discussion
"Starting/Stoping Jboss 5.1 using web profile"
To view the discussion, visit: http://community.jboss.org/message/562765#562765
--------------------------------------------------------------
Hey guys,
I've noticed there's a problem when using JBoss 5.1 with the web profile . Starting and Stoping the server does not work as it should.
When starting, eclipse doesn't seem to know when the server is already up, so it keeps constantly saying "Starting server..", as if it never ended. When stoping I get a "javax.naming.CommunicationException: failed to connect to server".
I've done some research and it seems it has something to do with the jmx poller not being installed in the web profile. Some people have suggested switching the startup/shutdown pollers to "timeout", but even though this works, it's kinda annoying.
So, does anyone know how to turn the *jmx poller back on in the web profile*? Or is there any other workaround instead of using a "timeout poller"?
My environment:
JBoss AS 5.1 GA
Eclipse Helios cocoa 32bits for Mac
JBoss Tools 3.2 M2
Regards!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/562765#562765]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 2 months
[jBPM] - Problem terminating concurent executions that have active sub-processes [jBPM 4.3/4.4 + Oracle]
by Michal Klimuk
Michal Klimuk [http://community.jboss.org/people/misieq] created the discussion
"Problem terminating concurent executions that have active sub-processes [jBPM 4.3/4.4 + Oracle]"
To view the discussion, visit: http://community.jboss.org/message/562698#562698
--------------------------------------------------------------
I have a process that contains a fork activity with two branches - one containing a sub-process and the other any type of node from which we can terminate the whole process directly. A simplified version for test purposes would be:
<?xml version="1.0" encoding="UTF-8"?>
<process name="p1"
schemaLocation="http://jbpm.org/4.0/jpdl http://docs.jboss.org/jbpm/xsd/jpdl-4.0.xsd"
xmlns="http://jbpm.org/4.0/jpdl">
<start g="143,27,80,40" name="start">
<transition g="-54,-22" name="to fork1" to="fork1" />
</start>
<fork g="143,117,48,48" name="fork1">
<transition g="-38,-22" name="to p2" to="p2" />
<transition g="34,-14" name="to state1" to="state1" />
</fork>
<state g="199,214,108,52" name="state1">
<transition to="join1" />
<transition g="-11,-21" name="end" to="end2" />
</state>
<sub-process g="18,227,92,52" name="p2" sub-process-key="p2">
<transition to="join1" />
</sub-process>
<join g="141,334,48,48" name="join1">
<transition to="end" />
</join>
<end-cancel g="405,217,92,102" name="end2" />
<end g="141,446,80,40" name="end" />
</process>
When I run the process and try to signal node 'state1' to end the whole process I get a constraint violation :
org.hibernate.exception.ConstraintViolationException: could not delete: org.jbpm.pvm.internal.model.ExecutionImpl#10002
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725)
at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1141)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findProcessInstanceByIdIgnoreSuspended(DbSessionImpl.java:211)
at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessInstance(DbSessionImpl.java:251)
at org.jbpm.pvm.internal.model.ExecutionImpl.end(ExecutionImpl.java:382)
at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:82)
at org.jbpm.jpdl.internal.activity.EndActivity.execute(EndActivity.java:45)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:616)
at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:417)
at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61)
at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:55)
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:55)
at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:88)
at org.jbpm.test.SubprocessTest.testEndWithActiveSubprocesses(SubprocessTest.java:25)
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:597)
at org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160)
at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233)
at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
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)
Caused by: java.sql.SQLException: ORA-02292: violation de contrainte (BDOOA.FK_EXEC_SUPEREXEC) d'intégrité - enregistrement fils existant
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1170)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3423)
at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2551)
... 54 more
I investigated the problem and I found out that it is due to the fact that we never try to terminate an existing sub-process from within the ExecutionImpl.end() method. It causes a delete of the parent execution row although it is still referenced by SUPEREXEC_ column of the sub-process.
I created a patch that works and that consists on adding the following code to ExecutionImpl.end(String state) (my code in the middle paragraph):
// end all child executions
// making a copy of the executions to prevent ConcurrentMoidificationException
List<ExecutionImpl> executionsToEnd = new ArrayList<ExecutionImpl>(executions);
for (ExecutionImpl child: executionsToEnd) {
child.end(state);
}
// terminates the sub-process if it exists
if(subProcessInstance != null) {
// to avoid the return signal (see superProcessExecution.signal() in the end(String state) method)
subProcessInstance.setSuperProcessExecution(null);
subProcessInstance.end(state);
}
setState(state);
I don't know if it is the right approach but it works pretty much fine. Do you think it's the right way to do it?
I created a jira where I join the patch and a test module.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/562698#562698]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 2 months
[EJB 3.0] - ManyToMany bidirectional - inverse side does not load the complete collection
by Nicole Schweighardt
Nicole Schweighardt [http://community.jboss.org/people/NSchweig] created the discussion
"ManyToMany bidirectional - inverse side does not load the complete collection"
To view the discussion, visit: http://community.jboss.org/message/564238#564238
--------------------------------------------------------------
Hi
I read a lot about eager and lazy fetching and so on but for this case I could not find a solution.
I have a relationship between 'appointment' and 'offer'. An appointment has a list with offers, an offer has a list with appointments. Offer is the owner side.
@Entity
public class Offer implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
...
//bidirectional
//Appointments that are in the offer
@ManyToMany(fetch=FetchType.EAGER)
@IndexColumn(name="INDEX_COL")
private List<Appointment> appointments = new ArrayList<Appointment>();
...}
@Entity
public class Appointment implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String title;
private String description;
//unidirektional
@ManyToOne
@JoinColumn(name="instructor")
private CmtUser instructor;
...
//bidirektional
@ManyToMany(fetch=FetchType.EAGER,mappedBy="appointments")
@IndexColumn(name="INDEX_COL")
private List<Offer> offers= new ArrayList<Offer>();
...}
If I load an offer from my database in my sessionbean 'OfferHandler', the list with the appointments is fully loaded. (see picture 1) (I tested it with the debugger to look into the collections in the sessionbean, too, not only with my web layer)
public List<Offer> getOffersForInstructor(Long instructorId) {
try{
Query q = em.createQuery("SELECT a from Offer a " +
"WHERE a.instructor.id = :instructorId ");
q.setParameter("instructorId",instructorId);
List<Offer> offers = (List<Offer>) q.getResultList();
return offers ;
}
catch(EntityNotFoundException ex){}
return null;
}
But on the other side if I try to load some appointments from my database the collection with the offers only contains the last saved offer! (see picture 2)
public List<Appointment> getFreeAppointments(Long instructorId) {
try{
Query q = em.createQuery("SELECT a from Appointment a " +
"WHERE a.instructor.id = :instructorId AND " +
"a.accepted =:false ");
q.setParameter("instructorId",instructorId);
q.setParameter("false",false);
List<Appointment> appointments = (List<Appointment>) q.getResultList();
return appointments;
}
In the database there is an jointable with the right entries:
f. example: (the first offer contains the first appointment, the second offer contains both appointments)
offers_id appointments_id INDEX_COL
1 1 0
2 1 0
2 2 1
I hope someone can help. I tested a lot to force loading the collection. f.example refreshing the appointments or loading the offers in the appointments with appointment.offers.size().
Thank you a lot
Nicki
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/564238#564238]
Start a new discussion in EJB 3.0 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 2 months