[Beginner's Corner] - javax.ejb.EJBException: javax.persistence.TransactionRequiredException
by Diego Rivera
Diego Rivera [http://community.jboss.org/people/diego_rivera] created the discussion
"javax.ejb.EJBException: javax.persistence.TransactionRequiredException"
To view the discussion, visit: http://community.jboss.org/message/583343#583343
--------------------------------------------------------------
Hello, everyone!
I'm migrating an application from Glassfish 3.0.1 to JBoss 6.0.0 Final. To expedite the migration and avoid a rather hefty persistence layer refactor I'm using EclipseLink 2.1.2 as the JPA provider. Needless to say the application works fine in Glassfish. Anyway...
The application uses EJB 3.1 in a WAR (Servlet 3.0, JSF 2.0), and JPA 2.0 persistence. I have already defined the DataSources needed (included below).
I've almost got it running in JBoss 6. But I have a very strange issue regarding transactions not being properly enlisted by the persistence manager (or, at least, that's what it seems). I keep getting javax.ejb.EJBException: javax.persistence.TransactionRequiredException
Here's the (pseudo) code description-stack-thing:
Initializer.contextInitialized() -> EJB1.init() <Transaction.REQUIRED> -> EJB2.init() <Transaction.REQUIRES_NEW> -> EntityManager.createNamedQuery()
I've confirmed that the code invocation does get as far as the createNamedQuery() call because of trace logging I put in place. The problem seems to be that EclipseLink is complaining that it can't find a transaction which should obviously be there.
I've added the "eclipselink.transaction.join-existing" configuration to EclipseLink, and produced no change. I've also turned up the logging in EL in an attempt to determine where the problem is. Eclipselink is finding the correct data source (I can see that from its logs) - it's joining the transaction it seems to be having trouble with.
This is the datasource declaration in question:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <datasources>
> <local-tx-datasource>
> <jndi-name>MyDS</jndi-name>
> <connection-url>jdbc:postgresql://localhost:5432/mydb</connection-url>
> <driver-class>org.postgresql.Driver</driver-class>
> <user-name>mydb</user-name>
> <password>mydb</password>
> <check-valid-connection-sql>select 1</check-valid-connection-sql>
> <metadata>
> <type-mapping>PostgreSQL 8.0</type-mapping>
> </metadata>
>
> <min-pool-size>8</min-pool-size>
> <max-pool-size>32</max-pool-size>
> <idle-timeout-minutes>30</idle-timeout-minutes>
> <prefill>true</prefill>
> </local-tx-datasource>
> </datasources>
The JDBC driver jar is in the right place, the datasource is shown as active in the admin console, etc.
I've not tested using an XA datasource because I'd just as soon avoid the overhead if I can (since I don't need it). This is my persistence.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance" version="2.0"
> xmlns=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence" xmlns:jpa=" http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
> xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
> <persistence-unit name="Persistence Core">
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> <jta-data-source>java:/MyDS</jta-data-source>
> <shared-cache-mode>NONE</shared-cache-mode>
> <properties>
> <property name="eclipselink.logging.level" value="ALL"/>
> <property name="eclipselink.target-database" value="PostgreSQL"/>
> <property name="eclipselink.weaving.changetracking" value="false"/>
> <!-- BEGIN PROPERTIES NEEDED FOR JBOSS COMPATIBILITY -->
> <property name="eclipselink.transaction.join-existing" value="true"/>
> </properties>
> </persistence-unit>
> </persistence>
Maybe I'm missing something in jboss-web.xml? This is the one I'm using...
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 3.0//EN" " http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
> <jboss-web>
> <context-root>/</context-root>
> </jboss-web>
As you can see, no funkyness there... maybe that's the problem?
The other problem I was having was that originally I was using a @Startup @Singleton bean with a @PostConstruct method, and was getting exceptions regarding @PostConstruct being called on a newly created bean. Thus, I switched to the WebListener-based startup model that I'm currently using (which should work just the same anyway).
Thanks!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/583343#583343]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[jBPM] - Re: JBPM-BPEL on Weblogic and Oracle
by meeraganatra
meeraganatra [http://community.jboss.org/people/meeraganatra] created the discussion
"Re: JBPM-BPEL on Weblogic and Oracle"
To view the discussion, visit: http://community.jboss.org/message/588520#588520
--------------------------------------------------------------
Hi Alejandro,
Thanks for the reply.
This is really very bad news for me.
Anyways now I am at the stage where I manage to deploy webservice on weblogic and also have client to call.
But now I am getting below error, and also know that I have to write class for weblogic which implement EndpointMetadataLookup.
Any implementation available of EndpointMetadataLookup for Weblogic?
So need your advice, should I go ahead with resolving following error so its better to switch other BPEL engine?
As you know I have invested more than 2 weeks on it L
Thanks and Regards,
Meera
java.rmi.RemoteException: SOAPFaultException - FaultCode [{ http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [no endpoint metadata lookup for message context: weblogic.wsee.message.soap.SoapMessageContext] FaultActor [null] Detail [<detail>org.jbpm.bpel.BpelException: no endpoint metadata lookup for message context: weblogic.wsee.message.soap.SoapMessageContext
</detail>]; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: no endpoint metadata lookup for message context: weblogic.wsee.message.soap.SoapMessageContext
at examples.webservices.syncproc.client.Syncproc_Stub.process(Syncproc_Stub.java:37)
at com.amdocs.oss.bpel.HelloTest.testSayHello_proxy(HelloTest.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: javax.xml.rpc.soap.SOAPFaultException: no endpoint metadata lookup for message context: weblogic.wsee.message.soap.SoapMessageContext
at weblogic.wsee.codec.soap11.SoapCodec.decodeFault(SoapCodec.java:273)
at weblogic.wsee.ws.dispatch.client.CodecHandler.decodeFault(CodecHandler.java:106)
at weblogic.wsee.ws.dispatch.client.CodecHandler.decode(CodecHandler.java:91)
at weblogic.wsee.ws.dispatch.client.CodecHandler.handleFault(CodecHandler.java:79)
at weblogic.wsee.handler.HandlerIterator.handleFault(HandlerIterator.java:254)
at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:224)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.handleResponse(ClientDispatcher.java:161)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:116)
at weblogic.wsee.ws.WsStub.invoke(WsStub.java:89)
at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:335)
at examples.webservices.syncproc.client.Syncproc_Stub.process(Syncproc_Stub.java:32)
... 20 more
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/588520#588520]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
Re: [jboss-user] [jBPM] - Human Task Problem
by Juan Ignacio Barisich
Juan Ignacio Barisich [http://community.jboss.org/people/jbaris] commented on the document
"Human Task Problem"
To view all comments on this document, visit: http://community.jboss.org/docs/DOC-16508#comment-5446
--------------------------------------------------
Candy,
Look at the human-task-problem.zip file that I recently attached.
This file contains a maven project with your files (ProcessTest.java and sample.bpmn) and the necessary dependencies to run it. It also contains some modifications (look at the //FIXED comments) that fixed the problem.
I hope it will help you.
Regards,
--------------------------------------------------
13 years, 9 months
[JBoss Tools] - hbm.xml
by Eric J. Van der Velden
Eric J. Van der Velden [http://community.jboss.org/people/ericjvandervelden] created the discussion
"hbm.xml"
To view the discussion, visit: http://community.jboss.org/message/588473#588473
--------------------------------------------------------------
Hello,
As in the book JBoss Tools 3 of Anghel Leonard, I have created a dynamic web project You can store it in the default location (eclipse's workspace) or in another location. In src/mappings/ there is a class type Parent, and I want Tools to generate the Parent.hbm.xml file. When I had chosen the default location the file is generated, but when I have chosen another location, Tools cannot find src/mappings/, I get a org.eclipse.core.internal.resources.ResourceException: resource /Java/JBoss/Hibernate/projects/testHibernate/src/mappings does not exist. Well it is a sub directory of my home directory and not of the root directory.
Thanks,
Eric J.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/588473#588473]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months
[jBPM] - Re: how to resume process
by km wen
km wen [http://community.jboss.org/people/kmwen] created the discussion
"Re: how to resume process"
To view the discussion, visit: http://community.jboss.org/message/588416#588416
--------------------------------------------------------------
I define the fisrt process definition as following:
*ProcessEngine processEngine = new Configuration().setResource("jbpm.cfg.xml").buildProcessEngine();*
* RepositoryService repositoryService = processEngine.getRepositoryService();*
* ExecutionService executionService = processEngine.getExecutionService();*
* repositoryService.createDeployment().addResourceFromClasspath("testFragment.jpdl.xml").deploy();*
* executionService.startProcessInstanceByKey("testFragment");*
The testFragment is as following;
*<?xml version="1.0" encoding="UTF-8"?>*
*<process name="testFragment" xmlns=" http://jbpm.org/4.4/jpdl http://jbpm.org/4.4/jpdl">*
* <start g="48,134,48,48" name="start">*
* <transition name="to HelloWorld" to="HelloWorld" g="-87,-22"/>*
* </start>*
* <custom class="org.jbpm.testMigration.MyTest" g="359,196,92,52" name="Test">*
* <transition name="to end" to="end" g="-43,-22"/>*
* </custom>*
* <java class="org.jbpm.testMigration.HelloWorld" g="147,194,92,52" method="printHelloWorld" name="HelloWorld">*
* <transition name="to Test" to="Test" g="-45,-22"/>*
* </java>*
* <end g="554,146,48,48" name="end"/>*
*</process>*
in custom node i throw an exception und catch it in catch block
*catch (Exception e) { *
* *
* System.out.println("we need the exception handling");*
* activityExecution.waitForSignal();*
* *
* ProcessEngine processEngine = new Configuration().setResource("jbpm.cfg.xml").buildProcessEngine();*
* RepositoryService repositoryService = processEngine.getRepositoryService();*
* ExecutionService executionService = processEngine.getExecutionService();*
* executionService.signalExecutionById("testFragment");*
*}*
when i execute testFragment, the following execption occurres:
*exception in thread "main" org.jbpm.api.JbpmException: execution testFragment does not exist.*
how can i resume the testFragment? pleas help
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/588416#588416]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 9 months