Auto-reloading WAR in Jetty standalone - jetty

I have a WAR deployed to Jetty 9.0.0.M3. I am trying to figure out what I need to set in my context in order to be able to have it reloaded every time I upload an updated war file (without having to restart Jetty).
I had a look at the docs, but I'm afraid I couldn't find what I was looking for. I only know how to do this with the embedded Jetty Maven plugin, but not with the standalone.
Any help would be appreciated! Thanks.

The key is in the deployer. You need to wire up the deployment manager functionality and have it manage the starting of the webapp.
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java
The jetty xml files are effectively a thin skin over java so look the following xml file which is what jetty uses for the traditional webapp startup of our distribution.
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-deploy/src/main/config/etc/jetty-deploy.xml
This ought to get you fixed up.

Related

Is there a pre-packed vanilla Apache Felix installation with Jetty 9?

Is there somewhere I can download a plain Apache Felix with all the bundles required for running the latest Jetty 9?
I've been trying to do this by following the Jetty documentation to no avail, it's like trying to put together a puzzle where you don't know where the missing pieces are. Some of the bundles you get from Maven, others from the lib folder from a Jetty installation, and others you download from Eclipse Orbit.
NOTE: it would be great if the Jetty project just provided a zip file with all needed bundles for OSGi on each release, or even better, create a FatJar bundle, that by just releasing a FullJetty bundle would start the whole thing without having a zillion bundles that you never really use directly.
If you just take a look at the Apache Karaf project it's a OSGi Container based on Felix/Equinox and brings Jetty along with Pax-Web as service Layer.
The most benefit of this server is that you just don't need to care much about all those infrastructure bundles and just unpack it and develop your OSGi application with it.

clojure How do you package jax-ws web service to war

I have successfully created a JAX-WS web service in clojure using definterface and deftype. How so I package this to a war file using lein ring uberwar so that I can deploy it in tomcat or any other servlet container? I cannot seem to find a way to do this.
I never tried that as usually I package my applications as JARs and use an embedded container such as Jetty.
However, it looks like that lein-ring is able to generate WAR files. I never tried that but maybe it will works for you even that you aren't using Ring library.
If it not working, then it is possible to extend Leiningen to create custom tasks. Properly you can create a task to package your project as WAR file. If so, please consider releasing it on Github later!

How does one add or update a WAR file/folder to the default embedded Jetty server in a Restlet 2.1 Application?

I would like to develop a Restlet 2.1 Java SE or Java EE Application that uses a (default) Jetty server, as opposed to an external Jetty/Tomcat server.
But I would like to configure the WAR file/folder that Jetty is processing, even allowing for stop(), reconfigure() or reload(), start() to happen at run time. In the external case, I can use setWar("path to war file/folder") from the Jetty API to achieve my goal, so this is plan B. Plan A is to figure out how to do this from the Restlet 2.1 API.
I cannot see a way to do it and I'm hoping that I'm just missing an obvious, or even not-so-obvious solution.
I think the Jetty WebAppProvider will provide what you need. If not, have a look at my hot swap code for WAR files in an embedded Jetty on this thread.

How can I deliver jetty with many webapps via jnlp?

I have a webapp (http://sourceforge.net/projects/sf-mvn-plugins/files/m2-repo/net/sf/maven/plugins/example-captaincasa-jnlp/0.1-SNAPSHOT/example-captaincasa-jnlp-0.1-SNAPSHOT.war/download) which uses jsf in a servlet container. This works fine with jetty-maven-plugin run-war target at my local pc. In the future I would like make more of this kind of webapps.
I am looking for a way to deliver these webapps with jetty via jnlp. The end user should be have a zero installation but the webapps needs servlet container and my hoster does not support a servlet container or application server or so on.
I don't like an embedded solution because in this case each webapp must be delivered with a separate jetty und run with a separate jetty -> too big size -> to many download size and so on.
The architecture should be similar to this:
(source: sourceforge.net)
Example: Bundle1 could contains jetty and deployed webapp1 and Bundle2 could contains jetty and deployed webapp1 and webapp2 (related to requirements of end user I would like deliver many variant of my webapps)
But what is my question?
Which jars of jetty are needed? I would like these upload to my homepage for hosting.
Which jar should I use for jetty as main jar to start him via jnlp?
Which main class should I use to start jetty via jnlp?
Which parameter could I use to configure jetty to say this is war of webapp1 and this is war of webapp2.... or this is directory of weapps for hot deployment...?
The important question for me is 1. If this is answered so that I could run jetty local (without maven plugin) and via manual maybe I could solve the rest 2-4.
Why not deploy a normal Java app (with a main() etc.) that invokes Jetty programatically via its Server class? That class is configured via code with the appropriate contexts, servlet classes etc.
I've done that before with success. The only headache is running one Jetty with multiple apps being downloaded on request (if I read your question correctly). Can you use some classloading magic, and load classes/apps on demand from a remote URL ?
I have found another way today. This is interesting too. Here is the concept:
Use java webstart to install an osgi container
Use a bundle x or a osgi service to download all bundles of your app
Use the jetty bundle to provide jetty support
Then the application is installed
I got the idea from this article:
http://www.toedter.com/blog/?p=45

Where does the tomcat axis file server-config.wsdd come from?

Part of our system provides a web service through apache tomcat, the service is referenced in the server-config.wsdd file. Unfortunately nobody can remember how it got in there.
The apache set up has changed, and I need to update the system for the new configuration. What magic keywords can I google for to help me work out how and why it got into the existing server-config.wsdd, and how it might fit into the new server-config.wsdd
The server-config.wsdd file is generated by the wsdl2java tool from Axis. So, some developer used the tool and copied the file inside your Tomcat conf, where it belongs.
The server-config.wsdd is created when you deploy your web service by running
java org.apache.axis.client.AdminClient \deploy.wsdd
my knowledge says that it is hardcoded... and by using java org.apache.axis.client.AdminClient \deploy.wsdd or by explicitly invoking it through an ant script you can embody it to the server-config.wsdd and deploy the service