[jBPM] - Unknown error using timer in JEE
by Francesco Pietrobelli
Francesco Pietrobelli [http://community.jboss.org/people/francesco.pietrobelli] created the discussion
"Unknown error using timer in JEE"
To view the discussion, visit: http://community.jboss.org/message/619852#619852
--------------------------------------------------------------
Hi all,
I have a JEE application with jBPM embedded and I have a process that during his execution flow he reaches a intermediate timer catch event. And so the session with that process is disposed. My problem arises when I load the session after the timer is triggered, particularly, the thrown exception is:
2011-08-05 17:03:54,659 ERROR org.drools.persistence.SingleSessionCommandService org.drools.persistence.SingleSessionCommandService (pool-26-thread-1) Could not commit session
java.lang.NullPointerException
at org.drools.persistence.jpa.JpaPersistenceContextManager.beginCommandScopedEntityManager(JpaPersistenceContextManager.java:67)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:287)
at org.drools.persistence.jpa.JpaJDKTimerService$JpaJDKCallableJob.call(JpaJDKTimerService.java:75)
at org.drools.persistence.jpa.JpaJDKTimerService$JpaJDKCallableJob.call(JpaJDKTimerService.java:63)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
This is the entire stack trace and I haven't any additional information for understand what happened.
Moreover the thread that throws the NPE is different from thread that load the session. Anybody know where to find some information about jBPM threading model?
I can't attach a junit test because i have this problem only when i deploy my application in JBoss5.1, whereas the same process tested with the help of JbpmJunitTestCase doesn't generate any errors.
Regards,
Francesco.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/619852#619852]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[jBPM] - Re: Why is Timer event not triggered in J2EE container?
by Mare Geldenhuys
Mare Geldenhuys [http://community.jboss.org/people/mgeldenhuys] created the discussion
"Re: Why is Timer event not triggered in J2EE container?"
To view the discussion, visit: http://community.jboss.org/message/619845#619845
--------------------------------------------------------------
Hi Gary,
I think that your suspicion is correct. The original transaction you use to create the process finishes successfully, since it is only mandated to create the process and that happens without a problem. Therefore the original transaction has already commited and is not available when the timer fires.
Since the timer is executing now in the engine (StatefullKnowledgeSession) and transaction management has been specified as BMT. the engine now requires a transaction manager to get a transaction from it. And this is probably where the problem arises.
The way you do that is by registering the Transaction Manager with the StatefullKnowledgeSession, and that is done upon creation/retrieval of the said StatefullKnowledgeSession. That means getting the Transaction Manager which is managed by Websphere in your case and passing it to the KnowledgeService through an Environment.
The question now really is, how are you creating your StatefullKnowledgeSession? If you are using the jbpm-gwt-core jar's sources CommandDelegate as an example, you will have to look at the following lines,
| | | Environment env = KnowledgeBaseFactory.newEnvironment(); |
| | | env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); |
This is where you will need to add the reference to your transaction manager,
env.set( EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager() );// Change this to where you get your transaction manager from
If this does not work, someone from the community with more experience will need to assist. Whichever way, please post your findings, as I would like to see how it pans out.
Mare
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/619845#619845]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[EJB3] - Can't find a persistence unit named
by Mitesh pandey
Mitesh pandey [http://community.jboss.org/people/mtshpandey] created the discussion
"Can't find a persistence unit named"
To view the discussion, visit: http://community.jboss.org/message/619795#619795
--------------------------------------------------------------
Hi All,
I am a newbie to ejb3. For my learning , i created a ejb application with a stateless session bean , a pojo class , a persistence.xml file with hibernate as persistence provider , postgresql as DB and jboss server 5.0.0 CR2.
The external jar added are ejb3-persistence.jar , hibernate-core and hibernate-entitymanager.jar
When i start jboss server , the following error is displayed
ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/E:/software%20download/jboss-5.0.0.CR2-jdk6/jboss-5.0.0.CR2/server/default/deploy/Chapter3.jar state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error deploying Chapter3.jar: Can't find a persistence unit named 'titan' in AbstractVFSDeploymentContext@25979158{vfszip:/E:/software%20download/jboss-5.0.0.CR2-jdk6/jboss-5.0.0.CR2/server/default/deploy/Chapter3.jar}
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:209)
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:108)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:265)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:143)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:409)
at org.jboss.Main.boot(Main.java:209)
at org.jboss.Main$1.run(Main.java:544)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Can't find a persistence unit named 'titan' in AbstractVFSDeploymentContext@25979158{vfszip:/E:/software%20download/jboss-5.0.0.CR2-jdk6/jboss-5.0.0.CR2/server/default/deploy/Chapter3.jar}
at org.jboss.jpa.resolvers.DefaultPersistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(DefaultPersistenceUnitDependencyResolver.java:141)
at org.jboss.ejb3.Ejb3Deployment.resolvePersistenceUnitSupplier(Ejb3Deployment.java:841)
at org.jboss.ejb3.EJBContainer.resolvePersistenceUnitSupplier(EJBContainer.java:1399)
at org.jboss.injection.PersistenceUnitHandler.addPUDependency(PersistenceUnitHandler.java:124)
at org.jboss.injection.PersistenceContextHandler.loadXml(PersistenceContextHandler.java:76)
at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:570)
at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:439)
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:552)
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:202)
... 22 more
14:13:32,343 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
*** CONTEXTS IN ERROR: Name -> Error
vfszip:/E:/software%20download/jboss-5.0.0.CR2-jdk6/jboss-5.0.0.CR2/server/default/deploy/Chapter3.jar -> java.lang.IllegalArgumentException: Can't find a persistence unit named 'titan' in AbstractVFSDeploymentContext@25979158{vfszip:/E:/software%20download/jboss-5.0.0.CR2-jdk6/jboss-5.0.0.CR2/server/default/deploy/Chapter3.jar}
The persistence.xml file is as below
<?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="titan" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:PostgresDS</jta-data-source>
<class>com.domain.Cabin</class>
<properties>
<property name="hibernate.dialect" value= "org.hibernate.dialect.PostgreSqlDialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/Entity"/>
<property name="hibernate.connection.username" value="*****"/>
<property name="hibernate.connection.password" value="*****"/>
</properties>
</persistence-unit>
</persistence>
I have tried other solution like removing the class-path from manifest file but same result is displayed.
Any help is appreciated
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/619795#619795]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[IronJacamar] - ManagedConnectionFactory Life Cycle
by kiran.kumar M
kiran.kumar M [http://community.jboss.org/people/gmkumar2005] created the discussion
"ManagedConnectionFactory Life Cycle"
To view the discussion, visit: http://community.jboss.org/message/619613#619613
--------------------------------------------------------------
Hi,
I deploy the rar file by placing it in the deployment folder in jboss as 7. Later deploy my war file.
This connector in bound to a jNDI location by definition inside standalone.xml.
When it is deployed the createConnectionFactory(ConnectionManager cm) is executed by default.
I do some house keeping with help of ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
This method is again executed when i try to access the adapter using an ejb.
Problem is initally at the time of loading the classloader is null. Later it has a value when called from ejb. Effectively my housekeeping fails.
Question :
1) createConnectionFactory(ConnectionManager cm) is executed at the time of deployment => is this the proper behaviour ?
2) How can I configure ironJacamar not to execute this method at the time of deployment ?
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/619613#619613]
Start a new discussion in IronJacamar at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[JBoss Messaging] - Unable to send ping: shutting down PingTimerTask
by mani v
mani v [http://community.jboss.org/people/maniv] created the discussion
"Unable to send ping: shutting down PingTimerTask"
To view the discussion, visit: http://community.jboss.org/message/619766#619766
--------------------------------------------------------------
Hi,
we are using JBoss [EAP] 5.1.0 as messaging server
while running sever used to throw below stack trace.. as warn message.
-----------------------------------
2011-08-06 09:09:45,130 WARN [org.jboss.remoting.transport.bisocket.BisocketClientInvoker] (Timer-5) Unable to send ping: shutting down PingTimerTask
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:115)
at org.jboss.remoting.transport.bisocket.BisocketClientInvoker$PingTimerTask.run(BisocketClientInvoker.java:723)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
-----------------------------
Environemnt details follows
OS : linux - solaris
Where i do understand server is using ping to test the health of the registered client - but if this ping fails, it shouldn't leave an open thread in my client.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/619766#619766]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months