Solved

java error accessing IIS website on same server where Tomcat lives

Posted on 2007-03-29
3
275 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
ID: 18820039
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
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 …

914 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

20 Experts available now in Live!

Get 1:1 Help Now