Jetty and/or Servlet-api in JavaFX breaks deployment - jetty

I try to embed (use) Jetty into my JavaFX 2.2 applet (which runs in a browser).
My problem is that, to host servlets I need to include the servlet-api-3.0.jar also (for javax.servlet namespaces) besides jetty-server.jar, jetty-servlet.jar and jetty-util.jar.
If I include the servlet-api.jar, my project compiles, but when I run it inside the browser, the deployment fails with the "JavaFX application could not launch due to system configuration (show error details). See java.com/javafx for troubleshooting information." error message.
If I remove the servlet-api.jar (and remove the relevant source) it deploys again.
For the JavaFX project the Java Platform is set to "Default JavaFX Platform", and it would be good to keep it this way to reduce the minimum footprint required.
I'm not a java(fx) expert (I come from .NET world), so I'd appreciate any help!

You have an issue with signing the JARs. I'm not very familiar with signing JARs for JavaFX but here is the documentation:
http://docs.oracle.com/javafx/2/deployment/packaging.htm#BABJGFBH
http://docs.oracle.com/javafx/2/deployment/javafx_ant_task_reference001.htm#CIAFJGAB

servlet-api-3.0.jar is what's known as a provided dependency.
It is not needed to be included in your war file, as the web app container (in this case Jetty) provides it for you. In your build tool, just exclude the servlet-api.jar from being bundled in your war file.
Note: jetty-server-9.0.0.M5.jar is also a provided dependency and has the same rules.

Related

Add servlet in a clojure ring project

I am integrating Togglz library into a Clojure Ring project to support feature toggles and would like to activate the Togglz admin console. According to the Togglz documentation it is necessary to add a servlet in the /WEB-INF/web.xml file for projects that don't support Servlet 3.0. I used the :uberjar-merge-with leiningen plugin to merge the file with the Togglz servlet configuration with the web.xml file autogenerated by leiningen. However, this was not sufficient to activate the admin console.
I could not find much information on how to integrate a servlet from an external library into a Ring application. What would be the best way to do it?
I have not tried it myself, but the lein-servlet library seems to promise to do exactly that

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.

Auto-reloading WAR in Jetty standalone

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.

Issues while deploying tomcat 7 in cloudfoundry

I have a java Spring application that I want to deploy to Cloudfoundry on Tomcat7. I am newbie to Cloudfoundry and followed the steps mentioned here but when I issue vmc push command I am getting warning Can't determine the Application Type with no options provided. Any idea to resolve this ?
C:\apps\tomcat7>vmc push
Would you like to deploy from the current directory? [Yn]:
Application Name: myApp77
[WARNING] Can't determine the Application Type.
Select Application Type:
Dan's comment is correct. You should be given the option to choose standalone app.
You may want to have a look at https://github.com/ericbottard/cloudfoundry-tomcat-7 which is a distribution of tomcat already customized (and tested) as described in the blog post you mention.
Even better, if you're using Maven, just follow the README and you'll be able to deploy your war project automatically as a tomcat7 standalone.
Hope this helps,
This actually sounds correct to me, in the list of application types should be an entry named "standalone application". Select that one and then provide the command you wish to start the application with, in this case it's 'bin/startup.sh'

Deploying a Firebreath plugin on a webpage without manual installation

Recently I have been experimenting with Firebreath and developed a plugin in order to showcase my c++ projects on my portfolio website. I would like to make it easy for users to look at the projects without downloading files if they are new on my website.
The only issue I have at this point is that when users visit my page, they will receive a message indicating the plugin is missing. I would like to have an option for the users to automatically install my plugin without having to manually download and run it.
The plugin is mainly targetted at Windows users, since the applications are as well. I intend to support Google Chrome, Firefox, Internet Explorer. Currently I am using a MSI installer to install the plugin.
I have found a question similar to this, but I still needed to save the MSI installer and run it.
My question is: What would be the best way to implement this?
There isn't any way to "automatically" do what you want to do. The closest that I have heard of would be to use a java applet that would download and install the plugin for them. This can be pretty reliable on Mac but far less reliable on windows (for a number of reasons, among which the fact that many windows users don't have java installed and that Chrome blocks java applets by default without intervention by the user).
Other options include:
Creating a CAB file installer (only works on IE)
Creating a XPI firefox extension that packages the plugin (requires restarting the browser, only works on firefox)
Creating a CRX chrome extension that packages the plugin (only works on Chrome)
Microsoft ClickOnce used to work pretty well for one click installs of MSI files from a web page, but recently I think it doesn't work on many (if any) browsers; haven't seen it used in awhile, anyway.
There is no "automatic" way to install plugins; that would be considered a severe security issue. This is probably the #1 reason that plugins are as uncommon as they are.
do what adobe does,
create a tiny activeX application downloader, sign the activeX from with cheap SSL
when a user, enters your site, he will automatically be downloading this tiny ActiveX, after installation complete, inside the tiny ActiveX, have some type of batch script to download the EXE from remote server and silently install it.
adobe does this, on every reboot in boot.ini or startups
very easy