[JBoss jBPM] - Re: Tutorial or guide to create instances of processes in ja
by lblaauw
Ok,
I am also sorta debating on what route to take on this scenario. So we have deployed jBPM as the ear file including the console and the EJBs since we need the timerservices to be ejb timers this seemed a reasonable approach.
I have been reading a lot in the documentation and also the sources and tests but still I cannot figour out how to go about and create a server based webservice to expose jBPM services like getting taskLists, proces Tasks etc etc.
Basically I can see two options right now and I would love some feedback on both of these:
Option 1 would be to just approach the CommandService EJB from my webservice, as far as i can see it that would use ONE configuration set ie jbpm conf xml, hibernate xml etc etc. This however does mean we get extra overhead in using EJB(2)...
Option 2, would be to use seperate configuration files all together, effectively meaning we bypass the whole configuration allready deployed on the JBoss server and user another one on the client. Basically as i can see this means we just share the jBPM database then ??
Or are there better other options that I just missed so far ?
Greetings,
Leo
"kukeltje" wrote : the JMX bean as it was is not used anymore since it made jBPM somewhat JBoss AS dependant. You can easily circumvent this, but the docs also would not be generic. Besides that, you could not package actionhandler classes is your own war/ear then, but only server generic or in the processarchive. These were the reasons to abandon the MBean
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159254#4159254
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159254
17 years, 10 months
[EJB 3.0] - deploy and use own timerservice
by mwoelke
Hello,
consider the following environment:
We have an app which is working on an oracle database. The application uses timers as well. By default they get serialized to the hsqldb.
What we want is to switch them to the oracle datasource, which is easy configuring timers globally to use the oracle datasource. Unfortunately thats not what we would consider best. We want to make this configuration part of our deployment. Which means we want to deploy our own timerservice linked to the oracle datasource. The reason for this is we dont want to change the jboss configuration every time our environment changes. We want to handle this by configuring our packaging system, since this means we change it once instead of changing the configuration of each and every jboss running our app.
Thats where the questions come in.
How can I configure this? And where do I put the appropriate deployment descriptors. My guess would be to deploy a sar with a jboss-service.xml which defines an instance of the jboss timerservice like this:
<mbean code="org.jboss.ejb.txtimer.EJBTimerServiceImpl"
| name="jboss.ejb:applicational=EJBTimerService">
| <attribute name="RetryPolicy">jboss.ejb:service=EJBTimerService,retryPolicy=fixedDelay</attribute>
| <attribute name="PersistencePolicy">jboss.ejb:applicational=EJBTimerService,persistencePolicy=database</attribute>
| <attribute name="TimerIdGeneratorClassName">org.jboss.ejb.txtimer.BigIntegerTimerIdGenerator</attribute>
| <attribute name="TimedObjectInvokerClassName">org.jboss.ejb.txtimer.TimedObjectInvokerImpl</attribute>
| <depends optional-attribute-name="TransactionManagerFactory" proxy-type="org.jboss.tm.TransactionManagerFactory">
| jboss:service=TransactionManager
| </depends>
| </mbean>
|
| <mbean code="org.jboss.ejb.txtimer.DatabasePersistencePolicy" name="jboss.ejb:applicational=EJBTimerService,persistencePolicy=database">
| <!-- DataSourceBinding ObjectName -->
| <depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=MyOracleDs</depends>
| <!-- The plugin that handles database persistence -->
| <attribute name="DatabasePersistencePlugin">org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin</attribute>
| <!-- The timers table name -->
| <attribute name="TimersTable">TIMERS</attribute>
| </mbean>
As I understand it this should create another instance of the timerservice with a different name. Any suggestions to this?
The next problem I have is that I dont know how to use it. When simply injecting the timerservice to a bean jboss seems to inject the default timerservice. Again my guess would be to specify something with the @Resource annotation, but I dont know how to do it. Although I would like it best to have the application server pick the correct timerservice on its own without further hinting by @Resource.
Is there a way to have the container consider the applications deployment first? And if there is, how to use it?
Please tell me what you think about it. Is there a better solution to this?
Thanx in advance,
Milan Woelke
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159253#4159253
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159253
17 years, 10 months
[EJB 3.0] - EJB Annotation Not Injecting (@EJB)
by repkin
Hi,
I wanted the ejb references have been injected by container. When I use context.lookup, it is working. This is my code:
| Context context = new InitialContext();
| PrStaffLocalInterface prstaff = (PrStaffLocalInterface)context.lookup("surgeonfish/PrStaffHome/local");
| prstaff.findById(new Integer(username));
|
But if I use @EJB annotation I am taking null pointer exception.
| package com.atosorigin.jdbc;
|
| import javax.ejb.EJB;
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| import com.atosorigin.utils.pojo.PrStaff;
| import com.atosorigin.utils.pojo.PrStaffHome;
| import com.atosorigin.utils.pojo.PrStaffLocalInterface;
|
| public class DBSecurity {
| @EJB
| PrStaffLocalInterface prStaff;
|
| public boolean checkUserPassword(String username, String password) throws Exception {
| /*Context context = new InitialContext();
| PrStaffLocalInterface prstaff = (PrStaffLocalInterface)context.lookup("surgeonfish/PrStaffHome/local");
| prstaff.findById(new Integer(username));*/
|
| prStaff.findById(new Integer(username));
|
| return false;
| }
| }
|
|
| //I HAVE USED ALL OF THIS POSSIBILITIES BY ONE BY
|
|
| @EJB(mappedName="surgeonfish/PrStaffHome/local")
| PrStaffLocalInterface prStaff;
|
| @EJB(beanName="surgeonfish/PrStaffHome/local")
| PrStaffLocalInterface prStaff;
|
| @EJB(name="surgeonfish/PrStaffHome/local")
| PrStaffLocalInterface prStaff;
|
| @EJB(name="PrStaffHome")
| PrStaffLocalInterface prStaff;
|
| @EJB(name="PrStaffHome/local")
| PrStaffLocalInterface prStaff;
|
| @EJB(mappedName="PrStaffHome/local")
| PrStaffLocalInterface prStaff;
|
| @EJB(beanName="PrStaffHome/local")
| PrStaffLocalInterface prStaff;
|
| @EJB(beanName="PrStaffHome")
| PrStaffLocalInterface prStaff;
|
Where am I missing? Thanks for your helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159251#4159251
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159251
17 years, 10 months