Announcement Announcement Module
Collapse
No announcement yet.
StatusReportValve URI Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • StatusReportValve URI

    From the tc Server documentation at http://pubs.vmware.com/vfabric53/top...or-report.html

    error.XXX=file://valid/file/path/URI: Specifies that when tc Runtime encounters the XXX status code, it should display the specified URI. If the URI is not valid, the file doesn't exist, or it is not readable, tc Runtime ignores the status code.

    I've configured the service element of my server.xml thusly

    Code:
      
      <Service name="Catalina">
        <Executor maxThreads="300" minSpareThreads="50" name="tcbio" namePrefix="tcbio:" />
        <Connector protocol="org.apache.coyote.http11.Http11Protocol" executor="tcbio" port="${bio.http.port}" 
          redirectPort="${bio.https.port}" />
        <Engine name="Catalina" defaultHost="localhost">
           <Valve className="com.springsource.tcserver.security.StatusReportValve"
             error.500="http://mydomain.com/en_US/errors/1/html/500.html">
          <Valve className="com.springsource.tcserver.serviceability.request.ThreadDiagnosticsValve" logExtendedData="true" />
          <Host appBase="webapps" deployOnStartup="true" name="localhost">
            <Valve className="org.apache.catalina.valves.AccessLogValve" pattern="combined" prefix="localhost-access" suffix=".log" />
          </Host>
        </Engine>
      </Service>
    and the resulting log output is

    Code:
    23 May 2013 19:09:47,974 [      main] INFO  urce.tcserver.security.StatusReportValve - Adding status code directive[status=500; body=http://mydomain.com/en_US/errors/1/html/500.html
    generating a 500 error with this code in a JSP

    Code:
    response.sendError(Integer.parseInt(request.getParameter("code")), "If you are seeing this message, no handler for this HTTP response code has been configured in tc Server.");
    simply prints the URI rather than fetching it. I selectively enabled all logging for class org.apache.catalina.valves.AccessLogValve and it seems only to emit INFO level logging. Has anyone else gotten this thing to work or is it just broken?

  • #2
    baaord,

    The URI is only a file:// uri not a http:// uri as the doc example says. You will need to point to the html as it is located in your instance or somewhere on the machine you are running the tc Server instance. i.e. file://${catalina.base}/conf/errors/1/html/500.html

    -Jason

    Comment


    • #3
      The example shows a file:// scheme in use true but the documentation does not specify the limitation. A URI by definition supports a variety of schemes. Is the source code for com.springsource.tcserver.security.StatusReportVal ve available somewhere that I could extend it to handle URIs with schemes other than file://? Thanks!

      Comment


      • #4
        I agree it is not clear. 1) docs will be updated and 2) I can create an enhancement request for that change.

        Comment

        Working...
        X