-
Oct 15th, 2008, 02:17 PM
#1
problem in upgrading spring 1.4.5 to spring 2.5.5
Hi all,
I am confident that i am going to get this issue resolved by the great people who are here in this community.. 
Here it goes:
I am having an application that is running in spring 1.4.5. I tried to upgrade it to spring 2.5.5. There were many compatible issues while building. One among such is RowMapperResultReader class is removed in spring 2.5.5. I was able to resolve all the build errors.
I am using JDK1.6 and Tomcat6.0.18
But i having deployment issues while starting the server.
"servletContext must not be null" which is the error i get while deploying. can any one peep into this issue. Is the loading the servletContext different in spring 2.5.5. Can any one help us the flow how the application context get initialized in spring 2.5.5.
The same code works fine in spring1.4.5 but we face problems only in 2.5.5.
In our application we have the web.xml along with the businesstierContext.xml which contains the busness level xml's just for modularity in the application.
I have given here my web.xml, businesstiercontext.xml and one of my module level xml which is responsible for the below deployement error.
Error log while deploying:
Caused by: java.lang.IllegalArgumentException: ServletContext must not be null
please see attached file
My Web.xml:
<web-app>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>tip.root</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<listener>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListe ner
</listener-class>
</listener>
<listener>
<listener-class>org.acegisecurity.ui.session.HttpSessionEven tPublisher</listener-class>
</listener>
<servlet>
<servlet-name>remoting</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>remoting</servlet-name>
<url-pattern>/remoting/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>tip</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>tip</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- ACEGI Security filter -->
<filter>
<filter-name>Acegi Filter Chain Proxy</filter-name>
<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
<init-param>
<param-name>targetClass</param-name>
<param-value>org.acegisecurity.util.FilterChainProxy</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Acegi Filter Chain Proxy</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Acegi Filter Chain Proxy</filter-name>
<url-pattern>/autoLogin.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Acegi Filter Chain Proxy</filter-name>
<url-pattern>/j_acegi_security_check</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Acegi Filter Chain Proxy</filter-name>
<url-pattern>/j_acegi_logout</url-pattern>
</filter-mapping>
<!-- Configuration filter -->
<filter>
<filter-name>server</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFil terProxy</filter-class>
<init-param>
<param-name>targetBeanName</param-name>
<param-value>server</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>server</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<!-- Tracking filter -->
<filter>
<filter-name>trackingFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFil terProxy</filter-class>
<init-param>
<param-name>targetBeanName</param-name>
<param-value>trackingFilter</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>trackingFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/tip-servlet.xml,
/WEB-INF/config/webContext-common.xml,
/WEB-INF/config/webContext-search.xml,
/WEB-INF/config/webContext-searchAids.xml,
</param-value>
</context-param>
<context-param>
<param-name>parentContextKey</param-name>
<param-value>businessTierContext</param-value>
</context-param>
<context-param>
<param-name>locatorFactorySelector</param-name>
<param-value>classpath*:businessTierContext.xml</param-value>
</context-param>
<!-- Welcome file that opens default on start up -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
businesstiercontext.xml
<beans>
<bean id="businessTierContext" class="org.springframework.context.support.ClassPa thXmlApplicationContext" abstract="false" singleton="true"
lazy-init="default" autowire="default" dependency-check="default">
<constructor-arg>
<list>
<value>businessContext-common.xml</value>
<value>businessContext-cache.xml</value>
<value>businessContext-trackingContext.xml</value>
<value>businessContext-securityContext.xml</value>
<value>businessContext-searchContext.xml</value>
</list>
</constructor-arg>
</bean>
</beans>
businessContext-common.xml
<beans>
<bean id="server"
class="com.thomson.web.filters.ConfigurationFilter ">
</bean>
....and other been entries that are common for my module
ConfigurationFilter.java
My configurationFilter.java look like this as given below which extends DelegatingFilterProxy. So while invoking the init method the delegatingFilterProxy i am getting the error "ServletContext must not be null"
public class ConfigurationFilter extends DelegatingFilterProxy {
....
....
}
-
Oct 15th, 2008, 02:21 PM
#2
Please find here attached with the deployment Error log:
Error Log.txt
Please see the deployment error. "servletContext must not be null"
-
Oct 16th, 2008, 05:03 AM
#3
Wrong Forum
Hi bharu,
FYI: you have posted to the SpringSource dm Server "Application development and deployment" forum.
You will likely get better assistance if you post your Spring MVC related questions to the Web forum.
Regards,
Sam
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules