什么使Tomcat5.5不能“意识到”的新Java Web应用程序? [英] what makes a Tomcat5.5 cannot be "aware" of new Java Web Applications?

查看:147
本文介绍了什么使Tomcat5.5不能“意识到”的新Java Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是用于单独的功课,但我认为这是对我的uni的Tomcat服务器(版本5.5.27)的一个通用问题。



问题是我使用NetBeans 6.8捆绑的Tomcat 6.0.20(localhost:8084 / WSD)首先做了一个框架Java Web应用程序(只是一个简单的Servlet和一个欢迎文件,没有任何复杂的,不包含lib)



然后,为了测试并证明它是便携式和自动部署能力,我清理并构建了一个WSD.war文件,并将其放在我的Xampp Tomcat(localhost:8080 / WSD)。战争相应地提取了一切,我可以看到这个Tomcat的相同输出。到目前为止,这么好。



然而,当我试图掉到uni服务器上,有趣的事情发生:



uni服务器



即使我将战争许可更改为755,这根本不是回应。



然后我将提取的文件复制到uni服务器,MainServlet无法从其上下文路径/ WSD中识别,基本上没有任何作用,期望静态index.jsp。我试过几次停止并重新启动uni Tomcat,这没有帮助?



我想知道这是什么发生的?有没有什么我做错了我的方法?



坦白说,我没有注意到一个不受我控制的服务器,我不幸的是,现在的Java程序员。我了解MVC,Servelets,JSPs,JavaBeans的基础知识,但是我真的感到沮丧,因为我看不出为什么...



或者我应该问,一个Java Web应用程序经过清理并由NetBeans6.8构建,是自包含和自配置的,因此可以随时部署到任何Java Web Container?



我知道我可以使用简单的旧JSP来编程所有的东西,但是这是soooo ...对我自己不能接受...



更新: p>

我现在想知道是否有任何免费的Tomcat托管,以便我想看看我的战争文件和/或我的网络应用程序可以与他们一起去,没有任何配置?



第二次更新:



matt b提出了一个好点,所以我以特别的方式去检查我的环境:
一个没有地方的假JSP页面



而且我看到T omcat 5.5.27提示...



另外,另一个测试页面看看uni是否为MySQL安装了JDBC驱动程序(我很高兴看到他们按照承诺) : JSP JDBC测试页面



所以树脂或者Tomcat ...我不知道这一点:)



从我的同事确认,我们做共享相同的环境。根据Http标头(curl -I输出)

解决方案

Tomcat之外的另一台服务器正在为您的文件提供服务(请参阅头文件返回的是Apache Web服务器),或者如果您的环境设置为Apache HTTP服务器代理请求Tomcat,那么您的设置有问题。

  $ curl -I http://www-student.it.uts.edu.au/~cmao/WSD/WEB-INF/web.xml 

HTTP / 1.1 200 OK
日期:Wed,09 Jun 2010 01:17:42 GMT
服务器:Apache / 2.2.10(Unix)PHP / 5.2.6 Resin / 3.1.7a mod_perl / 2.0.3 Perl / v5 .8.8
最后修改:Wed,09 Jun 2010 01:17:42 GMT
ETag:W /d0304-2f3-4889b8d410680
接受范围:字节
内容长度:755
内容类型:application / xml

Tomcat通常不会投放WEB-INF或web.xml文件。



另外,服务器头部提到树脂,这是一个竞争对手ng servlet容器到Tomcat。也许配置不正确?


This is for uni homework, but I reckon it is more a generic problem to the Tomcat Server(version 5.5.27) on my uni.

The problem is, I first did a skeleton Java Web Application (Just a simple Servlet and a welcome-file, nothing complicated, no lib included) using NetBeans 6.8 with the bundled Tomcat 6.0.20 (localhost:8084/WSD)

Then, to test and prove it is "portable" and "auto-deploy-able", I cleaned and built a WSD.war file and dropped it onto my Xampp Tomcat (localhost:8080/WSD). The war extracted everything accordingly and I can see identical output from this Tomcat. So far, so good.

However, after I tried to drop to war onto uni server, funny thing happens:

uni server

Even though I've changed the war permission to 755, it is simply not "responding".

I then copied the extracted files to uni server, the MainServlet cannot be recognized from within its Context Path "/WSD", basically nothing works, expect the static index.jsp. I tried several times to stop and restart uni Tomcat, it doesn't help?

I wonder what makes this happen? Is there anything I did wrong with my approach?

To be frank I paid no attention to a server not under my control, and I am unfortunately not a real active day-to-day Java Programmer now. I understand the fundamentals of MVC, Servelets, JSPs, JavaBeans, but I really feel frustrated by this, as I cannot see why...

Or, should I ask, a Java Web Application, after cleaned and built by NetBeans6.8, is self-contained and self-configured so ready to be deployed to any Java Web Container?

I know, I can certainly program everything in plain old JSP, but this is soooo... unacceptable to myself...

Update :

I am now wondering if there is any free Tomcat Hosting so that I would like to see if my war file and/or my web app can go with them without any configuration at all?

Second Update :

matt b makes a good point, so I went and checked my environment with an ad-hoc way: a fake JSP page that goes to nowhere

And I did see the word Tomcat 5.5.27 prompted...

Also, another test page to see if uni has installed JDBC driver for MySQL (I am happy to see they did, as promised):JSP JDBC Test Page

So Resin or Tomcat... I cannot really tell at this point :)

Confirmed from my colleague, that we do share the identical environment. According to the Http headers (curl -I output)

解决方案

Either another server besides Tomcat is serving your files (see how the headers returned are for Apache web server), or if your environment is setup such that Apache HTTP server proxies requests to Tomcat, then something is wrong with your setup.

$ curl -I http://www-student.it.uts.edu.au/~cmao/WSD/WEB-INF/web.xml

HTTP/1.1 200 OK
Date: Wed, 09 Jun 2010 01:17:42 GMT
Server: Apache/2.2.10 (Unix) PHP/5.2.6 Resin/3.1.7a mod_perl/2.0.3 Perl/v5.8.8
Last-Modified: Wed, 09 Jun 2010 01:17:42 GMT
ETag: W/"d0304-2f3-4889b8d410680"
Accept-Ranges: bytes
Content-Length: 755
Content-Type: application/xml

Tomcat wouldn't usually serve WEB-INF or web.xml files.

Also, the Server header mentions Resin, which is a competing servlet container to Tomcat. Perhaps it is configured incorrectly?

这篇关于什么使Tomcat5.5不能“意识到”的新Java Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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