[JBoss Microcontainer] - Is there auto-injection going on?
by David Bosschaert
David Bosschaert [http://community.jboss.org/people/bosschaert] created the discussion
"Is there auto-injection going on?"
To view the discussion, visit: http://community.jboss.org/message/539804#539804
--------------------------------------------------------------
Looking at the Spring demo in the User's Guide examples I can see that it references the mcBean and gets injected by it. However the mcBean itself doesn't explicitly reference the SimpleBean...
<bean id="testBean" class="org.jboss.example.microcontainer.spring.SimpleBean">
<!-- other stuff -->
<property name="refBean"><ref bean="mcBean"></ref></property></bean>
<bean xmlns="urn:jboss:bean-deployer:2.0" name="mcBean" class="org.jboss.example.microcontainer.spring.MCBean"></bean>
however, the MCBean still gets injected by the SimpleBean through the setSimpleBean() method
public class MCBean
{
public void setSimpleBean(SimpleBean simpleBean)
{
System.out.println("Setting simple bean: " + simpleBean);
}
}
Is there some auto-injection going on or am I missing the declaration for it somewhere?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/539804#539804]
Start a new discussion in JBoss Microcontainer at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 12 months
Re: [jboss-user] [jBPM] - JBPM 4.3 - org.jbpm.api.JbpmException: couldn't acquire block of ids
by Stefano Campanini
Stefano Campanini [http://community.jboss.org/people/campa] replied to the discussion
"JBPM 4.3 - org.jbpm.api.JbpmException: couldn't acquire block of ids"
To view the discussion, visit: http://community.jboss.org/message/539800#539800
--------------------------------------------------------------
Hi guys, I'm back ... with new energies :-)
The problem was related to
org.jbpm.pvm.internal.id.DatabaseDbidGenerator and precisely on AcquireDbidBlockCmd it use.
I have re-implmented these classes using sequence to generate ids, as below:
...
public class SequenceDbIdGenerator extends DbidGenerator {
CommandService commandService;
@Override
public long getNextId() {
return commandService.execute(new SequenceDbIdGeneratorCmd());
}
}
...
and
...
public class SequenceDbIdGeneratorCmd implements Command<Long> {
private static final long serialVersionUID = -8109570788517494372L;
@SuppressWarnings("unchecked")
@Override
public Long execute(Environment environment) throws Exception {
Session session = environment.get(Session.class);
List<BigInteger> res = session.createSQLQuery(
"select nextval('jbpm_seq_external_id')").list();
return res.get(0).longValue();
}
}
and i the jbpm config file:
...
<object class="net.tinvention.wf.jbpm.SequenceDbIdGenerator">
<field name="commandService"><ref object="txRequiredCommandService" /></field>
</object>
<object class="org.jbpm.pvm.internal.id.DatabaseIdComposer" init="eager" />
Does anyone more expert on jbpm can validate ? Do you see any hidden disaster or this solution can work ?
Thanks in advance
Stefano
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/539800#539800]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 12 months