weblogic ejb3 two-phase commit - ejb-3.0

can anyone point me to a good two-phase commit on weblogic with ejb3 tutorial?
I've looked around and found only one, but it doesnt use XA.

this is a good one. weblogic 12c datasources provides us with the XA drivers, and so, everything is mostly configured on the WL console

Related

Payara 5/6 and SpringFramework

I've come to the conclusion that the Spring Web MVC is not compatible with Payara 5 and 6. I have an application that uses Glassfish 3, Spring Web MVC, and EclipseLink JPA. I intend to upgrade the code to Java 17 and Jakarta EE. In the sake of kindness, it hasn't gone well. In all my efforts, it's been Spring's Web MVC that is causing the problems. Spring charges for support and that's not a viable option for me. Before I scrap it's use, let's pick your brain.
If anyone has implemented Spring Web MVC successfully with Payara 5 and/or 6, please share how you made it work.
My first step was to try Payara 6 for Jakarta EE. After creating a VERY small Hello World web app, I included Spring Web MVC jar and did the minimum to activate it's Dispatcher Servlet. I was never able to overcome the error CDI is not available.
Secondly, I backed off to Payara 5. In that attempt, it tries to instantiate a JPA EAO Bean that the app will use in all it's controllers to access the app's DB. The error here appears to be when it attempts to use FasterXML to read the persistence.xml file. That part of the app works fine when I create the EAO object with JUnit.
Rather than providing all the gory details, reviewing the artifacts from a successfully implemented app with help me tremendously.
Thank you for your help!
So after weeks of beating my head against a wall trying all kinds of things to get it working, I wrote to one of the SpringFramework developers, Juergen Hoeller. Here's his response....
Sorry to hear that there is so much trouble on Payara still. We also
have corresponding reports on GitHub:
https://github.com/spring-projects/spring-framework/issues/29718
https://github.com/spring-projects/spring-framework/issues/29743
Unfortunately neither of the two is an actual problem to be solved on
Spring's own side, as far as I can see.
With the CDI issue, it's Payara's CDI implementation not being able to
parse Java 17's new record types. Also, I wonder why Payara needs to
parse every single deployed class file if you are not actually using
CDI. It might be possible to turn that off, but at the very least,
Payara should defensively handle "unknown" types.
With the Hibernate issue, it's a problem with Hibernate 6 initializing
its Jackson configuration on Payara. There does not seem to be a StAX
provider available, and Hibernate insists on one being present for
Jackson.
Overall, this needs to be taken to Payara and Hibernate, we are not
aware of anything Spring can do better. Feel free to add further
comments to the GitHub issues in case there is anything we can do from
our side! Even if our focus is on Tomcat/Jetty these days, we of
course want Spring 6 to work fine on Payara as well.
Thanks for your efforts to try to make this work,
Juergen
So now, how do we get the attention of Oracle's Glassfish developers and Payara's developers to get this resolved???? In the meantime, I think I'll have to install Tomcat or some other free webserver. Thanks, Oracle.
This was reported against Hibernate before, but Glassfish/Payara simply have a broken classpath config. Also see https://hibernate.atlassian.net/browse/HHH-15556
Maybe try using Wildfly, which is also free ;)

Alternative of JTATransaction

I have an Spring based J2EE application which runs well on Weblogic, I wanted to move it to Tomcat.
It seems tomcat doesn't support JTA Transaction Manager without external jar help like Atomikos, JOTM, Bitronix, SimpleJTA.
I am reluctant to make changes into my application where i am already using annotation based JTA transaction manager.
Are there alternatives for JTA Transaction Manager which I can use so that I am able to switch from weblogic to tomcat or tomcat to weblogic or any other server without changing my configuration file each time?
All in all what's best for transaction manager configuration when you want to keep your application (war) independent of server(s).
You could try TomEE.
It's a Java EE 6 server that meets the Web Profile requirements and is based on Tomcat.
So it will support JTA transactions.
You can get it from http://tomitribe.com
Just to give you a more direct link to TomEE: http://tomee.apache.org/download/tomee-1.7.2.html
If your application is configured and developed to use Weblogic then chances are you are using JDNDI to lookup the JTA transaction manager and your datasources.
So any solution that supports the same lookups would work.
For Atomikos, we recently added (commercial) support for Tomcat's JNDI space - check out http://www.atomikos.com/Main/BuyOnline to learn more.
Hope this helps!

How do I deploy a Spring MDP on JBOSS 5 App server?

I want to find out if my thoughts are correct about deploying MDP on JBOSS:
There are definitely advantages of using MDP instead of MDB but all these advantages will only work when you don’t use an EJB Container/App Server. Since, I need to use JBOSS 5 APP server, it would be an overkill to have an MDP running under Spring Context which in turn gets deployed on JBOSS App server.
The second reason is Spring framework releases are very quick whereas JBOSS 5 is old, I believe that there will be issues such as conflicting jars.
The third reason is that I haven’t seen many people doing it.
I've been working on several Spring-based projects with more than a dozen message listeners and those projects were deployed, namely, on JBoss (from Jboss 4.x in the early days to the latest JBoss EAP).
There's nothing wrong with deploying a Spring's message listener container within the JBoss infrastructure. In the past, you could hit some inconsistencies though. The most annoying was that the redelivery options defined on the queue were ignored. But that's history as from JBoss5+
To deploy your message listener container on JBoss, you need to configure a regular JndiTemplate and lookup destinations and the ConnectionFactory using it. To be able to resolve destinations by name, you need to specify a JndiDestinationResolver on the container that uses said JndiTemplate. You could also lookup the queue yourself (and get rid of the DestinationResolver)

does Spring Insight need tcServer, or can it work with Eclipse and Tomcat?

does Spring Insight need tcServer, or can it work with Eclipse and Tomcat? I see some tutorials on Spring Insight, but all of them seem to use tcServer.
Technically, Spring Insight does not need tcServer to do its work. It can work with JBoss and other containers. However the easiest packaged solution for VMware is to distribute it as a template for tc Server. VMware does not document the classpath / JVM settings / setup needed for Insight to run with other containers. Again it's technically possible, but not currently supported. I believe that configuration will be out as supported in the near future (within a month or 2)
Since tc Server is free for developers and essentially the same as Tomcat, why can't you use it with tc Server? The integration is quite nice (especially with STS/Eclipse)

Enterprise Application

I am thinking about a platform for study application (it is team work). I mean standard Java EE 5 (or maybe try raw Java EE 6) and Spring. What is your choose? (I don't mean Spring MVC but Spring Beans and EJB 3.0)
Also I would like to know what app server you use? (now I use GlassFish v2)
I would recommend Spring without EJBs.
My favorite choice of Java EE app server is WebLogic, but I don't know if Oracle is as generous as BEA was about making it available to developers.
I'd recommend using Tomcat as your app server. If you need JMS, add ActiveMQ.
As duffymo says, look at Spring without EJBs. Spring is very powerful, regardless of how much/little you use. I don't know of anyone using EJBs now. Having said that, EJBs have changed dramatically over the years, and now resemble ORMs such as Hibernate (which is worth checking out in itself).
For app servers, check out JBoss. It's free/open-source, and you can choose the web component between Tomcat and Jetty. It's JMX backbone allows you to easily monitor its state and to integrate your own JMX beans into that backbone (if you're using Spring, you can JMX-enable any bean with a simple configuration).
If you want Java EE 6 then the choice appears to be either Glassfish 3 or the beta of JBoss 6. As some of the others have said, I also prefer Spring to Java EE's EJBs.
I don't see much point in looking at Java EE 5, unless you think you will be working with it in the future (possible as some companies are conservative in using newer versions of technology).

Resources