The menace of HTTP Status 404 in glassfish

from: http://home.java.net/node/688191

 

I am new to the glassfish and the hype surrounding it, particularly the v3. Try googling for info on glassfish v2.x, and v3 gets in the way--forget even v2.1 (I, however, digress).

Here is what I have found:

If you deploy EAR jar, and try to render a jsp or jsf page; if there is error associated with the page, glassfish displays a HTTP Status 404. These errors might include:

1. [Wrongly reported] Invalid ejb jar
2. Missing shared libraries
3. Classes declared in web.xml but missing in the source path or one that simply contains error
3. etc.

In some cases, you might find the exact causes of the HTTP Status 404, if you look in your glassfish server.log but in most cases, NOTHING! For example after a succesfull verification and deployment, and you then do:

http://www.java.net/external?url=http://localhost:8080/foo-web/index.jsp

And there is error somewhere or some missing shared libraries, the browser will display a HTTP Status 404 error page, but if you then look inside your server.log, you would only find:

[#|2009-01-08T08:59:44.985+0000|SEVERE|sun-appserver9.1|org.apache.jasper.servlet.JspServlet|_ThreadID=27;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=1ff45167-4f60-4488-942b-bab781b97cf0;|PWC6117: File "/home/applications/glassfish/domains/domain1/docroot/foo-web/index.jsp" not found|#]

A few weeks ago, I posted this problem on this forum but with little response. I [still] occasional have this irritating problem. In glassfish, HTTP Status 404 error is meaningless, because it is used to catch all manners of errors--something you don't find in JBoss or Websphere.

It seem that when there is an error associated with a page, glassfish default to the glassfish/domains/domain1/docroot in search of the page and when it fails to find it there, it displays a HTTP Status 404. This is WRONG: what developers want is the sources of the problem and not a blank catch-it-all HTTP Status 404 page with no helpful info in the server.log.

Atleast in development mode, there should be a way to switch off this default (to glassfish/domains/domain1/docroot) to get a print stack of the real problem causing the page not to render.

转载于:https://www.cnblogs.com/jinrize/archive/2012/04/16/2451617.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值