Bilal-S / iis2tomcat

AJP Connector between Internet Information Services (IIS) and Apache Tomcat
http://www.boncode.net/boncode-connector
49 stars 32 forks source link

Generic Connector Communication Error: #71

Closed Subramanian-Palanisami closed 6 years ago

Subramanian-Palanisami commented 6 years ago

Hi Bilal, Good Day!!

Have found your BonCode IIStoTomcat connecter will work out for my requirement. Getting following error and it would be great if this issue resolved and thankful to you.

Generic Connector Communication Error: Please check and adjust your setup: Ensure that Tomcat is running on given host and port. If this is a timeout error consider adjusting IIS timeout by changing executionTimeout attribute in web.config (see manual).

Configuration Details:

  1. IIS: Under my main site(www.xyz.in), created virtual directory called (ea-test). Physical Path: C:\Tomcat\apache-tomcat-9.0.7\webapps\ea-test Virtual-Path: /ea-test

So, my complete url is: www.xyz.in/ea-test

  1. Tomcat Application deployed here: C:\Tomcat\apache-tomcat-9.0.7\webapps\ea-test\index.html

  2. BonCodeAJP13.settings

    <Settings>
    <Port>8009</Port>
    <Server>localhost</Server>   
    <MaxConnections>0</MaxConnections>
    <LogLevel>0</LogLevel>  
    <FlushThreshold>0</FlushThreshold>
    <EnableRemoteAdmin>False</EnableRemoteAdmin>
    </Settings>

Approaches tried to fix but not worked out:

  1. Changing MaxConnections value to 0 and restart IIS.
  2. Make sure connector port value is 8009

Eagerly looking for your response.

Regards, Subramanian Palanisami

Bilal-S commented 6 years ago

Subramanian, on the surface your setup looks correct. Are you able to access your tomcat site directly via it's html port (8080 default).

Also can you attempt to use 127.0.0.1 as server setting instead of localhost.

Questions; 1) What version of connector are you using? 2) What is your logfile entry during the error (set LogLevel to 2) and set LogDir if needed.

Best, Bilal

Subramanian-Palanisami commented 6 years ago

Hi Bilal,

YES, able to access localhost:8080/ea-test as expected.

tried to use 127.0.0.1 as server setting instead of localhost, but no luck!

<Settings>
  <Port>8009</Port>
  <Server>127.0.0.1</Server>   
  <MaxConnections>0</MaxConnections>
  <LogLevel>0</LogLevel>  
  <FlushThreshold>0</FlushThreshold>
  <EnableRemoteAdmin>False</EnableRemoteAdmin>
</Settings>

Answers are here:

  1. Get to know version is 1.0.28 from Release History file.
  2. There wont be any specific error logging in Tomcat log. Kindly let me know how to set LogLevel to 2 .

Regards, Subramanian Palanisami

Subramanian-Palanisami commented 6 years ago

Hi Bilal,

Good news!! Issue is fixed. steps have followed:

  1. uninstall BonCode.
  2. and install again fresh BondCode exe. this time i unchecked Servlet option from select Handler Mapping page.
  3. Restart website from IIS.

Thats it; Thanks you so much Bilal for your wonderful BonCode plugin. It is great stuff from get rid out of from url rewrite or ISAPI. Please close this issue.

Have one more question for you. please.

Have backend spring boot data api application called eacc. it does not have any UI (html) pages. just using this for connect to db and return json as response. Location: C:\Tomcat\apache-tomcat-9.0.7\webapps\eacc.

I have created another virtual directory called (/eacc) under my main site (www.xyz.in). Now when i try www.xyz.in/eacc - its giving error as 403 - Forbidden: Access is denied.

Hope BonCode will support one or more connections with tomcat. please correct me if am wrong. Please let me know will this approach will work out? do i need to do any special configuration for this? How to fix this issue? Shall i create new issue chain if you need?

Bilal-S commented 6 years ago

Glad to see you have worked it out. Is the handler registered for the /eacc sub-directory. If you are calling a servlet, you have to register a wildcard handler for that path. If you are calling a .jsp you need a jsp handler. The documentation as examples for wildcard: http://www.boncode.net/connector/webdocs/Tomcat_Connector.htm#_Toc520189752

Best, Bilal

Subramanian-Palanisami commented 6 years ago

Hi Bilal,

Yes, /eacc handler registered for wildcard handler path. steps are here:

  1. added virtual directory under my website (www.xyz.in) called /eacc.
  2. physical path: C:\Tomcat\apache-tomcat-9.0.7\webapps\eacc Note: folders available under above physical path:
    1. META-INF & 2. WEB-INF
  3. Clieck on "Handler Mappings" of eacc vd folder.
  4. click on Add Managed Handler:
  5. Request Path: *
  6. Type: BonCodeIIS.BonCodeCallHandler
  7. Name: BonCode-WL-Handler
  8. Click on "Ok" button.
  9. Restart IIS.

While trigger url http://www.xyx.in/eacc/api/fetchVendors in postman, getting following exception:

Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /eacc/api/fetchVendors

if i do localhost:8080/eacc/api/fetchVendors in postman, Have get results.

I have set LogLevel as 1 or 2 with LogDir. Have not seen any log file generated. uninstall and install with "All Sites" options. But still same issue.

could you please help me to resolve this issue.