PDA

View Full Version : Exception thrown when the application server starts up with Spring MVC setup


neerajn
May 31st, 2006, 04:49 PM
Hi All,

I have a Weblogic application server setup with Spring MVC. When I start up the server and try to access the first page or the url, I get this error and all the beans are reloaded even if they were instantiated the first time the server starts up. I cannot figure out what the issue is. The exception is as below.

<May 31, 2006 3:28:43 PM CDT> <Notice> <WebLogicServer> <BEA-000355> <Thread "ListenThread.Default"
listening on port 7001, ip address *.*>
loading home page.
Loading mapping for txdps.dl.bpr.di.util.FindingUtil
Loading mapping for txdps.dl.bpr.di.util.AppealReqUtil
Loading mapping for txdps.dl.bpr.di.util.HearingReqUtil
Loading mapping for txdps.dl.bpr.di.util.EnforcementUtil
Loading mapping for txdps.dl.bpr.di.util.LicenseSuspUtil
Loading mapping for txdps.dl.bpr.di.util.ConvictionUtil
Loading mapping for txdps.dl.bpr.di.data.dao.beans.Finding
Loading mapping for txdps.dl.bpr.di.data.dao.beans.AppealRequest
Loading mapping for txdps.dl.bpr.di.data.dao.beans.LicensePlate
Loading mapping for txdps.dl.bpr.di.data.dao.beans.HearingRequest
Loading mapping for txdps.dl.bpr.di.data.dao.beans.Enforcement
Loading mapping for txdps.dl.bpr.di.data.dao.beans.LicenseSuspendInfo
Loading mapping for txdps.dl.bpr.di.data.dao.beans.Conviction
Loading mapping for txdps.dl.bpr.di.data.dao.FindingDAO
Loading mapping for txdps.dl.bpr.di.data.dao.AppealRequestDAO
Loading mapping for txdps.dl.bpr.di.data.dao.LicensePlateDAO
Loading mapping for txdps.dl.bpr.di.data.dao.HearingRequestDAO
Loading mapping for txdps.dl.bpr.di.data.dao.EnforcementDAO
Loading mapping for txdps.dl.bpr.di.data.dao.LicensePlateDAO
Loading mapping for txdps.dl.bpr.di.data.dao.ConvictionDAO
Loading mapping for txdps.dl.bpr.common.search.FindingSearch
Loading mapping for txdps.dl.bpr.common.search.EnfActionSearch
Loading mapping for txdps.dl.bpr.common.search.AppealReqSearch
Loading mapping for txdps.dl.bpr.common.search.HearingReqSearch
Loading mapping for txdps.dl.bpr.common.search.ConvictionSearch
CreateTaskController()
ProcessDeleteController()
EditTaskController()
RequestDeleteController()
Loading mapping for txdps.dl.bpr.di.util.FindingUtil
Loading mapping for txdps.dl.bpr.di.util.AppealReqUtil
Loading mapping for txdps.dl.bpr.di.util.HearingReqUtil
Loading mapping for txdps.dl.bpr.di.util.EnforcementUtil
Loading mapping for txdps.dl.bpr.di.util.LicenseSuspUtil
Loading mapping for txdps.dl.bpr.di.util.ConvictionUtil
Loading mapping for txdps.dl.bpr.di.data.dao.beans.Finding
Loading mapping for txdps.dl.bpr.di.data.dao.beans.AppealRequest
Loading mapping for txdps.dl.bpr.di.data.dao.beans.LicensePlate
Loading mapping for txdps.dl.bpr.di.data.dao.beans.HearingRequest
Loading mapping for txdps.dl.bpr.di.data.dao.beans.Enforcement
Loading mapping for txdps.dl.bpr.di.data.dao.beans.LicenseSuspendInfo
Loading mapping for txdps.dl.bpr.di.data.dao.beans.Conviction
Loading mapping for txdps.dl.bpr.di.data.dao.FindingDAO
Loading mapping for txdps.dl.bpr.di.data.dao.AppealRequestDAO
Loading mapping for txdps.dl.bpr.di.data.dao.LicensePlateDAO
Loading mapping for txdps.dl.bpr.di.data.dao.HearingRequestDAO
Loading mapping for txdps.dl.bpr.di.data.dao.EnforcementDAO
Loading mapping for txdps.dl.bpr.di.data.dao.LicensePlateDAO
Loading mapping for txdps.dl.bpr.di.data.dao.ConvictionDAO
Loading mapping for txdps.dl.bpr.common.search.FindingSearch
Loading mapping for txdps.dl.bpr.common.search.EnfActionSearch
Loading mapping for txdps.dl.bpr.common.search.AppealReqSearch
Loading mapping for txdps.dl.bpr.common.search.HearingReqSearch
Loading mapping for txdps.dl.bpr.common.search.ConvictionSearch
CreateTaskController()
ProcessDeleteController()
EditTaskController()
RequestDeleteController()
<May 31, 2006 3:30:08 PM CDT> <Error> <HTTP> <BEA-101017> <[ServletContext(id=19909592,name=DLSWeb,c
ontext-path=/DLSWeb)] Root cause of ServletException.
java.lang.NoClassDefFoundError: org/springframework/web/context/support/RequestHandledEvent
at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:420
)
at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:347)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run(ServletStubImpl.jav
a:1006)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletC
ontext.java:6718)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:37
64)
at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2644)
at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:178)
>


