Wildfly compatibility with EJB - jboss

I’m working on a migration project that woul change WebLogic application server soon to be off support to Wildfly 10.0.0.Final, the problem I’m facing is that the project was built with ejb 2.1 and I don’t know wether Wildfly 10.0.0 would be compatible or not ?
Thanks in advance

Your migration will be relatively easy unless your application makes use of CMP entity beans.
If you have more than around 3 or 4 of these then migration will get tricky as you would need to migrate the CMP beans to JPA.
Otherwise, most changes will revolve around moving to Java EE standard JNDI names

Related

Does Jboss 7.1 AS supports ejb 2.1?

it seems jboss AS 7.1 supports ejb 2.1.Our ejb 2.1 based application is deployed on jboss 5 AS. We are migrating it to jboss7.1. but i want to know what are the additional configurations required to run ejb 2.1 without any errors?
EJB2 is still supported in AS7.x, the issue might be that AS7 is a new implementation and some of the tuning options and configuations are not available for AS7 - especially the EntityBean CMP.
There are some added for EAP6 (based on AS7) you might download the unsupported version.
Wildfly (the successor of JBossAS) will not continue to support EJB2 EntityBeans because EJB3.2 declare it as optional.
Note EJB2 session beans are still supported but I recommend to upgrade it to EJB3 this should faily simple.
You might keep the EJB2 interfaces to provide an interface for EJB2 clients, but I expect effort for the client as well as the lookup Strings changed.
If the appliation should be kept for the future I would recommend to migrate to EJB3

migrate from JBOSS AS6 to wild fly

I know its a very high level question, but it will be very much help full if somebody can help me to kick start the migration.
So please provide some links or use full hints to start with it.
Also if somebody knows about delta changes between JBOSS AS 6 to Wild fly.
Major change which i know that our application uses-
JBOSS AOP
JBOSS Interceptors
and binds it in jboss-aop.xml
like below
<bind pointcut="execution(public * *.DBDAO >updateBO(com.test.model.TestClass, com.test.model.TestClass2))">
<interceptor-ref name="TestInterceptor"/>
</bind>
which is not supported by wild fly now.
And so there must be other thing s which might not be supported by wild fly.
Thanks.
According documentation:
Replace JBoss AOP Interceptors
JBoss AOP (Aspect Oriented Programming) is no longer included in JBoss AS 7. In previous releases, JBoss AOP was used by the EJB container. However, in AS 7, the EJB container uses a new mechanism. If your application uses JBoss AOP, you need modify your application code as follows.
Standard EJB3 configurations that were made in the ejb3-interceptors-aop.xml file are now done in the server configuration file. For a standalone server, this is the standalone/configuration/standalone.xml file. If you are running your server in a managed domain, this is the domain/configuration/domain.xml file.
Applications that integrate AOP interceptors into the EJB layer must be redesigned to use EJB3 interceptors and CDI. Server side interceptors can be changed to EJB3 interceptors, but there is no client side interceptor in AS 7.
Like AOP exist other changes you can see in: How do I migrate my application from AS5 or AS6 to WildFly and Experiences with migrating from JBoss AS 7 to WildFly 8.1
The last link refers to some changes that are not in the official documentation.
Here is whole migration guide from Red Hat. JBoss EAP 6.2 has similar architecture to WildFly so you can use it:
https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.2/html-single/Migration_Guide/index.html

MyBatis integration with JBoss 7.1 web application

Had anybody attempted to use MyBatis as their persistence library for a JBoss 7.1 /Java EE6 application?
I'm wondering what are the best approaches to handling connections, transations, rollbacks etc?
How about CDI support? Looking around online it seems at this time MyBatis only supports two Dependency Injection (JSR-330) frameworks, Google Guice and Spring. I did run into CDI Extensions which may be something look into.
My idea would be to have the container handle all of the above however it may be difficult getting to that point.
Any tips, hints, experiences?
There is a new mybatis-cdi module. It is not released yet, but you can try the snapshot, it is at github: https://github.com/mybatis/cdi
There is no CDI support at all but as you said, if you want DI go Spring or Guice.
With JBoss you have mainly two chances:
- EJB 3
- Spring
If using EJB 3 transactions are handled automatically by them. MyBatis just ignores transactions and lets the container commit/rollback.
When using Spring, MyBatis ties to Spring transactions using the integration module MyBatis-Spring.
I would create my own CDI bean - use #Produces for a factory, and #Inject to get the session.
Here is old iBatis Spring factory, that might be the producer, after some changes:
SqlMapClientFactoryBean

Use singleton EJBs in Eclipse Projects

I just downloaded some days ago the last versions of Eclipse and JBoss, created a SessionBean (EJB3.x) project and now I'm trying to create an Singleton EJB, but eclipse is not allowing me to do it and gives me the folowing warning message " The 'Singleton' state type is allowed only for EJB projects with version 3.1 or later". Unhappily, when I create the project, the hihgst version possible is 3.0.
What am I doing wrong? I need a singleton Ejb now!!!
Thanks in advance,
Saul
Problem solved!
Indeed Jboss 5.1 didn't support EJB 3.1, but JBoss 6.0 does!
Just an observation to those are facing this same problem. Eclipse doesn't have the adapter for JBoss 6.0, but if you use the one provided for JBoss 5.0 it works just fine (I read somewhere there might be some problems, but at least till now, it's ok).
Also, if you try to create an singleton EJB through Eclipse, it'll not work, but you can create another type of EJB and then change the annotation to #Singleton and it'll work.
Best Regards,
Saul

How to make a java project from a Websphere ear work with JPA

I have an EAR installed in Websphere 6.1. Development is done in Eclipse, but using a simple Java project and updating the *.java and *.class files directly to the server. I want to start using JPA, but the #Stateless annotation gives the error "cannot be resolved to a type". What am I missing?
Thank you for your time,
Iulia
You need either to be on WebSphere 7.0, or to have installed the EJB3 Feature pack for WebSphere 6.1. You pattern of use of EAR files and plain java projects sounds a little diferent from what I've done. Suggest you start by following Roland Barcia's tutorial, et that going before you experiment with other patterns.
This tutorial may be helpful, it relates to WebSphere 6.1 + feature pack.