I/O failure during classpath scanning in spring MVC
来源:互联网 发布:dnf制裁秒淘宝能解么 编辑:程序博客网 时间:2024/06/03 18:44
I/O failure during classpath scanning in spring MVC
Hi I am new to Spring and I am trying to do a simple spring mvc application which accepts values from customer form and displays the same in the same in the UI. Now the problem is when I try to publish the code in Jboss server I am getting the following error message:
14:40:31,555 ERROR [ContextLoader] Context initialization failedorg.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: D:\jboss-5.1.0.GA\server\default\deploy\SpringMVC.war\WEB-INF\classes\com\spring\customer\controller (The system cannot find the path specified)at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:222)at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:201)at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
Here is my web.xml:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"><display-name>SpringMVC</display-name><servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup></servlet><servlet-mapping> <servlet-name>mvc-dispatcher</servlet-name> <url-pattern>*.htm</url-pattern></servlet-mapping><context-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/mvc-dispatcher-servlet.xml</param-value></context-param><listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class></listener><error-page><error-code>404</error-code><location>/WEB-INF/pages/404.jsp</location></error-page><error-page><exception-type>java.lang.Exception</exception-type><location>/WEB-INF/pages/404.jsp</location></error-page></web-app>
And the Dispatcher Servlet code is as follows:
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-2.5.xsd"><context:component-scan base-package="com.spring.customer.controller" /><bean class="com.spring.customer.validator.CustomerValidator" /><!-- Register the Customer.properties --><bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename" value="com/spring/customer/properties/Customer" /></bean> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" > <property name="prefix"> <value>/WEB-INF/pages/</value> </property> <property name="suffix"> <value>.jsp</value> </property></bean>
I tried searching in google but could not find what is wrong. I have been breaking my head for this issue for almost 2 hours. Some one help!!
P.S: I am using maven.
Thanks in advance
1 Answer
There is :
<context:component-scan base-package="com.spring.customer.controller" />
and it seems you don't have such package in you application, but Spring is searching this package (so a directory) to find components.
Please verify that in binaries you have such package (or maybe you don't have this package at all?)
- I/O failure during classpath scanning in spring MVC
- Spring v3.0.2 Learning Note 9 - Classpath Scanning
- [spring-mvc] classpath
- Spring:+Error:+Unexpected+failure+during+bean+definition+parsing:+null
- Spring Auto Scanning Components
- Spring Auto scanning components
- HFSS Matrix solver exception: file I/O failure..
- I/O streams in java
- File I/O in Unity3D
- I/O & Java in ACM
- WebApplicationInitializer in Spring MVC
- FRM-92101: There was a failure in the Forms Server during startup.
- Visual Studio 2010 >LINK : fatal error LNK1123: failure during conversion to COFF: file in
- failure during conversion to COFF
- All About: File I/O in C++
- I/O System (1)(Thinkng in Java)
- Analyzing I/O performance in Linux
- Life in the Fast I/O Lane
- Android性能优化典范第2季
- OpenCV—图像分割中的分水岭算法原理与应用
- Spark: FetchFailedException: unable to create channel..
- LeetCode 16 3Sum Closest(最接近的3个数的和)
- 生成不同随机数
- I/O failure during classpath scanning in spring MVC
- 批量添加pdf页码
- Linux Programing -- ch11-- 进程和信号
- 黑马程序员——高新技术--JavaBean
- 列表
- 19.Reverse Linked List
- 容器中数据类型为结构体时对其进行排序
- Sqoop详细介绍包括:sqoop命令,原理,流程
- 1694: [Usaco2007 Demo]Grazing on the Run