[Deployers on JBoss (Deployers/JBoss)] - How do we control the order of deployment?
by joab
We are using jboss-seam-2.0 for our application development and application code is generated. All the entities are accessing the same entity manager and thus same data source.
But I have to access a different data source for populating some information in a drop down. So I have one session bean which has an entity manager configured to access that data source.
| @Stateless
| @Name("csagent")
| @Scope(ScopeType.SESSION)
| public class CSAgentHelper implements CSAgent {
|
| @PersistenceContext(unitName = "misEntityManager")
| private EntityManager em;
| private CSAgentProfile csagentProfile;
|
| public CSAgentProfile getCsagentProfile() {
| if (csagentProfile == null) {
| csagentProfile = new CSAgentProfile();
| csagentProfile.setEmpStatusList(loadEmpStatusList());
| }
| return csagentProfile;
| }
|
| private List<EmpStatus> loadEmpStatusList() {
| List resultList = null;
| List empStatusList = new ArrayList();
| Query query = em.createQuery(
| "select empStatus from EmpStatus empStatus where empStatus.activeFlag = 'Y'");
| resultList = query.getResultList();
| if (resultList != null) {
| SelectItem selItem = null;
| EmpStatus empStatus = null;
| for (int i = 0; i < resultList.size(); i++) {
| empStatus = (EmpStatus) resultList.get(i);
| selItem = new SelectItem(empStatus.getEmpStatusId(), empStatus.getEmpStatusName());
| empStatusList.add(selItem);
| }
| }
| return empStatusList;
| }
| }
|
Entity manager for the entity beans is configured like..
| @Entity
| @Table(name = "AWARD")
| @PersistenceContext(unitName = "empmstEntityManager")
| @SequenceGenerator(name="SEQ_STORE", sequenceName="AGENTS_SEQ")
| public class Award implements java.io.Serializable {
| -----------
| -----------
| }
|
There is no issue with the deployment of entities. But when the session bean is deployed, I get an error like..
--- MBeans waiting for other MBeans ---
ObjectName: jboss.j2ee:ear=empmst.ear,jar=empmst.jar,name=CSAgentHelper,service=EJB3
State: NOTYETINSTALLED
I Depend On:
persistence.units:unitName=misEntityManager
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: persistence.units:unitName=misEntityManager
State: NOTYETINSTALLED
Depends On Me:
jboss.j2ee:ear=empmst.ear,jar=empmst.jar,name=CSAgentHelper,service=EJB3
Looks like it is a problem with the deployment order. When the session bean is deployed, it looks for entity manager which is not deployed yet.
can anyone pls. help me fix this issue?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066258#4066258
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066258
18 years, 8 months
[Design of POJO Server] - Re: ProfileService todos for deployer changes
by scott.stark@jboss.org
"adrian(a)jboss.org" wrote :
| It does need a generic mechanism where the jca created managed object
| is able to respond to a request (assuming it is runtime configurable)
| "mydatasource".setProperty("max-pool-size", 100);
| with a redirect to the MBean (or POJO).
|
| Only the JCA Deployer knows the ObjectName/Attribute
| that "mydatasource"/max-pool-size maps to.
| But that ObjectName should not be a part of what the client uses or even cares about.
|
| That's not to say it can't get help from the real ServiceDeployer to actually
| handle the dispatch of the request.
| It's only the real ServiceDeployer that knows how the ServiceMetaData
| really maps to the runtime objects, i.e. mbeanserver.setAttribute(...);
|
| But that solution seems like a very long winded and brittle mechanism?
|
| My preferred solution would be to use KernelBus, but that is not
| up-to-date in terms of dispatching MBean/POJO invocations
| (Attribute and InvokeDispatchContext).
Ok, as we discussed on the call there may not be any interaction in terms of the managed object view between the jca and service deployers, other than, the service deployer should not be assuming that the ServiceDeployment is a managable sar for which it should be creating a management view.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066257#4066257
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066257
18 years, 8 months
[Design of POJO Server] - Re: ProfileService todos for deployer changes
by adrian@jboss.org
"scott.stark(a)jboss.org" wrote :
| There can be interaction between multiple ManagedDeploymentCreators. For example, with jca, the factories(the managed components) and properties are determined by the ManagedConnectionFactoryDeploymentGroup metadata, but there are runtime ops and stats that have to come from the ServiceMetaData of the mbeans that the jca layer currently uses as the runtime objects implementing the factories. Those mbeans should not be showing up as some manageable sar, while jms destinations currently are deployed as just a collection of mbeans.
|
Ok, I mentioned this before, but without any conclusion in how this should work.
It does need a generic mechanism where the jca created managed object
is able to respond to a request (assuming it is runtime configurable)
"mydatasource".setProperty("max-pool-size", 100);
with a redirect to the MBean (or POJO).
Only the JCA Deployer knows the ObjectName/Attribute
that "mydatasource"/max-pool-size maps to.
But that ObjectName should not be a part of what the client uses or even cares about.
That's not to say it can't get help from the real ServiceDeployer to actually
handle the dispatch of the request.
It's only the real ServiceDeployer that knows how the ServiceMetaData
really maps to the runtime objects, i.e. mbeanserver.setAttribute(...);
But that solution seems like a very long winded and brittle mechanism?
My preferred solution would be to use KernelBus, but that is not
up-to-date in terms of dispatching MBean/POJO invocations
(Attribute and InvokeDispatchContext).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066245#4066245
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066245
18 years, 8 months