View Full Version : ResourceBundleViewResolver not workin with spring 3.0
rohan123
Sep 19th, 2009, 05:41 AM
Hi all,
I was switching to spring 3.0 M4 from 2.5. I'm getting following error for views.
Which was working previously fine form me with 2.5
Error
org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'AllEmpPdfReport': Instantiation of bean failed; nested exception is java.lang.IllegalStateException: No bean class specified on bean definition
views.properties
AllEmpPdfReport.class = org.springframework.web.servlet.view.jasperreports .JasperReportsPdfView
AllEmpPdfReport.url = /WEB-INF/jsp/report/study/EmpReport.jrxml
AllEmpPdfReport.reportDataKey=dataSource
AllEmpMultiReport.class=org.springframework.web.se rvlet.view.jasperreports.JasperReportsMultiFormatV iew
AllEmpMultiReport.url=/WEB-INF/jsp/report/study/EmpReport.jrxml
AllEmpMultiReport.reportDataKey=dataSource
What diff with spring 3.0 that makes me this error?
Whats wrong for 3.0 M4?
Marten Deinum
Sep 19th, 2009, 10:54 AM
Hmm not sure but try removing the spaces in your views.properties.
rohan123
Sep 22nd, 2009, 12:48 AM
Hmm not sure but try removing the spaces in your views.properties.
i removed all spaces but still shows me same error.
What is diff in 3.0M4 which forces this error?
rohan123
Sep 22nd, 2009, 09:06 AM
ok i got solution by reading a post.(By trial and Error way) but i know what is the meaning of this code which solves my error. Its better if anyone help me out for giving its meaning.
What i did to solve my error is surround ".class" with "()"(brackets)
AllEmpPdfReport.(class) = org.springframework.web.servlet.view.jasperreports .JasperReportsPdfView
AllEmpPdfReport.url = /WEB-INF/jsp/report/study/EmpReport.jrxml
AllEmpPdfReport.reportDataKey=dataSource
i also try to find in docs but not successful
can anyone tell me what this surrounding of bracket means?
Marten Deinum
Sep 22nd, 2009, 09:35 AM
Well basically it means that it shouldn't use a get/set pair to set the class. All the other stuff is treated as a normal property of the object.
In other words what you normall specify as an attribute on your bean element needs to be enclosed in a ().
rohan123
Sep 24th, 2009, 03:55 AM
Well basically it means that it shouldn't use a get/set pair to set the class. All the other stuff is treated as a normal property of the object.
In other words what you normall specify as an attribute on your bean element needs to be enclosed in a ().
Well i when i added this brackets it works fine (no above error shown when loading) but it wont display my jasper reports and shown me Exception.(looks the class not found)
And when i remove so that class can be found, But it wont loading file and shows me error.
Whats the prob with spring 3.0?
Marten Deinum
Sep 24th, 2009, 03:58 AM
There isn't a problem with spring 3.0 at least not that I'm aware of. Please post full stacktrace.
I suspect either wrong jar versions (mixing spring versions) or missing a additional jar due to changed dependencies in Spring 3.
rohan123
Sep 24th, 2009, 07:13 AM
There isn't a problem with spring 3.0 at least not that I'm aware of. Please post full stacktrace.
I suspect either wrong jar versions (mixing spring versions) or missing a additional jar due to changed dependencies in Spring 3.
ok i'm attaching server log file,jar list and views.properties files for ur reference.
Thank you
Marten Deinum
Sep 24th, 2009, 07:19 AM
spring.web.servlet and spring-webmvc are the same jars. You shouldn't include the servlet-api in your web-inf.
I was more interested in the other exception where the class was specified correctly (i.e. change the .class to .(class) as it should be in your views.properties).
rohan123
Sep 24th, 2009, 07:35 AM
spring.web.servlet and spring-webmvc are the same jars. You shouldn't include the servlet-api in your web-inf.
I was more interested in the other exception where the class was specified correctly (i.e. change the .class to .(class) as it should be in your views.properties).
ok now i changed to .(class)
and on browser my error is as follows:
org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [com.ss.cc.report.controller.dataclass.ReportParame ter]: Is it an abstract class?; nested exception is java.lang.InstantiationException
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:648)
org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:545)
javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
Marten Deinum
Sep 24th, 2009, 07:47 AM
Can you print the whole stacktrace (I guess there is something more in the logfiles).
rohan123
Sep 24th, 2009, 08:19 AM
Can you print the whole stacktrace (I guess there is something more in the logfiles).
ok i solved it.
The scenario is class A is Abstract which is extended by Class B.
Class B is used as DataClass for report.
In previous release of spring(2.5) there is no issue for class A. But in New Release(3.0) it force me error that 'can not create instance of Class A, Is it abstract or what?'
So i change Class A to normal.(remove Abstract keyword).
So in new release this was the reason for Error.
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.