Accessing EJBs deployed in WildFly from an application running in Jboss5 - java

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

Related

Migrating from tomcat to websphere

At the moment, I'm developing a java web application locally(localhost) on Windows, using Tomcat 8.5 .
Unofortunately, I have no developing enviroment, so I have to do everything locally and then deploy to production via .WAR .
The issue is that the production application server (Linux RedHat) is running on websphere, if I generate the .WAR on tomcat, Will I have any problems to run it on WebSphere? Should I change anything in my code or web xml?
My system does nothing fancy, no hibernate, no spring, just a very classic mvc web application.
Thanks in advance
In general you shouldn't have to make any changes, but there are some differences between the two environments that could cause issues.
IBM provides a tool that will analyze your application and suggest changes that may need to be made. You can find more information here: https://www.ibm.com/developerworks/library/mw-1701-was-migration/index.html

Running EJB 2.1 on Wildfly 10

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.

Java Spring MVC deploy .war on GlassFish

At first i want to say that i'm a beginner in java servers and never deploy an java .war app on server other than localhost in my intellij.
I have a simple only REST app Which work fine in localhost, i also created war file and deploy it by command "asadmin deploy --port 4849 war_name", but when i go into url http://stachurskipiotr4.usermd.net/cookbook-1.0-SNAPSHOT there is an server error.
I completely don't know what it is, i will be grateful for any help.
Access the domain port for that case. Default is 8080 if you haven't configured.
http://stachurskipiotr4.usermd.net:8080/cookbook-1.0-SNAPSHOT
Also, please use or log in your admin console to see the apps if it's deployed. You can also access it directly from there.
Glassfish already provides the Jackson libraries and the version conflicts with the one Spring depends on. Glassfish is an enterprise container, is there a specific need for the enterprise container? Try a regular servlet container like Tomcat instead. If you do want enterprise, maybe you shouldn't need using Spring
EDIT:
Removing jackson jars from your project won't help you; Spring code wants the version it wants. You can try to find out which version Glassfish provides and then see which version of Spring depends on that and use that version of Spring. This is a wrong thing to try as this will be just the tip of the iceberg. Do not try to deploy Spring code in an enterprise container, these are competing specs.
Your options are
1) figure out why is Tomcat not working. Tomcat is a battle-tested servlet container with thousands of production deployments.
2) Try a different servlet container such as Jetty.
3) Rewrite your code to the JEE specification and deploy to an enterprise container such as Glassfish or Wildfly (there are others).
4) Use Spring Boot to embed the container and package your app as an executable jar.
EDIT2:
If you chose Spring Boot, your artifact will be an executable jar, you do not deploy it into a container since the container is embedded. You start the jar via a java command. You remove the container from your deployment entirely. I don't know your deployment environment, but you do not use Glassfish at all at this point, you have to run the java command to start the server.
If Glassfish is a requirement, you have to rewrite your code

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.

JBoss starting with only EJB Container

I am currently writing a web application which uses JBoss6.x as the application server, for load sharing what I have decided is to write some EJB's which can be either run locally on the same machine as the web application on the Jboss or in a separate machine which will be remotely connected which will have Jboss running on it.
Now the question here is, I would be needing only 1 JBoss server to serve the web application, all other Jboss in question should be running with only the EJB Containers. Is it possible to run only the EJB Container and the naming services so that I can remotely connect to the same? Pointers or specific links as to how to go about doing this would be much appreciated.

Categories