Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying spring boot on JBOSS EAP 6.1

I am trying to deploy a jar on Jboss 6.1 EA. I had build the jar file.

I am unable to access the page http://localhost:8080/$YOURAPP/hello/World, because I get a 404 error. I replaced the $YOURAPP with the name of the war file. I do not get any errors while starting jboss, it shows the war is getting deployed.

like image 611
kamalp Avatar asked Jun 09 '16 22:06

kamalp


People also ask

Can we deploy spring boot application in JBoss?

With this configuration, the application is ready to deploy to any external application server. Once this is done, you can package your Spring Boot application as a war and deploy it to the JBoss server. To do that, you need to run mvn clean package , which will generate the war file.

What is the latest version of JBoss EAP?

Red Hat's latest JBoss EAP version is 7, with Cumulative Patches 2 and Cumulative Patches 3 (JBoss EAP 7.2 and JBoss EAP 7.3, respectively). Key features: Eclipse-based Integrated Development Environment (IDE) is available using JBoss Developer Studio. Supports Java EE and Web Services standards.

How do I deploy Microservices in JBoss?

Deploying microservices in JBoss won't give you the same flexibility as a true container system like Docker. With Docker you create standalone packages for your microservices that contain all the code, system tools, runtime environment, etc. It can be as small or large as it needs to be.

Does JBoss need JDK or JRE?

A Java Development Kit (JDK) is required for development, and a Java Runtime Environment (JRE) is required to run JBoss Enterprise Application Platform.


1 Answers

You will definitely need a .war file for JBoss because a (fat) .jar file will not work. For JBoss, you will also need a jboss-web.xml descriptor file in src/main/webapp/WEB-INF file containing the context root of your application.

For example:

<jboss-web>
    <context-root>YOUR_APP_ROOT</context-root>
</jboss-web>

After that, you will need to set one more Spring Boot property to make this work on JBoss EAP 6:

server.servlet-path = /*

This is due to a quirk in JBoss itself, if you don't have this property set to /* it will not work.

More information here and here

like image 136
Dieter Hubau Avatar answered Sep 23 '22 07:09

Dieter Hubau