简体   繁体   English

雄猫 在Eclipse中工作,但在部署时不工作

[英]Tomcat. Works in Eclipse, but does not work when deployed

I have a project on tomcat that works well when I run it "on server" via Eclipse. 我在tomcat上有一个项目,当我通过Eclipse在“服务器上”运行它时,该项目运行良好。 However, when I exported the WAR file and deployed it, the servlets don't work. 但是,当我导出WAR文件并对其进行部署时,这些servlet不起作用。 Only my JSP pages work. 只有我的JSP页面有效。 Here's part of the web XML: 这是Web XML的一部分:

<display-name>CandC3</display-name>

Then, the <welcome-file-list> section and then servlets and mappings. 然后, <welcome-file-list>部分,然后是servlet和映射。 Here's one: 这是一个:

  <servlet>
    <description></description>
    <display-name>LoginServlet</display-name>
    <servlet-name>LoginServlet</servlet-name>
    <servlet-class>candc3.LoginServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>LoginServlet</servlet-name>
    <url-pattern>/LoginServlet</url-pattern>
  </servlet-mapping>

Now, when I try to access this servlet as someserver:8080/CandC3/LoginServlet?param1=val1 I get an error 404: Servlet LoginServlet is not available 现在,当我尝试以someserver:8080 / CandC3 / LoginServlet?param1 = val1的身份访问此Servlet时,出现错误404:Servlet LoginServlet不可用

Any ideas? 有任何想法吗? Am I missing something obvious? 我是否缺少明显的东西? Shouldn't an export from eclipse work seamlessly in a server ;) eclipse的导出不应该在服务器上无缝运行;)

More info: catalina.out 更多信息:catalina.out

INFO: Deploying web application archive CandC3.war
Apr 24, 2013 11:10:34 PM org.apache.catalina.startup.HostConfig deployWAR

Also, after I restart tomcat, the first time I try to use the Servlet I get: 另外,在重新启动tomcat之后,我第一次尝试使用Servlet:

javax.servlet.ServletException: Wrapper cannot find servlet class candc3.LoginServlet or a class it depends on

and as the root cause: 并作为根本原因:

java.lang.ClassNotFoundException: candc3.LoginServlet

After that, on subsequent tries I get error 404: Servlet LoginServlet is not available 之后,在随后的尝试中,我得到error 404: Servlet LoginServlet is not available

Do you have a web application under your tomcat/webapps directory named CandC3? 在tomcat / webapps目录下是否有一个名为CandC3的Web应用程序? Does it have a directory under it named WEB-INF with a "classes" directory or similar under it? 它下面是否有一个名为WEB-INF的目录,下面有一个“类”目录或类似目录? Otherwise, can you physically locate your servlet class candc3.LoginServlet at all anywhere under the CandC3 directory? 否则,您是否可以在CandC3目录下的所有位置实际找到servlet类candc3.LoginServlet?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Web应用程序在带有Glassfish 4.1的Eclipse中可以正常工作,但在部署到Tomcat 9时不能正常工作 - Web app works fine in Eclipse with Glassfish 4.1 but not when deployed to Tomcat 9 战争在本地独立的tomcat 7(无月食)上运行良好,上传到ec2时不起作用 - War works fine on local standalone tomcat 7 (no eclipse), does not work when uploaded to ec2 在TomCat上部署时,我的Angular + Spring应用程序路由不起作用 - My Angular + Spring Application routing does not work when deployed on TomCat 在tomcat中部署的问题。 在本地tomcat中工作正常。 在生产tomcat中抛出空指针异常 - issue with deployment in tomcat. Works fine in local tomcat. throws null pointer exception in Production tomcat 部署到 Tomcat 时 msal-java-webapp-sample 不起作用 - msal-java-webapp-sample does not work when deployed to Tomcat Spring MVC WebAPP可在Eclipse中运行,但在独立的Tomcat中部署时会生成异常 - Spring mvc webapp works in eclipse but generates an exception when deployed in standalone tomcat 在Tomcat上部署时SOAPFaultException但在GlassFish中工作正常 - SOAPFaultException when deployed on Tomcat but works fine in GlassFish Java应用程序后操作可在Eclipse Tomcat中使用,但不适用于本地Tomcat服务器 - Java application post action works in Eclipse Tomcat but does not work on local Tomcat server 在带有eclipse的tomcat servlet中不起作用 - It does not work in tomcat servlet with eclipse 雄猫。 此解析器不支持规范 null 版本 null - Tomcat. This parser does not support specification null version null
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM