Configuring a servlet in CFMX/IIS5...

Posted by Dan on Jun 10, 2003 @ 8:52 AM

Well I always forget this, so I figure I'd blog this so I don't spend 30 minutes messing around with the server trying to figure out what I need to get a servlet to execute on a virtual server in IIS5.

In order to get a servlet to run, you need to define your servet in the web.xml (which is in the directory CFusionMX\wwwroot\WEB-INF\.) A typical servlet defintion will look like this:

<servlet>
    <servlet-name>imageservlet</servlet-name>
    <servlet-class>imageservlet.ImageServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>imageservlet</servlet-name>
    <url-pattern>/imageservlet</url-pattern>
</servlet-mapping>

Next, you may need to run the "Remove_ALL_connectors.bat" file located in the CFusionMX\bin\connectors. Try skipping this step first (especially if you have a lot of virtual servers already set up.) If things don't work the first time, try running this batch file. After running this batch file, you'll need to run the "IIS_connector.bat" in the same directory to reset all the associations to JRun and ColdFusion.

Lastly, you'll need to create a virtual directory called "JRunScripts" which in the root of the webserver. This should be a virutal mapping to the directory "CFusionMX\runtime\lib\wsconfig\1". I believe you also need to "remove" any application settings for this directory. See the sample image below for how to set up the directory.

Example Configuration
JRunScripts.gif

After all of this, the servlet should run. If you have any different findings, please make sure to post a comment.

Categories: HTML/ColdFusion

Comments for this entry have been disabled.