Tomcat 6 - The requested resource … is not availab

2019-05-01 10:21发布

问题:

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

<?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.

[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)

回答1:

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.

Upgrade the JRE on your system.



回答2:

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.