I have a Spring+Hibernate application, which I compile to *.war file and deploy it to Tomcat. This works for me as developer, but:
Is there a way to run that application in some user's computer, that has Java installed, but not tomcat installed?
I would even accept the solution, which uses somekinda package that actually runs the servlet container and deploys the application to user's computer, but I don't want that user must install container and configure it etc etc.
Any suggestions?
EDIT:
Basically I want user to run my web application from an executable, without having to install tomcat or other tools.
You have a few options:
if you are distributing the source code to the user, and they have maven installed, you can just run mvn jetty:run or mvn tomcat:run to build the application locally and run it within a servlet container started by the Maven plugin.
You can embed Tomcat or embed Jetty in your application, so that running a main() method in your app launches a servlet container listening on a certain port and runs your application. This makes it possible to package your entire application as a single .jar file and have it be run with java -jar your.jar.
The Winstone servlet container allows for embedding the war-file inside the winstone jar, resulting in a single jar deployment which can be run either with "java -jar foo.jar" or as a clickable jar.
Jenkins/Hudson uses this. We've used it with some classpath trickery to use an exploded war.
See http://winstone.sourceforge.net/#embedding for details.
This is most likely the most elegant way to do this at the moment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With