Version 2 Thoughts

As usual when creating something, the initial thought is to address a very specific problem. This has been done !

Though, I believe that the initial problem of creating something simple that worked elegantly within IIS to connect to Tomcat has been solved, I am creating a list of things that maybe useful for future development. Yes, I am thinking of version 2!

The main gap that I had left in the initial connector code centers around load balancing. So I do want to fill in that gap but also provide a very simple solution that will work whether Tomcat is load balance aware or not. The main reason is that some applications running on top of Tomcat provide their own session management and thus require something that is simple.

Thus here are in bullet form some features I am considering for version 2:

Load Balancing Enhancements:
----------------------------
a) Simple load balancing (just turn on)
b) Complex load balancing, a.k.a Tomcat standard way: workers, load factors, servers, fallbacks, etc.
c) Load balancing with dynamic mapped path: for stateless services
d) Load balancing with dynamic load factors
e) Load balance running statistics


Other Enhancements:
-------------------
- Upgrade .net library to 4 (still thinking through this one)
- Add default document option during installation
- Add support for Windows 8 and Windows server 2012 in automated installer

I am opening this up for comments. Will probably not start this project until September, expect end of year delivery.

Using BonCode connector with Adobe ColdFusion 10

If you are curious on whether you could use the BonCode connector with the new release of Adobe ColdFusion, even when you do a Standalone Server Installation, the short answer is "Yes". I have posted the how to do this on my regular blog post

http://boncode.blogspot.com/2012/06/cf-coldfusion-10-experimenting-with.html

IIS 7.5 and Error with System.Web.AspNetHostingPermission

IIS 7.5 running on Windows 2008R2 introduced another change that users need to be aware of.

When you initially run the installer and attempt to open a page that would trigger communicaiton with tomcat you will see this exception thrown:

Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

A change was introduced to the way the Application Pool is secured. With IIS 7.5 the Application pool that prevents any downloaded .dlls from running on the server. Thus you have two choices. Specifically allow the dlls in our case: BonCodeAJP13.dll BonCodeIIS.dll You can do this following instructions on this blog:

http://blogs.msdn.com/b/friis/archive/2010/06/09/system-security-securityexception-request-for-the-permission-of-type-system-web-aspnethostingpermission-failed.aspx

Or change the application pool security back to the level of IIS7 as shown in the image below:

Garbled Text or Graphics Troubleshooting

If you see inconsistent behavior, especially surrounding graphics not being transferred, i.e. missing or sometimes garbled text the most likely culprit is the autoflush detection.

This my attempt to detect a server side flush and transfer data held in cache to the client before processing completes. Unfortunatly, the default tick setting seems to cause these issues.

Thus I will change the defaults, but in the meantime, please add this line to your settings file:

<FlushThreshold>0</FlushThreshold>

This will resolve your issues.

How to Configure a remote connection

If your IIS and Tomcat servers do not reside on the same machine you can configure the connector to remote from the IIS server to the Tomcat server.

This requires that you tell the connector where your Tomcat Server is located by changing the settings file. You can change the BonCodeAJP13.settings file manually. Detailed instructions on how to do so are in the Tomcat_Connector.pdf file that is included in the package.

However, the easiest way to do this is during installation of the connector. The third step will ask for Tomcat Server location (see image). Simple provide the server name and port.

Here is the content of BonCodeAJP13.settings file the installer build:

<Settings>
<Server>railoBuilder</Server>
<Port>8009</Port>
<EnableRemoteAdmin>True</EnableRemoteAdmin>
</Settings>

Things to watch out for:
=========================

Firewall does not allow connection
----------------------------------
Tomcat AJP default port is 8009. You have to ensure that this port is accessible remotely from the IIS machine.


IIS and Tomcat path mappings
-----------------------------
These should be in synch so you retrieve the correct files. The easiest way is to create a seperate IIS site that uses the same relative directory references as your tomcat site. Similar relative mappings should exist, for example if your Tomcat root has these directories:
/Apps
/Apps/images
/Other

Your IIS Website should have the same directories:
/Apps
/Apps/images
/Other

You can ignore this if you mapped everything to flow to tomcat anyway, i.e. registered a "*" handler for the connector as in the last part of the video.

Youtube Videos

Posted several videos that walk through for the installations. Mostly selecting defaults and making only minor configurations. More configuration options are described in the manuals.

New Video on how to use Wildcards with IIS7 and Tomcat7:

http://www.youtube.com/watch?v=y6iwPEaLBY0

Apache Tomcat 6 and IIS 6:

http://www.youtube.com/watch?v=KVfovSDyFVE

Apache Tomcat 7 and IIS 6:

http://www.youtube.com/watch?v=kytejJUJRQo

Apache Tomcat 7 and IIS 7:

http://www.youtube.com/watch?v=yVKiNAkhav8

My recording tools do not allow me to make any changes so its a one shot deal. If you find any issues when you try yourself, please add it to the issue list on riaforge.

Troubleshooting

No page response

You are not getting a response via IIS, but when accessing tomcat web- port the page is displayed correctly.

è

You may have run into the maxThreads restrictions for tomcat, please see above for general recommendations. You should ensure that both tomcat and the BonCode AJP connector use the same maximum connections.

J2EE Sessions dropped

It appears like all your requests are creating new sessions, rather than reusing the session that is present.

è

Check whether IIS is using keep-alive directive. On IIS7: IIS Admin select server > HTTP Response Headers > Actions > Set Common Headers > check Enable HTTP keep-alive (by default) > ok

Error Message:

Tomcat may not be listening/ running on the assigned machine and port.

No connection could be made because the target machine actively refused it 127.0.0.1:8009

è

 

Start tomcat, or if you need to change the target machine and port to connect to you will need to add a settings file (BonCodeAJP13.settings) into the /BIN directory. See above for instructions.

Error Message:

You are not able to retrieve mapped extensions from IIS7.

HTTP Error 500.21 - Internal Server Error

è

Handler "BonCode-Tomcat-CFM-Handler" has a bad module "ManagedPipelineHandler" in its module list.

You have not installed the ".net extensibility" for IIS7. See above for instructions or use the Server Manager GUI to install this IIS7 feature.

Error Message:

Most likely you have registered the handlers correctly but probably either not created a /BIN subdirectory under your website root and/or forgot to copy the library files (BonCodeAJP13.dll and BonCodeIIS.dll) into it.

Could not load type 'BonCodeIIS.BonCodeCallHandler'.

è

 

Double check your webroot and ensure that you have the BIN subdirectory.

 

Double check that library files (BonCodeAJP13.dll and BonCodeIIS.dll) are in your BIN subdirectory.

 

BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress