Running EJB 2.1 on Wildfly 10 - java

I want to run EJB 2.1 with Wildfly-10 AS
I have a server running on jBoss-EAP-6.2
Following are the configuration xml files
I wanna achieve to run a Web Module (JSF) with existing server (EJB 2.1) running on JBoss-EAP-6.2.
Following are the ideas
I can run JSF on JBoss-EAP-6.2 (possible?) that can communicate with EJB within the server
Deploy JSF on wildfly and it communicate with EJB through JBoss-EAP-6.2
MORE / FINDINGS
while deploying JSF on JBoss-6, I am getting blank page on opening, noting is shown
Wildfly does not support CMP files of EJB 2.1
The Idea
We have a desktop based [swing] application running on JDK 1.7, EJB 2.1, JBoss-EAP-6.2. I want to enable/implement its web module [JSF]
I want to reuse its server [EJB].
My idea is to use EJB 2.1 with JSF on Wildfly or deploy JSF to connect EJB on JBoss-EAP-6.2.

Try to migrate from EJB2.1 to new EJB3.x. I understand that it will be really a hard way, but it will be easier to extend this application further. Then you will be able to easily write your web module on JSF within WildFly 10.
Start new server instance of WildFly 10 and try to use remote EJB2.x interfaces within it to access business logic. And then use it to build your web module.
Develop REST facade on top of your EJB on jBoss-EAP and then use it the way you want it.
Start writing from scratch with new technologies.

Related

Accessing EJBs deployed in WildFly from an application running in Jboss5

I am running an application in integration with another team's application.
My application is running on JBoss5 and jdk6
Other Application is running on Wildfly8 with jdk8
My application calls an EJB Bean deployed as part of other application but this look up fails.
I am not willing to migrate to wildfly as it could be little time taking task but I am not even getting rid of it.
Any suggestions guys so I can avoid this migration.
See the below links which describes to configure an EJB client in JBoss:
https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI
https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+server+instance

Is it possible to consume a web service deployed in glassfish by an application on client side using apache tomcat?

this may be two questions in one, so...Sorry, please correct me if I'm wrong.
I have to deploy a web service developed with JPA, JSP and Glassfish 3.1.2, in a machine which only has apache Tomcat 7 as server installed on Windows 7.
I don't really know how apache can connect to the database externally, or if that is really possible if you don't use TomEE.
I know in Glassfish you can have a connection pool and a jdbc resource, and if you're using JPA, that's how the connection to database works(kindof), so you can deploy the .war file. But, if you only have a Tomcat and the app is using JPA, so it does not connect itself to the database(It does not have a class with a connection credentials), How can I achieve this?
Or, Can I deploy the .war of the web service on Glassfish and then be consumed by an application that only works with apache Tomcat on client side? Am I mixing concepts which should not be mixed?
Any enlightenment is highly appreciated.
You can use Tomcat with JPA, you can even use it in a standalone java application. Define a persistence unit name in persistence.xml, make sure the transaction type is RESOURCE_LOCAL (you can't use JTA in Tomcat, make sure to check this), and get a reference to the EM using the following
EntityManagerFactory emf = Persistence.createEntityManagerFactory("persistenceUnitName");
em = emf.createEntityManager();
Finally, add the jpa provider jars to Tomcat, there are examples for that (I've never done it, but I'm sure some Tomcat expert could lend a hand)
The other option could also work, that is consume your webservice using a client deployed on another server
Good luck!
If your application uses advanced Java EE functionality (JTA, CDI), it won't work on Tomcat. If it uses JSTL, you will have to add a JSTL library to the tomcat installation. Read the docs, it should be stated somewhere, but I would not simply deploy the war to a tomcat.
If you just want to develop a relay webapp that consumes a webservice and displays the results, it will run on tomcat independantly of where the webservice runs.

How to migrate from JBoss Portal to GateIn?

I am new to GateIn portal.
We have developed portal using JBoss Portal 2.7, which has simple UIs.
How can I migrate my portal application from JBoss portal 2.7 to GateIn final release?
From where to get the idea about how to create a new simple portal using gatein and all the configuration that need to be done for that.
If your portlet/web application is based on EJB Components, then it can only be deployed on an application server, such as JBoss, which underlies all Entreprise Edition features.
GateIn portal is nothing but a portlet container, internally a web applcation that must be deployed in an application server such as Tomcat AS or JBoss AS, but a full EE Server is a must in order to have all entreprise java beans and services functional.
So the essence is, if you are using EJBs in your development, then you can only use an Applciation server with EJB container.

Does EJB need a dedicated server in order to be used?

I am new to Java EE. Does EJB need a dedicated server in order to be used or can I potentially make a Java EE application simulation on my laptop via only a web server?
EJB need an application server like JBoss, WebSphere, WebLogic, GlassFish, etc.
Pure web servers like Tomcat or Jetty cannot run EJB.
All application servers can also function as a web server.
So the answer to your question is - no, you can't run EJB only via a web server but yes, you can run an application server on your laptop and use it to run web and EJBs.
A more technical explanation is that you need an EJB container to run EJBs and a web container to run servlets and JSPs. A web server has only a web container. An application server has both.
You need an EJB container to run EJB with all the features (i.e. transaction, security etc.). But if you are are using EJB3 you can use something like ejb3unit to unit test the functionality of the EJB classes.
http://ejb3unit.sourceforge.net/
You need a EJB container to run EJB applications. However, it is easy to run one on your computer, just as it is easy to run Apache server for HTML/PHP applications. Glassfish is an example server which contains an EJB container.
If you only want the EntityManager functionality from EJBs, then you can simply use Java SE. See here.

What are the differences when deploying on Tomcat vs. Websphere?

If I were to deploy an application on Tomcat vs. Websphere, what are things that I need to consider?
Do I have to develop my Java code differently if developing in one app server vs another?
Edit:
I will be funneling people from a website into a web app that does credit card processing and e-signatures (cc processing and e-sigs are through separate services). That is its sole job
You cannot use EJBs on Tomcat (unless you add OpenEJB). If your WebSphere deployment uses EJBs, you'll have to remove them to deploy on Tomcat.
If you use any Java EE features beyond servlet/JSP engine and JNDI naming service you'll have to eliminate them from your app.
Tomcat accepts WAR packages. If you package your app into an EAR on WebSphere, you'll have to change it to WAR for Tomcat.
Both use JNDI for data sources. There might be some nagging differences in naming conventions, but if you stick to the standard they should be portable.
If you use any WebSphere specific code in your app, you'll have to remove it to deploy on Tomcat.
If your app is servlets, JSPs, and JDBC you can deploy on either one without any problems.
You can think as Tomcat as a subset of Websphere, so theoretically everything that works on Tomcat will work in Websphere.
But...Deploying in Websphere, in my humble opinion, is a terrible pain, while deploying in Tomcat just works. (And if fails, just delete temporary folders)
Without knowing the technologies you are using, that's all I can say.
Depends, what are you trying to deploy?
Tomcat isn't a full EE server--are you trying to deploy an EE app?
If you're just deploying a web app, it's more important to consider which version of the servlet spec/etc. each server implements.

Categories