[EJB3] - mixing EJB2.1 with EJB3, datasource is down
by Kobi Ianko
Kobi Ianko [http://community.jboss.org/people/kobiianko] created the discussion
"mixing EJB2.1 with EJB3, datasource is down"
To view the discussion, visit: http://community.jboss.org/message/575141#575141
--------------------------------------------------------------
Hi All,
I've got an EJB2.1 project on JBOSS AS 5.1.
I'd like to add new ejb3 (session and entity bean) to the project.
I've created a simple session bean that persist a new entity (row) to the DB, and packed it in a JAR file (with persistence.xml in meta-inf directory).
this works fne.
now, I want it to be a part of my EJB2.1 project so I've done:
1. packed the new jar in the project ear file
2. updated the aplication.xml with the new ejb-module
when I run the server, I can access the session bean from the client but the entity manager is NULL,
and when I run in the browser " http://localhost:8080/admin-console http://localhost:8080/admin-console" I can see the my datasource is marked as "DOWN"
my persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
<persistence-unit name="BoardDB">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/Kobi2DS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto"
value="update"/> <!-- create-drop/update -->
<property name="hibernate.dialect"
value="org.hibernate.dialect.SybaseDialect"/>
</properties>
</persistence-unit>
</persistence>
my session bean:
@Stateless
public class BoardManagerBean implements BoardManagerRemote {
@PersistenceContext(unitName = "BoardDB")
EntityManager entityManager;
@Override
public Board getBoardByID(int boardID) {
return entityManager.find(Board.class, boardID);
}
@Override
public void echo(String str) {
LogUtils.info(this.getClass(), str);
Board board = new Board();
board.setId(1);
board.setName("koko");
board.setSubject("sdcasasc");
entityManager.persist(board);
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/575141#575141]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 10 months
[JBoss Cache] - Custom BuddyLocator
by Jan Kowalski
Jan Kowalski [http://community.jboss.org/people/foofight] created the discussion
"Custom BuddyLocator"
To view the discussion, visit: http://community.jboss.org/message/575138#575138
--------------------------------------------------------------
Dear community :)
I've been trying to create and use my own buddy locator implementation, thus I perfmored following steps:
1. Created FooLocator class implementing BuddyLocator interface and implemented all methods. I annotated this as Threadsafe(net.jcip.annotations)
2. Created FooLocatorConfig implementing BuddyLocatorConfig interface and as above implemented all methods
3. Packed everything in FooLibrary.jar and included it to my project
4. Modified cache-configuration.xml to use my FooLocator
Redeployed all together and then ..
java.lang.ClassNotFoundException: org.foo.FooLocator. I've attached snap of the server.log file including stacktrace. I'm using glassfish v2.1.1 with java ee5
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/575138#575138]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 10 months
[JBoss Messaging] - Messages is received by wrong services.
by Rosdi Kasim
Rosdi Kasim [http://community.jboss.org/people/rosdi] created the discussion
"Messages is received by wrong services."
To view the discussion, visit: http://community.jboss.org/message/575137#575137
--------------------------------------------------------------
I have several services configured in jboss-esb.xml, when I send message to one of the service, my message will be received by _any_ one of the configured services (even though the message is not meant for that service)!
If I send the same message again, another service will process that message (in round-robin maner), it is not random, it is like each service takes turn to intercept the message.
Example, if I have 3 services configured. First time I send a message, Service 1 will receive it, second time I send a message, Service 2 will receive it, third time I send the message, Service 3 will receive it. Fourth time I send it, Service 1 will receive it and the cycle repeat..
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/575137#575137]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 10 months
[Beginner's Corner] - Binding Problem NameNotFoundException
by Katrin Rue
katrin [http://community.jboss.org/people/katrin] created the document:
"Binding Problem NameNotFoundException"
To view the document, visit: http://community.jboss.org/docs/DOC-16212
--------------------------------------------------------------
Hello,
I am setting up a JBoss 5.1 system and get the following error.
How can I bind the Provider?
I think this will solvoe the problem or I am wrong?
09:39:48,578 ERROR [JmsActivation] Unable to reconnect mailto:org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1e4e6c6(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@1f313f4 org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1e4e6c6(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter(a)1f313f4 destination=ProductFeatureChangeQueue destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/TIBCOMDBProvider user==<not shown> pass=<not shown> maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=false)
javax.naming.NameNotFoundException: TIBCOMDBProvider not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.util.naming.Util.lookup(Util.java:222)
at org.jboss.util.naming.Util.lookup(Util.java:182)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupJMSProviderAdapter(JmsActivation.java:397)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:346)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.handleFailure(JmsActivation.java:292)
at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:733)
at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)
at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
--------------------------------------------------------------
Comment by going to Community
[http://community.jboss.org/docs/DOC-16212]
Create a new document in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&co...]
13 years, 10 months
[jBPM] - Global Handler For All Processes
by prasad basutkar
prasad basutkar [http://community.jboss.org/people/peterbasutkar%40gmail.com] created the discussion
"Global Handler For All Processes"
To view the discussion, visit: http://community.jboss.org/message/575082#575082
--------------------------------------------------------------
Hi All
Requirement : i want to create global EventHandler for all the process for events 1) "InitializeVariable"(When Process Started) , 2) "InitializeTaskVariable(When Task Started)" , 3)"CompleteTask"(When Task Completed).
Description : i am using jbpm 3.2.6 i have the requirement where i dont want to specify event handler as a part of Process-Definition , they should be independent of all the processes. Whenever my process started event(common for all processes) should get called , whenever my task started event(common for all processes) should get called and whenever my task completes event(common for all the processes) should get called.Now for every process and task we have to specify EventHandlers , so to avoid this repetation i want global handler for all this events.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/575082#575082]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 10 months
[jBPM] - jbpm 4.4: sub-process in foreach: howto modify business key
by Heiko Kopp
bardioc77 [http://community.jboss.org/people/bardioc77] created the discussion
"jbpm 4.4: sub-process in foreach: howto modify business key"
To view the discussion, visit: http://community.jboss.org/message/575112#575112
--------------------------------------------------------------
Hello,
we are using the new foreach-node within our model to start a sub-process for each message in a list. The sub-process falls into a waiting state (with a set timeout). Each message in a list can be identified by a business key containing two values (person-id + contract-id). The (simplified) model is as follows:
<foreach g="493,601,48,48" name="foreach" var="message.incomingSingleMessages"> <transition g="10,-7" name="to sub: process single messages" to="sub: process single message"/></foreach>
<sub-process g="430,707,169,52" name="sub: process single message" sub-process-key="ProcessSingleMessage"> <transition g="-76,-7" name="to end foreach" to="end foreach"/></sub-process>
<join g="491,789,48,48" name="end foreach" multiplicity="#{message.incomingSingleMessages}"> <transition g="-170,-9" name="to map success message response" to="map success message response"/></join>
Now it might happen that while one sub-process is in the defined waiting state, a message with the same business key is created. We would like to either delete the waiting state or modify it rather than creating another new sub-process. However, we do not know how to find the corresponding waiting execution of the previous sub-process to signal it.
What we accomplished till now is the following. Within the sub-process right after the 'start'-node, we figure out, whether a sub-process already exists. In that case, we modify the message that waits and finish the sub-process. We use the following code for this.
// collect waiting jobsfinal JobQuery jobQuery = this.managementService.createJobQuery().timers();for (final Job job : jobQuery.list()){ // get Process from job ProcessInstance process = executionService.findProcessInstanceById(job.getExecution().getId()); final Execution exec = job.getExecution(); // get Variable name final Message oldMessage = (Message) this.executionService.getVariable(exec.getId(), "message"); if (oldMessage.getPersonId() == message.getPersonId()
&& oldMessage.getContractId() == message.getContractId())
{
// modify old message
}
}
The better solution would be to directly transition to the currently waiting sub-process by embedding the business key (personId + contractId) in the sub-process' id and simply try to find the waiting sub-process.
Has somebody an idea of how to accomplish this?
Thank you very much.
Heiko
PS: If more or detailed information is needed, I'll provide them.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/575112#575112]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 10 months
[jBPM] - Re: Create a flexible workflow and deploy it in JBPM on the fly
by helal jean-noel
helal jean-noel [http://community.jboss.org/people/jnhelal] created the discussion
"Re: Create a flexible workflow and deploy it in JBPM on the fly"
To view the discussion, visit: http://community.jboss.org/message/575106#575106
--------------------------------------------------------------
Hi
I'm not an expert but i have thought about this problem and make some trying approaches yet. Please any real expert feel free to correct if i'm wrong.
Actually in JBPM 4 you may even have a version number within a process definition and deploy and undeploy dynamically multiple instances of the "same" process defintion with multiple versions. What hapens is that every "old version definition" process instance deployed jobs still run whithout change (because they are already into the JBPM database). This is even true if you restart JBPM (without clearing the JBPM database). Only newly started jobs take the new process definition. Therefore i think "in progress" job cannot be changed on the fly.
But it is only the technical part of the story. If you plan to dynamically deploy processes, that is that you plan to change processes according to the BPM theory as exposed by Tom: 1/ managers change workflows without concerns of "technical details" through JPDL or BPMN2 and 2/ software team implements those "technical details" among wich the business data and the user interface..
In my opinion, the very important thing when aiming to change a workflow "on the fly" is to insure that the business code nor the business database structure will not change. I bet this is generally *not true* because the business organization/rules changes accordingly. Therefore your post should raise the question of your business database migration and user interface reverse compatibility strategy.
I recommend you make sure that the code nor the data do not change for any kind of workflow change you are planning.
* If true (perhaps using scripting feature) you can use the process defintion versions knowing that inprogess job will not change on the fly.
* If not true you should think about restarting JBPM *and in addition* think about two possible approaches 1/ migrate the whole database(s) (including business and JBPM objects) or 2/ migrating database business part only and have your business java code and view java code attached to process definition version numbers insuring reverse compatibility. It seems a bit tricky but I cannot see any other way to maintain end user service while changing workflow and datastructure with reverse compatibilyty.
Maybe somebody have a better approach, i would be really interested into it too.
Best Regards
JeanNo
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/575106#575106]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 10 months