在ColdFusion中处理500个JRun servlet [英] Handling 500 JRun servlet in ColdFusion

查看:140
本文介绍了在ColdFusion中处理500个JRun servlet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部 -



有没有办法在ColdFusion中处理一个500 JRun servlet错误?我尝试使用 cferror 以及在ColdFusion管理中使用网站范围的处理程序,但它似乎不工作。



这是错误讯息

  500 

根本原因:java.lang.IllegalArgumentException
coldfusion.filter.FormScope.parseName(FormScope.java:408)at
coldfusion.filter.FormScope.parseQueryString(FormScope.java:360)at
coldfusion.filter.FormScope.parsePostData (FormScope.java:328)at
coldfusion.filter.FormScope.fillForm(FormScope.java:278)at
coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:438)at
ColdFusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:33)at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)at
coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java: 126)at
coldfusion.CfmServlet.service(CfmServlet.java:200)at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)at
jrun.servlet.FilterChain.doFilter (FilterChain.java:86)at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)at
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)at
jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
jrun.servlet.FilterChain.service(FilterChain.java:101)at
jrun.servlet.ServletInvoker.invoke(ServletInvoker。 java:106)at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)at
jrun.servlet .ServletEngineService.dispatch(ServletEngineService.java:543)at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)at
jrunx.scheduler.ThreadPool $ ThreadThrottle.invokeRunnable(ThreadPool.java :428)at
jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


javax.servlet.ServletException:ROOT原因:
java.lang 。$ l
上的.llegalArgumentException
上的coldfusion.filter.FormScope.parseName(FormScope.java:408)
上的coldfusion.filter.FormScope.parseQueryString(FormScope.java:360)
coldfusion.filter.FormScope .parsePostData(FormScope.java:328)at
coldfusion.filter.FormScope.fillForm(FormScope.java:278)at
coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:438)at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:33)at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)at
coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter。 java:126)at
coldfusion.CfmServlet.service(CfmServlet.java:200)at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)at
jrun.servlet.FilterChain .doFilter(FilterChain.java:86)at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)at
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)at
jrun.servlet.FilterChain.doFilter(FilterChain.java:94)at
jrun.servlet.FilterChain.service(FilterChain.java:101)at
jrun.servlet.ServletInvoker.invoke ServletInvoker.java:106)at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)at
jrun .servlet.ServletEngineService.dispatch(ServletEngineService.java:543)at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)at
jrunx.scheduler.ThreadPool $ ThreadThrottle.invokeRunnable(ThreadPool .java:428)at
jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:70)at
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)at
jrun.servlet.FilterChain.doFilter(FilterChain.java:94)at
jrun.servlet.FilterChain.service(FilterChain.java: 101)at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)at
jrun.servlet.JRunRequestDispatcher .invoke(JRunRequestDispatcher.java:286)at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)at
jrunx.scheduler.ThreadPool $ ThreadThrottle.invokeRunnable(ThreadPool.java:428)at
jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


解决方案

您正在接收的错误发生在JRun级别。这种类型的错误发生在ColdFusion错误处理程序可能捕获它之前。您将需要在JRun级别创建和分配错误处理程序。这可以通过编辑web.xml文件来实现。 (进行更改后,您需要重新启动JRun服务器。)



详细信息可以在此页面上找到, JRun 4程序员指南 - Servlet编程技巧 - 处理异常


您可以使用WEB-INF / web.xml文件中的错误页元素定义Web应用程序如何处理错误。您还可以通过向SERVER-INF / default-web.xml文件中添加错误页元素来定义JRun服务器上所有Web应用程序的错误处理。



处理HTTP错误代码



错误代码子元素定义了JRun如何处理在处理servlet过程中生成的HTTP错误代码。



您为错误代码元素定义HTTP状态代码,然后将代码映射到位置中的目标元素。以下示例将HTTP 500(内部服务器错误)状态代码映射到servererror.jsp页面:

 < error-page> ; 
< error-code> 500< / error-code>
< location> /error-pages/servererror.jsp< / location>
< / error-page>

下表列出常见的错误相关HTTP状态代码:

  HTTP错误代码说明
400错误请求
401未授权
403禁止
404未找到
408请求超时
500内部服务器错误

访问错误属性



HttpServletRequest HttpServletResponse 错误信息,以便您可以生成有意义的调试信息或目标异常处理程序。有关更多信息和示例,请参阅上面包含的链接。



