[Persistence, JBoss/CMP, Hibernate, Database] - JPA in database with no transaction support
by fobos
Hi all, i have a mapped Entity JPA tables to database with no transaction support and when a have a SSB with eg:
anonymous wrote : List method x(){
| 1- x = em.persist(obj);
| 2- y = em.find(obj.class,key);
| 3- z = em.createNamedQuery(queryXX).getResultList();
| System.out.println(x+y+z);// at this line all ok
| return z;
| }
the lines 1,2,3 and 4 run perfect print objects in console, but when in a Backing Bean for JSF i access this SSB and call this method throws the folowing exception:
anonymous wrote : java.lang.RuntimeException: javax.transaction.RollbackException: [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] [com.arjuna.ats.internal.jta.transaction.arjunacore.commitwhenaborted] Can't commit because the transaction is in aborted state
| org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)
The problem is in a SSB ? JPA Implementation ? JSF ?
The registry in line "1- x = em.persist(obj);" is persisted in database and some operations is ok print in console, but when a return a object to JSF backing bean the error is throw.
JPA works with databases can´t work with transactions ??
Please helps, i using a Informix database with no transaction support.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061985#4061985
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061985
18Â years, 9Â months
[Messaging, JMS & JBossMQ] - Re: connection factory to remote queue
by dlgrasse
Adrian,
I appreciate your willingness to reply to my question. Thank you for your time.
In the second part of my previous post I showed where I changed the name values, but still will failure (no queue found, plus some dependency issues). I've since corrected the dependencies (by adding in the <rar-name> tag). However, the queue is still not being resolved.
I even tried adding a packet sniffer between the two machines to see if any attempt was made to connect to the remote server, but see nothing happening.
You ask if it's hard to understand. My answer is that the examples are clear, though maybe not complete. I had no problem following what they say to do, but I'm suspecting there is something key missing.
I have verified that I can ping the remote server's port. (BTW, one example showed 1099 while another showed 1100 as the remote port to connect to. There is no port 1100 open, but I can telnet to 1099 just fine and see that it's the org.jnp.server.NamingServer_Stub RMI instance.)
For reference sake, here's exactly the current state of changes to the default config:
added to jms/jms-ds.xml
<mbean code='org.jboss.jms.jndi.JMSProviderLoader'
| name='jboss.mq:service=JMSProviderLoader,name=EventJMSProvider,server=<remote queue server>'
| >
| <attribute name='ProviderName'>EventJMSProvider</attribute>
| <attribute name='ProviderAdapterClass'>org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
| <attribute name='FactoryRef'>java:/XAConnectionFactory</attribute>
| <attribute name='QueueFactoryRef'>java:/XAConnectionFactory</attribute>
| <attribute name='TopicFactoryRef'>java:/XAConnectionFactory</attribute>
| <attribute name='Properties'>
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jnp.interfaces
| java.naming.provider.url=<remote queue server>:1099
| </attribute>
| </mbean>
| ...
| <tx-connection-factory>
| <jndi-name>EventJmsXA</jndi-name>
| <xa-transaction/>
| <rar-name>jms-ra.rar</rar-name>
| <adapter-display-name>JMS Adapter</adapter-display-name>
| <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
| <config-property name='SessionDefaultType' type='java.lang.String'>javax.jms.Queue</config-property>
| <config-property name='JmsProviderAdapterJNDI' type='java.lang.String'>java:/EventJMSProvider</config-property>
| </tx-connection-factory>
and in my code I connect to the ConnectionFactory using JNDI "java:/XAConnectionFactory",
and the queue using JNDI name "queue/EventQueue"
At startup of JBoss, the following error is seen:
anonymous wrote : Jul 09 2007 09:33 | ERROR | PFApplicationServlet | An error occurred during servlet initialization. Reason follows:
| javax.naming.NameNotFoundException: EventQueue not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:528)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:281)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:255)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
dlgrasse
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061981#4061981
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061981
18Â years, 9Â months