Springfox Swagger2 with Spring MVC - 404 Errors - spring

I'm attempting to integrate Springfox Swagger2 into an existing Spring 4 MVC application and running into issues with rendering some of the pages.
The following pages return 404 errors:
https://localhost:9002/swagger-ui.html
Anything under webjars
The following pages work fine and return JSON:
https://localhost:9002/swagger-resources/configuration/security
https://localhost:9002/swagger-resources/configuration/ui
https://localhost:9002/v2/api-docs
I've added the following to my MVC configuration:
<mvc:resources mapping="swagger-ui.html" location="classpath:/META-INF/resources/"/>
<mvc:resources mapping="/webjars/**" location="classpath:/META-INF/resources/webjars/"/>
Going to https://localhost:9002/swagger-ui.html shows a 404 error:
[15/Dec/2017:16:36:07 -0500] "GET /swagger-ui.html HTTP/1.1" 404 36691 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36"
Going to https://localhost:9002/webjars/springfox-swagger-ui/springfox.js shows the same:
[15/Dec/2017:15:10:08 -0500] "GET /webjars/springfox-swagger-ui/springfox.js HTTP/1.1" 404 36691 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36"
web.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>storefront</display-name>
<!--
We have to explicitly clear the welcome file list.
We don't need to serve a default or index page as we can handle all the requests via spring MVC.
-->
<welcome-file-list>
<welcome-file/>
</welcome-file-list>
<context-param>
<description>
Spring Expression Language Support
</description>
<param-name>
springJspExpressionSupport
</param-name>
<param-value>
false
</param-value>
</context-param>
<!-- filters -->
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<!-- set the amount of seconds the conf file will be checked for reload
can be a valid integer (0 denotes check every time,
-1 denotes no reload check, default -1) -->
<init-param>
<param-name>confReloadCheckInterval</param-name>
<param-value>600</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<description>
ResourceFilter
Filter used to server file resources by bypassing the other filters.
</description>
<filter-name>resourceFilter</filter-name>
<filter-class>com.company.storefront.servlets.ResourceFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>resourceFilter</filter-name>
<url-pattern>/_ui/*</url-pattern>
<url-pattern>/_public/*</url-pattern>
</filter-mapping>
<filter>
<description>
SSLTerminationFilter
Allows for SSL termination at the loadbalancer/HTTP server level
</description>
<filter-name>SSLTerminationFilter</filter-name>
<filter-class>com.acquitygroup.security.SSLTerminationFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SSLTerminationFilter</filter-name>
<servlet-name>DispatcherServlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<!-- Begin custom security filters -->
<!-- Commented out for fixing log out issue
<filter>
<description>
SecureSessionFilter
Helps prevent session hi-jacking/fixation vulnerabilities
</description>
<filter-name>SecureSessionFilter</filter-name>
<filter-class>com.acquitygroup.security.SecureSessionFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SecureSessionFilter</filter-name>
<servlet-name>DispatcherServlet</servlet-name>
</filter-mapping>
-->
<filter>
<filter-name>XSSFilter</filter-name>
<filter-class>de.hybris.platform.servicelayer.web.XSSFilter</filter-class>
<async-supported>true</async-supported>
</filter>
<filter-mapping>
<filter-name>XSSFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter>
<description>
Spring configured based chain of the spring configurable filter beans
</description>
<filter-name>storefrontFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>storefrontFilterChain</filter-name>
<servlet-name>DispatcherServlet</servlet-name>
</filter-mapping>
<filter>
<description>
OpenRedirectInterruptFilter
Helps prevent against Open Redirect vulnerabilities
</description>
<filter-name>OpenRedirectInterruptFilter</filter-name>
<filter-class>com.acquitygroup.security.OpenRedirectInterruptFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenRedirectInterruptFilter</filter-name>
<servlet-name>DispatcherServlet</servlet-name>
</filter-mapping>
<!-- End custom security filters -->
<!-- spring based filter chain -->
<filter>
<description>
SpringSecurityFilterChain
Supports delegating to a chain of spring configured filters. The filter name
must match the bean name.
</description>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<servlet-name>DispatcherServlet</servlet-name>
</filter-mapping>
<!-- punchout filter for IE 8 -->
<filter>
<filter-name>P3PFilter</filter-name>
<filter-class>com.company.core.filter.P3PServletFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>P3PFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- HTTP Session Listeners -->
<listener>
<description>
The HybrisContextLoaderListener extends the usual SpringContextLoaderListener (which loads
the context from specified location) by adding the global application context of
the platform as parent context. With having the global context set as parent you can access
or override beans of the global context and get the 'tenant' scope.
</description>
<listener-class>de.hybris.platform.spring.HybrisContextLoaderListener</listener-class>
</listener>
<listener>
<description>
The RequestContextListener exposes the 'request' scope to the context.
Furthermore it is needed when overriding the 'jalosession' bean for your web application.
</description>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<listener>
<description>
The RequestContextListener exposes the 'request' scope to the context.
Furthermore it is needed when overriding the 'jalosession' bean for your web application.
</description>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<!-- config -->
<context-param>
<description>
The 'contextConfigLocation' param specifies where your configuration files are located.
The 'WEB-INF/config/web-application-config.xml' file includes several other XML config
files to build up the configuration for the application.
</description>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/config/web-application-config.xml</param-value>
</context-param>
<!-- Servlets -->
<!-- To Avoid server start up issues due to scope tenant -->
<servlet>
<servlet-name>DispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>de.hybris.platform.spring.ctx.TenantIgnoreXmlWebApplicationContext</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/config/web-application-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- <servlet>
<description>
DispatcherServlet
Spring MVC dispatcher servlet. This is the entry point for the Spring MVC application.
</description>
<servlet-name>DispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<description>
Specifies the location for Spring MVC to load an additional XML configuration file.
Because hybris is already configured with the XML spring configuration files to load
we must set this param value to EMPTY in order to prevent loading of the default
/WEB-INF/applicationContext.xml file.
</description>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet> -->
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<!-- Map all requests to the DispatcherServlet -->
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- Uncomment in to enable handling of 500 server errors -->
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/WEB-INF/views/pages/error/serverError.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/WEB-INF/views/pages/error/serverError.jsp</location>
</error-page>
<!-- handle csrf token errors due to session timeout! -->
<error-page>
<exception-type>com.acquitygroup.security.csrf.RequestConfirmationTokenException</exception-type>
<location>/login?timeout=true</location>
</error-page>
<!-- Session -->
<session-config>
<!-- Session timeout of 30 minutes -->
<session-timeout>240</session-timeout>
</session-config>
<!-- JSP Configuration -->
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<!-- Disable JSP scriptlets and expressions -->
<scripting-invalid>true</scripting-invalid>
<!-- Remove additional whitespace due to JSP directives -->
<trim-directive-whitespaces>true</trim-directive-whitespaces>
</jsp-property-group>
</jsp-config>
</web-app>
Just looking for some guidance on why this is occurring and how to resolve it.

Please check the aop version, it should be the same version that is 4x. Please refer Integrating Swagger with Spring 3.0.6.RELEASE and https://github.com/springfox/springfox/issues/938. These are the frequent errors in using swagger.

Related

How to set Spring root context path

I am a Spring newbie and am putting together a Spring web-app (not Spring-boot - how much difference does this make?). Deployment is on a Tomcat 7 server.
The app is up and running. My problem is that is only accessible via the standard URL:
http://mycompany.com:8081/cwing-0.0.3-SNAPSHOT/index.html
The following do not work:
http://mycompany.com:8081/cwing-0.0.3-SNAPSHOT
http://mycompany.com:8081/cwing-0.0.3-SNAPSHOT/
even though my web.xml lists index.html as the welcome page.
An additional symptom of the problem is that all sorts of links within the application need to be specified as relative, rather than with a prepended '/'.
But even these urls are not what I really want.
I would rather specify
http://mycompany.com:8081/cwing
and have it bring up the index.html.
Following the lead of Add context path to Spring Boot application
I created an application.xml file in src/main/resources with the following content:
server.contextPath=/cwing
server.port=8081
This doesn't work. http://mycompany.com:8081/cwing brings up a blank page, with a 404 error on the server, as does http://mycompany.com:8081/cwing/index.html.
I must be missing something. What else is needed to get this to work as I want it to work?
UPDATE: as asked, here is the web.xml (irrelevant details removed).
<?xml version="1.0"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>cwing</display-name>
<!-- Creates the Spring Container shared by all Servlets and Filters -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- The definition of the Root Spring Container shared by all Servlets
and Filters -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/context.xml
/WEB-INF/spring/datasource.xml
/WEB-INF/spring/security.xml
</param-value>
</context-param>
<servlet>
<servlet-name>d</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/context.xml
/WEB-INF/spring/datasource.xml
/WEB-INF/spring/security.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>d</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<!-- Disables Servlet Container welcome file handling. Needed for compatibility
with Servlet 3.0 and Tomcat 7.0 -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
...
</web-app>
This is not related to Spring MVC but to specific server, by default Tomcat gets your WAR name as context root. If you want to change this, you can always rename your WAR file or I recommends to change your pom.xml to build your WAR file with final name, here is how to do this:
<build>
<finalName>finalName</finalName>
. . .
</build>

Issue with name appServlet-servlet.xml

Hi guys I'm working with Spring 3.2.3, hibernate 4.2.2 and org.springframework.security 3.0.5. Before I start working with security in spring, my context file was called servlet-context.xml and everything worked fine. Since I start using org.springframework.security 3.0.5 when I try to run my application I get the error:
java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/appServlet-servlet.xml]
My web.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<!-- Spring MVC -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/servlet-context.xml,
/WEB-INF/spring-security.xml
</param-value>
</context-param>
<!-- Spring Security -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Notice that I'm specifying my servlet-context.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/servlet-context.xml,
/WEB-INF/spring-security.xml
</param-value>
</context-param>
If I leave my web.xml just like this and copy/paste my servlet-context.xml content in a new file called appServlet-servlet.xml, everything works fine. This is confusing for me since I told web.xml that my context file name was servlet-context.xml. Am I forced to call my context file as appServlet-servlet.xml??. Of course, if I delete servlet-context.xml and leave appServlet-servlet.xml making the specficiation in web.xml, works fine.
I just wanna know if is obligatory to call my context file as appServlet-servlet.xml if I want to use spring security in my app.
This is not strange. Spring works this way. Since your DispatchServlet name is appServlet, Spring automatically tries to find the servlet context that has the same name, here "appServlet-servlet.xml".
Here is a page that may help : http://syntx.io/difference-between-loading-context-via-dispatcherservlet-and-contextloaderlistener/

Freemarker template (FTL) not working in struts2

I am working with Struts2 and ftl. Instead of jsp I want to use ftl, but when I define welcome file in web.xml as login.ftl it is not working. It just shown as text. The entire code is shown in the browser, but if it is jsp everything works.
I just paste my web.xml below.
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>login.ftl</welcome-file>
</welcome-file-list>
How can I configure ftl in Struts2? If I use that same page as output page of an action it is working. How can I solve this? Is there any problem with my web.xml configuration?? Please help me. Thank you in advance.
Maybe this help you(extract of a web.xml):
<servlet>
<servlet-name>freemarker</servlet-name>
<servlet-class>com.thoughtequity.video.web.servlet.SiteFreemarkerServlet</servlet-class>
<!-- FreemarkerServlet settings: -->
<init-param>
<param-name>TemplatePath</param-name>
<param-value>/</param-value>
</init-param>
<init-param>
<param-name>NoCache</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>ContentType</param-name>
<param-value>text/html</param-value>
</init-param>
<!-- FreeMarker settings: -->
<init-param>
<param-name>template_update_delay</param-name>
<param-value>0</param-value> <!-- 0 is for development only! Use higher value otherwise. -->
</init-param>
<init-param>
<param-name>default_encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>number_format</param-name>
<param-value>0.##########</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/te.js</url-pattern>
</servlet-mapping>
<!-- Map *.ftl files to Freemarker-->
<servlet-mapping>
<servlet-name>freemarker</servlet-name>
<url-pattern>*.ftl</url-pattern>
</servlet-mapping>
<!-- The Welcome File List -->
<welcome-file-list>
<welcome-file>index.vm</welcome-file>
</welcome-file-list>
FreeMarker template files need to be processed in order to generate textual pages that shows your data. You cannot just put them in welcome-file-list. For example in Struts2 you can redirect to your action and there use your template.
Also read this http://wiki.metawerx.net/wiki/HowToUseAServletAsYourMainWebPage.

Filter url pattern conflict in web.xml ?

I am working on a projec, the application is in j2ee and I have used ehcache for web page caching but due to the entries of filter it gives me an error content encoding error i have added following filter and ehcache.xml can anyone say which entry causes it ?
web.xml filter entry
<filter>
<filter-name>SetCharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>SetCharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>Pretty Filter</filter-name>
<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Pretty Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
<init-param>
<description>Set the size limit for uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
</description>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
</init-param>
<init-param>
<description>Set the threshold size - files below this limit are stored
in memory, files above this limit are stored on disk.
Format: 10 - 10 bytes
10k - 10 KB
</description>
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
</init-param>
<init-param>
<param-name>uploadRepositoryPath</param-name>
<param-value>/home</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<filter>
<filter-name>CachePage1CachingFilter</filter-name>
<filter-class>net.sf.ehcache.constructs.web.filter.SimplePageCachingFilter</filter-class>
<init-param>
<param-name>suppressStackTraces</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>cacheName</param-name>
<param-value>CachePage1CachingFilter</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CachePage1CachingFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
ehcache.xml is as follow
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="10"
eternal="false"
timeToIdleSeconds="5"
timeToLiveSeconds="10"
overflowToDisk="true"
/>
<!-- Page and Page Fragment Caches -->
<cache name="CachePage1CachingFilter"
maxElementsInMemory="10"
eternal="false"
timeToIdleSeconds="10000"
timeToLiveSeconds="10000"
overflowToDisk="true">
</cache>
Edited:-
I tried and i got the problem is because of the url pattern in
<filter-name>CachePage1CachingFilter</filter-name>
<url-pattern>/*</url-pattern>
in filter it goes continuously in filter the exception was reentrant exception if i am write following
<filter-name>CachePage1CachingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
it works fine but i want it to be worked for jsf and entry of jsf is done in preety config like follow
<url-mapping id="ManageUsers">
<pattern>/manageUsers</pattern>
<view-id>/pages/master/manageUsers.jsf</view-id>
</url-mapping>
what should i do to avoid this ?
With the servlet spec 2.5 (implemented by Tomcat 6) you can specify multiple url patterns:
<filter-mapping>
<filter-name>CachePage1CachingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
For prior to 2.5, you'd be able to specify two mappings
<filter-mapping>
<filter-name>CachePage1CachingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CachePage1CachingFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>

Error 500: Filter [Spring OpenEntityManagerInViewFilter]: could not be loaded

I am trying to deploy a Spring application on WAS 6.0 (JDK 1.4.2). Day back I was getting tons of (Unsupported major.minor version 49.0) errors. I replaced most of the jar files and now I am left with only one error on:
org/springframework/orm/jpa/support/OpenEntityManagerInViewFilter (Unsupported major.minor version 49.0)
what jar file do I need to replace for this? Also when I am running my URL in the browser I am getting the error:
Error 500: Filter [Spring OpenEntityManagerInViewFilter]: could not be loaded
Can you please guide me ,where exactly I am doing wrong. Attached is my Web.xml.
Your help is highly appreciated.
enter code here
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
analytics
Roo generated analytics application
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>analytics.root</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<context-param>
log4jConfigLocation
classpath:log4j.properties
org.springframework.web.util.Log4jConfigListener
org.springframework.web.context.ContextLoaderListener
<servlet>
<servlet-name>analytics</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Serves static resource content from .jar files such as spring-js.jar -->
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>analytics</servlet-name>
<url-pattern>/*.html</url-pattern>
</servlet-mapping>
<!-- Map all /resources requests to the Resource Servlet for handling -->
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>httpMethodFilter</filter-name>
<filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>httpMethodFilter</filter-name>
<servlet-name>analytics</servlet-name>
</filter-mapping>
<filter>
<filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
</filter>
Spring OpenEntityManagerInViewFilter
/*
<session-config>
<session-timeout>10</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/WEB-INF/jsp/uncaughtException.jsp</location>
</error-page>
The "Unsupported major.minor version" errors are caused by your using JAR files compiled for a higher version of java than you're running.
I think class file version 49.0 is Java 5, and you're running 1.4. That means you must be using a library that's Java 5 only, and the only version of Spring thats java 5 only is Spring 3.0. If that's the case, then downgrade your Spring to 2.5.6.

Resources