JRun在抛出错误时在请求对象上设置了几个属性。以下说明这些属性:




  • javax.servlet.error.status_code - 定义HTTP错误代码(如果适用)作为int对象。如果servlet抛出与HTTP无关的异常,则状态代码通常设置为500(内部服务器错误)。

  • javax.servlet.error.message - 返回异常或错误消息。

  • javax.servlet.error.exception_type - 定义类型

  • javax.servlet.error.exception - 定义抛出的实际异常。您可以使用printStackTrace方法查看异常的堆栈跟踪。

  • javax.servlet.error.request_uri - 定义请求异常被抛出之前的URI。



All -

Is there a way to handle a 500 JRun servlet error in ColdFusion? I tried using cferror as well as using the site-wide handler in ColdFusion admin, but it does not seem to be working.

Here is the error message

500

ROOT CAUSE:  java.lang.IllegalArgumentException     at
coldfusion.filter.FormScope.parseName(FormScope.java:408)   at
coldfusion.filter.FormScope.parseQueryString(FormScope.java:360)    at
coldfusion.filter.FormScope.parsePostData(FormScope.java:328)   at
coldfusion.filter.FormScope.fillForm(FormScope.java:278)    at
coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:438)   at 
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:33)   at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at
coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)  at 
coldfusion.CfmServlet.service(CfmServlet.java:200)  at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at 
jrun.servlet.FilterChain.doFilter(FilterChain.java:86)  at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)  at
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)  at 
jrun.servlet.FilterChain.doFilter(FilterChain.java:94)  at
jrun.servlet.FilterChain.service(FilterChain.java:101)  at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)     at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)  at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)   at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)   at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)    at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)   at 
jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


javax.servlet.ServletException: ROOT CAUSE: 
java.lang.IllegalArgumentException  at
coldfusion.filter.FormScope.parseName(FormScope.java:408)   at
coldfusion.filter.FormScope.parseQueryString(FormScope.java:360)    at
coldfusion.filter.FormScope.parsePostData(FormScope.java:328)   at
coldfusion.filter.FormScope.fillForm(FormScope.java:278)    at
coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:438)   at 
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:33)   at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at
coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)  at 
coldfusion.CfmServlet.service(CfmServlet.java:200)  at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at 
jrun.servlet.FilterChain.doFilter(FilterChain.java:86)  at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)  at
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)  at 
jrun.servlet.FilterChain.doFilter(FilterChain.java:94)  at
jrun.servlet.FilterChain.service(FilterChain.java:101)  at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)     at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)  at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)   at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)   at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)    at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)   at 
jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)  at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:70)  at
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)  at 
jrun.servlet.FilterChain.doFilter(FilterChain.java:94)  at
jrun.servlet.FilterChain.service(FilterChain.java:101)  at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)     at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)  at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)   at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)   at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)    at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)   at 
jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

解决方案

The error that you are receiving is occurring at the JRun level. This type of error occurs before the ColdFusion error handler can trap it. You will need to create and assign an error handler at the JRun level. This can be accomplished by editing the web.xml file. (After making changes you will need to restart the JRun server.)

Details can be found on this page, JRun 4 Programmers Guide - Servlet Programming Techniques - Handling exceptions.

You can define how a web application handles errors using the error-page element in the WEB-INF/web.xml file. You can also define error handling for all web applications on the JRun server by adding error-page elements to the SERVER-INF/default-web.xml file.

Handling HTTP error codes

The error-code subelement of error-page in the web.xml file defines how JRun handles HTTP error codes generated during the processing of a servlet.

You define an HTTP status code for the error-code element and then map the code to a destination in the location element. The following example maps the HTTP 500 (Internal Server Error) status code to the servererror.jsp page:

<error-page>
    <error-code>500</error-code>
    <location>/error-pages/servererror.jsp</location>
</error-page>

The following table lists common error-related HTTP status codes:

HTTP error code    Description
  400              Bad Request
  401              Unauthorized
  403              Forbidden
  404              Not Found
  408              Request Time-out
  500              Internal Server Error

Accessing error attributes

The HttpServletRequest and HttpServletResponse objects provide access to error information so that you can generate meaningful debugging information or targeted exception handlers. For more information and examples, see the link that I included above.

JRun sets several attributes on the request object when an error is thrown. The following describes these attributes:

  • javax.servlet.error.status_code - Defines the HTTP error code, if applicable, as an int object. If the servlet throws an exception not related to HTTP, the status code is usually set to 500 (Internal Server Error).
  • javax.servlet.error.message - Returns the exception or error message.
  • javax.servlet.error.exception_type - Defines the type of exception.
  • javax.servlet.error.exception - Defines the actual exception thrown. You can use the printStackTrace method to view the stack trace of the exception.
  • javax.servlet.error.request_uri - Defines the request URI prior to the exception being thrown.

这篇关于在ColdFusion中处理500个JRun servlet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