我在做的是将jasperreport集成到spring上,其他的配置文件度做好了,最后运行HTTP Status 500报错,
怎么解决啊?请高手指点,谢谢!
严重: Servlet.service() for servlet [jasperSpring] in context with path [/jasperSpring] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'report': Instantiation of bean failed; nested exception is java.lang.IllegalStateException: No bean class specified on bean definition] with root cause
java.lang.IllegalStateException: No bean class specified on bean definition
怎么解决啊?请高手指点,谢谢!
严重: Servlet.service() for servlet [jasperSpring] in context with path [/jasperSpring] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'report': Instantiation of bean failed; nested exception is java.lang.IllegalStateException: No bean class specified on bean definition] with root cause
java.lang.IllegalStateException: No bean class specified on bean definition
先翻译一下,创建report Bean时出错,初始化失败,你可以看看配置文件中是不是笔误写错什么名称了。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
<property name="url"><value>jdbc:mysql://localhost/test</value></property>
<property name="username"><value>root</value></property>
<property name="password"><value>123456</value></property>
</bean>
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping" id="publicUrlMapping">
<property name="mappings">
<props>
<prop key="report">jasperController</prop>
</props>
</property>
</bean>
<bean class="controller.JasperSpringController" id="jasperController">
<property name="dataSource">
<ref local="dataSource" />
</property>
</bean>
<bean class="org.springframework.web.servlet.view.ResourceBundleViewResolver" id="viewResolver">
<property name="basename" value="views" />
</bean>
<bean class="net.sf.jasperreports.j2ee.servlets.ImageServlet" id="ImageServlet">
</bean>
</beans>