I am trying to deploy a spring .war into jboss but am getting 404 errors. I know this has been asked before:
springBoot application on Jboss EAP, servlet context not lodaed
Spring Java Config vs Jboss 7
Cannot deploy Spring Boot on jBoss EAP 6.3.3
But I am very new (this week) to maven/spring/jboss, so may well have messed up. I tried what I understood from the various solutions above and none of them worked for me. Probably me messing up or missing something. So I thought I'd get the problem as simple as I can.
I took the code from:
https://github.com/spring-guides/gs-rest-service.git
And then work in the complete folder.
cd complete
mvn package
java -jar .\target\gs-rest-service-0.1.0.jar
And that all worked as you'd expect.
So then I followed the instructions here (http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file) to modify my code and pom.xml to produce a war file.
pom.xml http://pastebin.com/BiLWDskd
Application.java http://pastebin.com/par7rftz
I then mvn clean package and load the resulting .war file into EAP using the UI (http://i.stack.imgur.com/N7zxG.png).
So then in theory this should be the URL right
http://localhost:8080/gs-rest-service-0.1.0/greeting
I also tried
http://localhost:8080/greeting
But am getting the 404 error (http://i.stack.imgur.com/T6J6z.png) as described in the other questions. Nothing appears in the jboss console log at all after the .war is loaded.
So am I missing something? Do I need to write a jboss #WebServelet class to wrap around the spring stuff? Changes to my pom.xml? Should I not be using springboot, and just just pring framework modules directly? I note that in the EAP screen it does not show the class in the third column like it did with the jboss sample .war.
Remember I am new to this, so please explain stuff as if I'm a complete dummy (which I am).
Details of my setup:
OS Windows7 x64
java version "1.8.0_91"
Apache Maven 3.3.9
Springboot 1.3.3
JBOSS EAP 6.4.0
No IDE, using vim and command line
I encountered the same problem on JBoss EAP 6.4 / spring boot 1.5 and what fixed it was to add this property to application.properties
server.servlet-path=/*
as explained in this post : Deploying spring boot on JBOSS EAP 6.1
A simple tutorial you can follow (though he miswrote the property server.servlet.path )
http://code-adda.com/2018/06/how-to-deploy-spring-boot-war-in-jboss/
Related
I am trying to migrate my application server (JBOSS EAP) from 6.4 to 7.4.3. But, after migration I am getting the below error during my spring boot microservice deployment time.
Caused By: java.lang.NoClassDefFoundError: org/apache/tomcat/util/res/StringManager
Thus, after doing some research I have removed couple of essential tomcat dependencies(tomcat-embed-el-9.0.58 and tomcat-embed-websocket-9.0.58 from my maven pom and the deployment time issue has resolved. Now, I can deploy my application in my new local JBOSS EAP 7.4.3 server. But, the above mentioned two dependencies are essential and we can't exclude that as per our upper environment configuration.
Could you please give me some solutions except the above one(means without removing the tomcat dependencies) if you have faced this issue before. Thank you all!
Regards,
Ritesh
EAP 7.4 is using Undertow and not Tomcat so Tomcat classes aren't available.
also it is really a bad practice to depend on spec implementations internal in your code. The fix would be to remove all usage of that Tomcat class or make it part of your application.
I was using Apache tomcat 9.0.44 earlier and due to some security vulnerabilities I've upgraded it to 9.0.62 now.
/bin/Version.bat shows correct version now 9.0.62
Also checked registry keys and it also shows correct version
Still on security dashboard we are getting "Vulnerable version of Apache Tomcat is installed 9.0.44"
All the applications are working fine.
I am not sure if during upgrade I've missed anything.
During upgrade from 9.0.44 to 9.0.62 these were the steps that I'd followed:-
From this URL https://tomcat.apache.org/migration-9.html#Upgrading_9.0.x checked the configuration file changes from Apache tomcat 9.0.44 to apache tomcat 9.0.62 and perform these changes in the configuration files as applicable.
Replaced all jar files from
Downloads\apache-tomcat-9.0.62-windows-x64\apache-tomcat-9.0.62\lib to
Tomcat9/lib directory
Updated Bootstrap.jar , Tomcat-juli jar , Tomcat9.exe , Tomcat9w.exe files from
Downloads\apache-tomcat-9.0.62-windows-x64\apache-tomcat-9.0.62\bin to
Tomcat9/bin
Also java -cp "catalina.jar" org.apache.catalina.util.ServerInfo shows :-
could anyone please suggest what is incorrect in this case?
I'm trying to migrate some EAR-files from Apache Geronimo 3.0.1 to Apache tomEE 7.0.2.
The only reason to migrate is the "death" of Geronimo and it's lack of Java 8 Support and tomEE looks like its successor.
I was able to get the server running in eclipse 4.6.3 and deploy a new dynamic web project but I can't create a EAR-project for tomEE.
Do I have to change the EARs (containing multiple .war-files) into single .war-files? It seems like tomEE has EAR-support (http://tomee.apache.org/deploying-in-tomee.html) but I can't find any info how to create one that will work.
Thanks for your support!
you can define where is your ear using in tomee.xml and then just drop your .ear in tomee.base/apps.
I am migrating an application that used Jetty 7.4.5.v20110725 to Jetty 9.3.0.M2, using Maven. I already had upgraded the javax.servlet-api to 3.1.0.
But I am using the FakeHttpServer version 0.3.0 for tests, and at this time there is no newer version. It uses the org.eclipse.jetty.server.nio.SelectChannelConnector class that used to exist up to Jetty 8.x, but does not exists anymore in Jetty 9.
Currently my projects breaks at runtime with a NoClassDefFoundError due to the removed class in Jetty that FakeHttpServer tries to use, holding me back from upgrading Jetty. What can I do to fix that?
Note, this was also cross-posted in the Portuguese StackOverflow version: https://pt.stackoverflow.com/q/64548/132
Upgrade the code that uses Jetty on FakeHttpServer for Jetty 9.
That is your only choice if you want to use Jetty 9 with FakeHttpServer.
Looking at the project page for FakeHttpServer, it seems that there have been no updates (commits) to the project tree since Dec 2012.
You'll either have to convince the project leads to update it, or do it yourself.
Note that Jetty contains several ways of testing webapps. Look at the unit tests in the jetty source code and I'm sure you will find the equivalent of FakeHttpServer.
ServletTester comes to mind as one example. Or just create a Server using the LocalConnector is another way.
I am using IBM web-sphere 6.1 as a application server and eclipse as IDE. so i have one project name as MobileBank.ear which contain deployment descriptor file which has one module name as amsejb.jar which is ejb project and some jar files. so while adding MobileBank.ear into the server i am getting the following error " Web-Sphere v6.0 only supports J2EE 1.2, 1.3, and 1.4 Enterprise applications." due to this error i am not able to deploy my ear can anyone guide me please... also MobileBank.ear contains web project though i am not able to add the ear. Kindly Guide me...
Thanks in advance...
Vinod
I am using IBM web-sphere 6.1 ... Web-Sphere v6.0 only supports ... Are you sure you are using WAS 6.1 ?? May be this is what causing the problem
Well, 6.1 really doesn't support more than 1.4 and you're attempting to use newer versions.. You should
Edit the project facets in the project properties to utilize older versions
Not select 6.0 when generating the project as the target. That is used for the remote deployment etc. Eclipse does not really support 6.1/7.x deployment so please generate the generic projects instead.
i deleted the EAR folder ,created new Enterprise Application Project and added all project in that . error got resolved .
I am using WAS 7.0
U need to change the WebSphere Application Server version under Coniguration section while creating a project in Eclipse/RAD.
Then Dynamic Web module version will get changed from 3.0 to 2.5
While creating a dynamic web project,
-- On entering the "project name"
-- we have an option to check "Add project to EAR"
-- Enter the EAR name
-- choose the EAR version on of these - 1.2, 1.3, 1.4 and 5.0
On doing this, we would be able to add the EAR to WAS (I have been using v7)