This is the sample of the first page.

In *-servlet.xml
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<property name="mappings">
<props>
<!-- Main Home Page -->
<prop key="/home.do">homeController</prop>
</props>
</property>
</bean>

<bean id="homeController" class="txdps.dl.bpr.li.controller.HomeController"/>

public class HomeController implements Controller {

public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

System.out.println("loading home page.");

return new ModelAndView("home");
}

}


I think its a problem with my setup on weblogic to my knowledge but I cannot pinpoint why this exception would be thrown.

I would appreciate if you all can give me some inputs on this issue.

irbouho
May 31st, 2006, 09:49 PM
java.lang.NoClassDefFoundError: org/springframework/web/context/support/RequestHandledEvent
What Spring jars do you have in your classpath?
Also, you may disable EventPublishing upon request handling by adding
<init-param>
<param-name>publishEvents</param-name>
<param-value>false</param-value>
</init-param> to your web.xml under the ServletDispatcher config.

HTH.

neerajn
Jun 1st, 2006, 11:26 AM
What Spring jars do you have in your classpath?
Also, you may disable EventPublishing upon request handling by adding
<init-param>
<param-name>publishEvents</param-name>
<param-value>false</param-value>
</init-param> to your web.xml under the ServletDispatcher config.

HTH.

spring.jar is the only jar in the classpath. It has the RequestHandledEvent class. Does disabling EventPublishing affect any features that the MVC provides?

neerajn
Jun 1st, 2006, 06:12 PM
I was able to eliminate the exception by putting spring.jar in the weblogic boot classpath but whenever I load the first page ie. the homecontroller, it shows error 404 page not found. Also the weird thing is that when I refresh the page two times, it finds the url mapping and works fine after that.

If any of you have seen this weird problem before or have any idea why that happens, please let me know.

Thanks.

neerajn
Jun 1st, 2006, 08:10 PM
I fixed the problem finally. With Weblogic and spring, I noticed that with some jars in the WEB-INF/lib, I was getting these problems. I removed the jars that I didnt need and it worked. I will post the jar that was causing the problem once I can pinpoint it.

The problem that I encountered was that I had used db2 jars in the boot classpath of weblogic and they were also present in the WEB-INF/lib. So when the Weblogic classloader encountered those jars, it didnt load the spring.jar and could not find the class. Once I removed them from the WEB-INF/lib, it worked fine. I feel also that as I am using the db2 jars to provide for weblogic connection pooling for a db2 datasource, the classloader might have errored out. Still any other explanations would also be helpful as I cannot understand it fully yet.