Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] # Unable to initiate spring boot application using Jetty 11.0.21


Hi,

Firstly, you're referencing the jetty-12 documentation, but your pom.xml and the title of your email says you're using jetty-11. The correct link to the jetty 11 documentation is here: https://jetty.org/docs/jetty/11/programming-guide/maven-jetty/jetty-maven-plugin.html. It's important to follow the correct documentation for the release you are using.

As I understand it, spring boot creates an executable war file that can embed jetty, whereas running your webapp with jetty maven plugin inverts that relationship - an external jetty instance will run your war file. If your war file is pre-built, as your jetty.xml seems to imply, then you should:

a) check that it contains the required spring jars in WEB-INF/lib
b) run using the jetty:run-war goal (as you have pre-assembled your webapp)

Jan



On Mon, 8 Jul 2024 at 17:20, Debarshi Saha via jetty-dev <jetty-dev@xxxxxxxxxxx> wrote:
Hi Team,

Hope you are all doing well.

I'm here with one issue which I'm not able to fix from the past few days. It will be very helpful if I get assistance on this.

Issue Description:
  1. I've created one spring boot project (version 2.7.8) using JDK 17 and used maven jetty plugin and WAR plugin along with jetty dependency and excluded tomcat.
  2. I'm using maven jetty:run goal in order to initiate jetty using contextXML and provided the required configuration as instructed in jetty official page

  3. When I start jetty, the container is getting started however it is not initiating spring boot application. However when I'm using java -jar <WAR file absolute path>, the application get started in the embedded jetty server.

Could  you please help me with this?



[INFO] <<< jetty:11.0.21:run (default-cli) < test-compile @ demo <<<
[INFO]
[INFO]
[INFO] --- jetty:11.0.21:run (default-cli) @ demo ---
[INFO] Configuring Jetty for project: demo
[INFO] Classes = /home/baku/Downloads/demo/target/classes
[INFO] Context path = /
[INFO] Tmp directory = /home/baku/Downloads/demo/target/tmp
[INFO] web.xml file = null
[INFO] Webapp directory = /home/baku/Downloads/demo/src/main/webapp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] jetty-11.0.21; built: 2024-05-14T03:19:28.958Z; git: 996cd61addad9cb033e0e3eba6fa3f0fa3dc270d; jvm 17.0.11+9-Ubuntu-122.04.1
[INFO] Session workerName=node0
[INFO] Started o.e.j.m.p.MavenWebAppContext@6629643d{/,[file:///home/baku/Downloads/demo/src/main/webapp/],AVAILABLE}{/home/baku/Downloads/demo/src/main/webapp/demo-0.0.1-SNAPSHOT.war}
[INFO] Started ServerConnector@674184d{HTTP/1.1, (http/1.1)}{0.0.0.0:8081}
[INFO] Started Server@64f4f12{STARTING}[11.0.21,sto=0] @2711ms
[INFO] Automatic redeployment disabled, see 'mvn jetty:help' for more redeployment options


--
Regards,

Debarshi Saha
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-dev


--
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
Expert assistance from the creators of Jetty and CometD


Back to the top