wood burning stoves 2.0*
The moose likes JNLP and Web Start and the fly likes deploying JNLP in Jetty web server of jboss. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "deploying JNLP in Jetty web server of jboss." Watch "deploying JNLP in Jetty web server of jboss." New topic
Author

deploying JNLP in Jetty web server of jboss.

shajee java
Greenhorn

Joined: Jan 02, 2003
Posts: 3
Help required in delpoying JNLP files using java webstart. I'm using jboss server which has jetty as its web server.
any ideas for quick start.
references are fine.
thanx
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Howdy -- the only issue with WebStart on the server side is that you must be able to add a new MIME type. So, it should work on virtually any web server.
On the server side, here are the main points:
1) You must be sure to add a new mime type to the server (if not there already):
application/x-java-jnlp-file
2) You need the .jnlp file, of course
Just a few tips along the way...
Although I'm not certain of this, I *think* you need ALL the information tags in the jnlp file -- I don't think it works without them (I never did study the DTD for it, but that's how I got it to work anyway)
And if you do NOT have a manifest within your ,jar that you're deploying, that says what your main-class is, that's OK as long as you include the main-class tag within your jnlp file.
So overall, the main steps to deployment are:
1) Make your jar with your application
2) Make it as though you were making an "executable jar", by including a class with a main method, and a manifest indicating the main-class (alternatively, you can place the main-class definition inside the jnlp file, but in either case you MUST have a main class in the jar!)
3) Make sure your web server has the jnlp mime type, so that when it sends back the jnlp file, the browser knows what type it is and who to hand it off to (WebStart!)
4) Put your jnlp file and your application jar on your web server, as you would any regular html page, etc.
5) Then you can simply use the jnlp file as part of the URL
http://127.0.0.1/~kathy/MyApp.jnlp
And within that jnlp file, it says which jar to download and launch.
Oh yeah, one other gotcha! (for me, anyway)
You MUST include the codebase and href to the jnlp file inside the jnlp file. That seemed ridiculous to me, after all, once the jnlp file is pulled down, can't it remember or see from where it came? But it can't, so think of it this way when you're building the jnlp file -- pretend WebStart has absolutely no idea WHERE the jnlp file came from, so the jnlp file must always give the location that it just came from.
So include the correct tag for BOTH codebase and href. I had trouble in the beginning because I didn't have those straight.
Oh yeah, one last thing, Macintosh OSX has Java WebStart built in
All I had to do was flip the switch to start Apache and I was serving my *own* WebStart files.
But I have also been able to deploy WebStart from my hosting provider. As long as your hosting provider allows you to add a new MIME type (which I imagine virtually all of them do, since it doesn't affect the server at all) then you're good to go.
cheers,
Kathy
Author of the new "Sun Certified Programmer and Developer for Java 2 Study Guide" (world's WORST Java book title, I didn't get to pick it
And coming soon... "Head First Java" from O'Reilly
shajee java
Greenhorn

Joined: Jan 02, 2003
Posts: 3
This was really a good start i learnt a lot.
Thanx a lot..
Now i struck at this error
Error 404
i don't know how to set context to my drectory.
when i type hhtp://localhost:8080/test
it give me 404 error.
help please.
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Howdy -- your 404 / context problem should probably be directed to the Servlets forum. I know only Tomcat web app configuration (and I don't even know *that* very well), but I'm sure there are a pile of experts in the Servlets forum that can probably help you track down the issue.
Your web container may have more than one way to set the context (e.g. automatically loaded based on your app and a deployment descriptor being in a specific directory, OR manually written into a server configuration file, or a properties file...) so you might try to find out the other options (if there are any) for your web application deployment, and do it another way.
cheers and good luck,
Kathy
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: deploying JNLP in Jetty web server of jboss.
 
Similar Threads
HELP! JBoss startup warnings and not found jars - what's it mean?
Jboss-- jetty -- java webstart
Error 404 in jboss's jetty -- context problem
What is Everyone using in Production?
JBoss running ?