Skip to content

Fat jar works for embedded Jetty and Tomcat but not for Undertow #8764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bjorntj opened this issue Mar 28, 2017 · 5 comments
Closed

Fat jar works for embedded Jetty and Tomcat but not for Undertow #8764

bjorntj opened this issue Mar 28, 2017 · 5 comments
Labels
status: duplicate A duplicate of another issue

Comments

@bjorntj
Copy link

bjorntj commented Mar 28, 2017

I am trying to create a executable fat jar instead of war files for my Spring Boot projects , where I use JSF and Primefaces.
My test project works fine using either Jetty or Tomcat but Undertow complains about not finding the resources for the Primefaces theme I use..

I have included a test project...
undertow_test.tar.zip

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 28, 2017
@bjorntj
Copy link
Author

bjorntj commented Mar 28, 2017

btw, this test project works when running as java -jar jarfile but not when I run it as gradle bootRun, any pointers what I need to do to make it work using gradle bootRun?

@wilkinsona
Copy link
Member

wilkinsona commented Mar 28, 2017

Thanks for the sample, but it's left me a bit confused. It appears to be using Jetty but you said the problem was with Undertow. I get a failure with bootRun when I try to access http://localhost:8080. The index appears to work fine with java -jar. If I switch to Undertow I see the same failure as Jetty with bootRun and it doesn't work with java -jar either (but with a different failure to the one seen with bootRun).

Can you please clarify the problem that you're reporting? I don't want to waste time diagnosing something else.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Mar 28, 2017
@bjorntj
Copy link
Author

bjorntj commented Mar 28, 2017

Yes, forgot to change the dependency back to undertow, so yes, my problem is when using undertow and using java -jar. bootRun does not work on either and as I mention in my comment above, I am not sure how to make this project wok using bootRun, but perhaps you have some ideas?
And yes, the error is different when using bootRun. When using bootRun, is seems that it does not find the static resources in the web_resources jar file at all.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Mar 28, 2017
@wilkinsona
Copy link
Member

There are two things going on here. Firstly, your resources are in the wrong place. They're in src/main/resources/META-INF/resources/resources but they should be in src/main/resources/META-INF/resources. Secondly, things don't work with bootRun due to #8525 which is fixed in 1.4.6 and 1.5.3 snapshots.

If I move your resources to the right location and use 1.5.3.BUILD-SNAPSHOT things work fine with Undertow using both bootRun and java -jar.

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Mar 31, 2017
@bjorntj
Copy link
Author

bjorntj commented Mar 31, 2017

ok, the placement is just copied from the example project from Primefaces using their theme but I guess I do not need to follow this...
Thx... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants