The following error occurs when running spring:
Exception in thread "Main" org. springframework. beans. factory. beandefinitionstoreexception: ioexception parsing XML document from file [F:/dream/workspace/CCH/bean. XML]; Nested exception is Java. io. filenotfoundexception: bean. XML (the system cannot find the specified file .)
At org. springframework. Beans. Factory. xml. xmlbeandefinitionreader. loadbeandefinitions (xmlbeandefinitionreader. Java: 349)
At org. springframework. Beans. Factory. xml. xmlbeandefinitionreader. loadbeandefinitions (xmlbeandefinitionreader. Java: 310)
At org. springframework. Beans. Factory. Support. abstractbeandefinitionreader. loadbeandefinitions (abstractbeandefinitionreader. Java: 143)
At org. springframework. Beans. Factory. Support. abstractbeandefinitionreader. loadbeandefinitions (abstractbeandefinitionreader. Java: 178)
At org. springframework. Beans. Factory. Support. abstractbeandefinitionreader. loadbeandefinitions (abstractbeandefinitionreader. Java: 149)
At org. springframework. Beans. Factory. Support. abstractbeandefinitionreader. loadbeandefinitions (abstractbeandefinitionreader. Java: 212)
At org. springframework. Context. Support. abstractxmlapplicationcontext. loadbeandefinitions (abstractxmlapplicationcontext. Java: 113)
At org. springframework. Context. Support. abstractxmlapplicationcontext. loadbeandefinitions (abstractxmlapplicationcontext. Java: 80)
At org. springframework. Context. Support. abstractrefreshableapplicationcontext. refreshbeanfactory (abstractrefreshableapplicationcontext. Java: 123)
At org. springframework. Context. Support. abstractapplicationcontext. obtainfreshbeanfactory (abstractapplicationcontext. Java: 423)
At org. springframework. Context. Support. abstractapplicationcontext. Refresh (abstractapplicationcontext. Java: 353)
At org. springframework. Context. Support. filesystemxmlapplicationcontext. <init> (filesystemxmlapplicationcontext. Java: 140)
At org. springframework. Context. Support. filesystemxmlapplicationcontext. <init> (filesystemxmlapplicationcontext. Java: 84)
At lei. Deng. Yan. Spring. factorybeen. springtest. Main (springtest. Java: 12)
Caused by: Java. Io. filenotfoundexception: bean. XML (the system cannot find the specified file .)
At java. Io. fileinputstream. Open (native method)
At java. Io. fileinputstream. <init> (fileinputstream. Java: 106)
At org. springframework. Core. Io. filesystemresource. getinputstream (filesystemresource. Java: 108)
At org. springframework. Beans. Factory. xml. xmlbeandefinitionreader. loadbeandefinitions (xmlbeandefinitionreader. Java: 336)
... 13 more
Solution:
The cause of the error is Bean. the path where XML is placed is incorrect. The bug prompts that bean is not found in F:/dream/workspace/CCH. XML file, so the bean. put the XML file in the directory F:/dream/workspace/CCH/, that is, put it in the first folder of the project.