java Tomcat 6 - 请求的资源......不可用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1529059/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 16:56:19  来源:igfitidea点击:

Tomcat 6 - The requested resource ... is not available

javajakarta-eetomcat6web.xmlstripes

提问by ZZ Coder

I am trying to start developing with Java and the Stripes Framework. I have the following in my web.xml file

我正在尝试开始使用 Java 和 Stripes 框架进行开发。我的 web.xml 文件中有以下内容

<?xml version="1.0" encoding="ISO-8859-1"?> 
<web-app version="2.4"  xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    >

      <filter>
        <filter-name>StripesFilter</filter-name>
        <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
        <init-param>
          <param-name>ActionResolver.Packages</param-name>
          <param-value>
            pdapm.action
          </param-value>
        </init-param>
        <init-param>
          <param-name>Extension.Packages</param-name>
          <param-value>
            pdapm.extensions, org.stripesbook.reload.extensions
          </param-value>
        </init-param>   
      </filter>

      <filter>
        <filter-name>DynamicMappingFilter</filter-name>
        <filter-class>net.sourceforge.stripes.controller.DynamicMappingFilter</filter-class> 
      </filter>

      <filter-mapping>
        <filter-name>DynamicMappingFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>   
      </filter-mapping>

      <welcome-file-list>
        <welcome-file>index.html</welcome-file> 
      </welcome-file-list>

</web-app>

I am receiving the error:

我收到错误:

The requested resource ... is not available.

Is there anything I need to add or anything I should try to fix associated with tomcat. I used the tomcat addon to xampp. I am a beginner so it may have been a simple mistake or skipped step. I'm just looking for a nudge in the right direction.

有什么我需要添加的或我应该尝试修复与 tomcat 相关的任何内容。我在 xampp 上使用了 tomcat 插件。我是初学者,所以这可能是一个简单的错误或跳过了步骤。我只是在寻找正确方向的推动。

[21:44:14] WARN net.sourceforge.stripes.util.ResolverUtil - Could not examine class
'pdapm/action/BaseActionBean.class' due to a java.lang.UnsupportedClassVersionError 
with message: Bad version number in .class file (unable to load class 
pdapm.action.BaseActionBean) 

[21:44:14] WARN net.sourceforge.stripes.util.ResolverUtil - Could not examine class 
'pdapm/action/HomeActionBean.class' due to a java.lang.UnsupportedClassVersionError 
with message: Bad version number in .class file (unable to load class 
pdapm.action.HomeActionBean)

回答by ZZ Coder

The error means your stripes library is compiled with a newer Java than the Tomcat's JVM. Java is not forward-compatible. Say your Tomcat runs under Java 5. It can't load classes compiled with Java 6.

该错误意味着您的条带库是使用比 Tomcat 的 JVM 更新的 Java 编译的。Java 不向前兼容。假设您的 Tomcat 在 Java 5 下运行。它无法加载使用 Java 6 编译的类。

Upgrade the JRE on your system.

升级系统上的 JRE。

回答by Richard Bermudez

I'm not sure but I think ZZ Coder could be right did you check what complier compliance level your project is targeted at and if it's set to 1.6 (Java 6); set it to 1.5 (or whatever Java version your Server is running in) -rebuild and deploy and see what happens.

我不确定,但我认为 ZZ Coder 可能是对的,您是否检查过您的项目针对的编译器合规性级别以及是否设置为 1.6(Java 6);将其设置为 1.5(或您的服务器运行的任何 Java 版本)-重新构建和部署,看看会发生什么。