Solved

java error accessing IIS website on same server where Tomcat lives

Posted on 2007-03-29
3
274 Views
Last Modified: 2012-06-22
Tools: Tomcat with IIS
Problem: files within the Tomcat directory structure (xml or jsp) that call out to a url that is served from IIS on the same server where Tomcat is installed....are causing errors.
1. Tomcat is called to serve an xml file with the following doctype dec:
<!DOCTYPE narratives PUBLIC "-//mnhs/stories//DTD narratives//EN" "http://stories.mnhs.org/xxx/narrative.dtd ">
error in stdout.log: Error in SimpleTransform20: java.io.IOException: Server returned HTTP response code: 400 for URL: http://stories.mnhs.org/xxx/narrative.dtd
current workaround employed:
<!DOCTYPE narratives PUBLIC "-//mnhs/stories//DTD narratives//EN" "d:\xxxx\stories\xxx\narrative.dtd">

2. When i call Search.jsp, which issues a cgi search with:
<c:import url="http://stories.mnhs.org/cgi-search/mgg/search.cgi?zoom_query=${requestScope.zoom_query}&zoom_cat=${requestScope.zoom_cat}&zoom_per_page=200&zoom_and=${requestScope.zoom_and}&zoom_sort=0"/>

I get the following error in the Local_Host.log file:
2007-03-29 11:52:15 ApplicationDispatcher[/stories] Servlet.service() for servlet jsp threw exception
java.io.IOException: Server returned HTTP response code: 400 for URL: http://stories.mnhs.org/cgi-search/mgg/search.cgi?zoom_query=war&zoom_cat=-1&zoom_per_page=200&zoom_and=0&zoom_sort=0
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
      at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireReader(ImportSupport.java:348)
      at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:259)
      at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:179)
      at org.apache.jsp.mgg.search.search_jsp._jspx_meth_c_import_0(search_jsp.java:1994)
      at org.apache.jsp.mgg.search.search_jsp._jspx_meth_logic_equal_3(search_jsp.java:1966)
      at org.apache.jsp.mgg.search.search_jsp._jspService(search_jsp.java:497)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
      at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
      at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
      at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:316)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Unknown Source)

2007-03-29 11:52:15 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
java.io.IOException: Server returned HTTP response code: 400 for URL: http://stories.mnhs.org/cgi-search/mgg/search.cgi?zoom_query=war&zoom_cat=-1&zoom_per_page=200&zoom_and=0&zoom_sort=0
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
      at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireReader(ImportSupport.java:348)
      at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:259)
      at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:179)
      at org.apache.jsp.mgg.search.search_jsp._jspx_meth_c_import_0(search_jsp.java:1994)
      at org.apache.jsp.mgg.search.search_jsp._jspx_meth_logic_equal_3(search_jsp.java:1966)
      at org.apache.jsp.mgg.search.search_jsp._jspService(search_jsp.java:497)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
      at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
      at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
      at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:316)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Unknown Source)

Interesting Note:
When i paste the URL that is generated in the first line or two of the error above, the raw cgi search results come in, but the extra files (includes) that are called in by the search.jsp page that make up the site...don't.  so i'm just looking at a raw listing of the search results.

So it seems like Tomcat cannont access IIS resources on the very server that it lives on.  This app was built for our company, and i don't really know much about java.

And i'm not even sure if this is enough info to get any good feedback.
Thanks!
0
Comment
Question by:MHSIT
3 Comments
 
LVL 10

Accepted Solution

by:
ADSLMark earned 250 total points
Comment Utility
Hmm, ok, i am just guessing here.. these problems are hard if you have never encountered them before.. so I guess this has todo with the HTTP 400 error code with bad requests, you probably figured that out yourself and I think there are some problems with how you build up requests.
Maybe this post on the google forum helps you:

http://answers.google.com/answers/threadview?id=368359

Anyway, i have never encountered the problem, so it's just a guess, hope it helps.
Mark
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now