Run a .war on IIS


Has anyone ever tried to get a Java web app (deployed as a .war archive or in a war folder) running on IIS? I’m looking for a zero installer based deployment. I already know about ISAPI filters and redirects to instances of Jetty/Apache-Tomcat and what not. I’m wondering if it would be possible (using JNI or something similar) to launch a JVM inline during an ASP app init and feed requests while slurping responses from it. Sounds crazy? I’m crazy! I’ve launched and interacted with JVMs from RPG using JNI in the past so I know the territory a little but I’m rusty. (I’d have to break out my old C/C++ book.) I’m just wondering if anyone has ever done it before. In my mind it should be a matter of launching the JVM during init in the global.asp (I think but don’t quote me cause I haven’t touched ASP in years), then creating an ASP page that accepts all requests and uses a COM object wrapping the underlying servlet engine to fulfill the requests. The servlet engine would of course need to be custom where if would bind to an address space rather than a socket using some fancy object. The fancy object could wait for calls from the com wrapper and push them down a PipedOutputStream that would talk to a PipedInputStream stand in for the typical Socket input stream a servlet engine would typically deal with.

The big idea?
What all of this hocus pocus would buy is a servlet engine that could be run directly from within IIS. In my (hair-brained) theory, deployment could consist of a the global.asp page, the service-all ASP page, the DLL for the com object, the JVM DLLs and a custom OneJar packaged hacked Jetty with embededd war all in one folder that could be dropped into an instance of IIS. I’m really unsure about the ASP/IIS side of things (where the DLLs should be located for ASP to see them) but the Java side seems possible. I haven’t thought anything completely through, I’m just brainstorming and pondering possible ideas. Whatever, man. Check the flow, and if you know fill in below…

One thought on “Run a .war on IIS

  1. Don’t Do It, Cliff! The last place I worked we had a Java application which had to run on Java application servers and on IIS, and it was a nightmare. Especially once we added .NET support, so we had a .NET wrapper around some JNI C++ code talking to a JVM.

    You are MUCH better off having something like Tomcat and Axis listening to XML requests being passed from your ASP page. Wrap the input and the output in XML, and use the ASP just as a pass through mechanism, and you will save yourself from a world of pain.

    Unless, of course you’ve done something totally evil, and feel really bad about it, and feel the need to do penance. In which case I’d say, go right ahead and write some wrappers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s