我的项目结构是下面的屏幕截图。实际上,我得到了一个文件找不到的错误,尽管文件是存在的,我将添加错误在下面。我是Intellej的新手,这是我的第一个项目,我试图通过使用MySQL连接到数据库来制作一个音乐商店。下面是我的applicaiton-context.xml,dispatcher和web.xml是正确的。
我的日志文件是
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
由:java.io.fileNotFoundException引起:无法打开类路径资源[com/emusicstore/dao/productdao.class],因为它不存在于getMetadataReaderFactory.getMetadataReaderFactory.java:102)在org.springframework.core.type.classreading.simpleMetadataReaderFactory.getMetadataReaderFactory.getMetadataReaderFactory(simpleMetadataReaderFactory.java:93),在org.springframework.context.annotation.configurationClassParser.assourceClass(configurationClassParser.java:621),在nnotation.configurationClassParser.doProcessConfigurationClass(configurationClassParser.java:298)在org.springframework.context.annotation.comfigurationClassParser.processConfigurationClass(configurationClassParser.java:232)在org.springframework.context.annotation.comfigurationClassParser.java:199)在org.springframework.context.annotation.comfigurationClassParser.parse(
2016年3月18日10:37:15.310严重[http-nio-8080-exec-1]org.apache.catalina.core.standardWrapperValve.invoke servlet dispatcher分配异常java.io.fileNotFoundException:无法打开类路径资源[com/emusicstore/dao/productDao.class],因为它不存在于org.springframework.core.io.classpathResource.getInputStream(ClasspathResource.java:172)和在org.springframework.core.type.classreading.cachingmetadatareaderfactory.getMetadatareaderfactory.getMetadatareaderfactory(cachingMetadatareaderfactory.java:98)在org.springframework.core.type.classreading.getMetadatareaderfactory.java:102),在或k.context.annotation.comfigurationClassParser$sourceClass.GetInterfaces(configurationClassParser.java:797)在org.springframework.context.annotation.comfigurationClassParser.doProcessConfigurationClass(configurationClassParser.java:298)在org.springframework.context.annotation.comfigurationClassParser.processConfigurationClass(configurationClassParser.java:232)在在org.springframework.context.annotation.configurationClassPostProcessor.PostProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:321)在org.springframework.context.support.PostProcessorRegistrationDefinitionRegistry(ConfigurationClassPostProcessor.java:243)在EssorRegistrationDelegate.java:273)在org.springframework.context.support.postprocessorRegistrationDelegrate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)在org.springframework.context.support.abstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)在.createWebApplicationContext(frameworkServlet.java:633)在org.springframework.web.servlet.frameworkServlet.createWebApplicationContext(frameworkServlet.java:681)在org.springframework.web.servlet.frameworkServlet.initWebApplicationContext(frameworkServlet.java:552)在org.springframework.web.servlet.httpServletbean.init(httpservletbean.java:136)在javax.servlet.genericservlet.init(GenericServlet.java:158)在org.apache.catalina.core.standardWrapper.init(StandardWrapper.java:1238)在org.apache.catalina.core.standardWrapper.initServlet(StandardWrapper.java:1151)在org.apache.catalina.core.standardWrapper.loadServlet(StandardWrapper.java:1151)在org.apache.catalina.authenticator.authenticator.authenticator.authenticatorbase.invoke(authenticatorbase.invoke(authenticatorbase.java:106)在org.apache.catalina.core.standardhostvalve.invoke(authenticatorbase.java:502)在org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:141)在java:88)在org.apache.catalina.connector.coyoteAdapteR.Service(coyoteAdapter.java:522)在org.apache.coyote.http11.abstractHttp11Processor.processor(AbstractHttp11Processor.java:1095)在org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.Process(AbstractProtocol.java:672)在org.apache.tomcat.util.net.nioEndpoint$socketProcessor.dorun:1142)在java.util.concurrent.ThreadPoolExecutor$worker.run(threadPoolExecutor.java:617)在org.apache.tomcat.util.threads.taskThread$wrappingrunnable.run(taskThread.java:61)在java.lang.thread.run(thread.java:745)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
由:java.io.fileNotFoundException引起:无法打开类路径资源[com/emusicstore/dao/productdao.class],因为它不存在于getMetadataReaderFactory.getMetadataReaderFactory.java:102)在org.springframework.core.type.classreading.simpleMetadataReaderFactory.getMetadataReaderFactory.getMetadataReaderFactory(simpleMetadataReaderFactory.java:93),在org.springframework.context.annotation.configurationClassParser.assourceClass(configurationClassParser.java:621),在nnotation.configurationClassParser.doProcessConfigurationClass(configurationClassParser.java:298)在org.springframework.context.annotation.comfigurationClassParser.processConfigurationClass(configurationClassParser.java:232)在org.springframework.context.annotation.comfigurationClassParser.java:199)在org.springframework.context.annotation.comfigurationClassParser.parse(
2016年3月18日10:37:16.340严重[http-nio-8080-exec-3]org.apache.catalina.core.standardWrapperValve.invoke servlet dispatcher分配异常java.io.fileNotFoundException:无法打开类路径资源[com/emusicstore/dao/productDao.class],因为它不存在于org.springframework.core.io.classpathResource.getInputStream(ClasspathResource.java:172)和在org.springframework.core.type.classreading.cachingmetadatareaderfactory.getMetadatareaderfactory.getMetadatareaderfactory(cachingMetadatareaderfactory.java:98)在org.springframework.core.type.classreading.getMetadatareaderfactory.java:102),在或k.context.annotation.comfigurationClassParser$sourceClass.GetInterfaces(configurationClassParser.java:797)在org.springframework.context.annotation.comfigurationClassParser.doProcessConfigurationClass(configurationClassParser.java:298)在org.springframework.context.annotation.comfigurationClassParser.processConfigurationClass(configurationClassParser.java:232)在在org.springframework.context.annotation.configurationClassPostProcessor.PostProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:321)在org.springframework.context.support.PostProcessorRegistrationDefinitionRegistry(ConfigurationClassPostProcessor.java:243)在EssorRegistrationDelegate.java:273)在org.springframework.context.support.postprocessorRegistrationDelegrate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)在org.springframework.context.support.abstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)在.createWebApplicationContext(frameworkServlet.java:633)在org.springframework.web.servlet.frameworkServlet.createWebApplicationContext(frameworkServlet.java:681)在org.springframework.web.servlet.frameworkServlet.initWebApplicationContext(frameworkServlet.java:552)在org.springframework.web.servlet.httpServletbean.init(httpservletbean.java:136)在javax.servlet.genericservlet.init(GenericServlet.java:158)在org.apache.catalina.core.standardWrapper.init(StandardWrapper.java:1238)在org.apache.catalina.core.standardWrapper.initServlet(StandardWrapper.java:1151)在org.apache.catalina.core.standardWrapper.loadServlet(StandardWrapper.java:1151)在org.apache.catalina.authenticator.authenticator.authenticator.authenticatorbase.invoke(authenticatorbase.invoke(authenticatorbase.java:106)在org.apache.catalina.core.standardhostvalve.invoke(authenticatorbase.java:502)在org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:141)在java:88)在org.apache.catalina.connector.coyoteAdapteR.Service(coyoteAdapter.java:522)在org.apache.coyote.http11.abstractHttp11Processor.processor(AbstractHttp11Processor.java:1095)在org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.Process(AbstractProtocol.java:672)在org.apache.tomcat.util.net.nioEndpoint$socketProcessor.dorun:1142)在java.util.concurrent.ThreadPoolExecutor$worker.run(threadPoolExecutor.java:617)在org.apache.tomcat.util.threads.taskThread$wrappingrunnable.run(taskThread.java:61)在java.lang.thread.run(thread.java:745)
检查目标文件夹,看看ProductDao.class是否存在,如果不存在,它没有编译它,我想您使用的是Intellij,有时在Intellij中,目标文件夹自动被排除,右键单击目标文件夹并选择取消排除。还要确保类存在于dao包下,并且类的名称相同。另外,请检查bean是否配置正确。
我看到您的目标文件夹被排除在外,因为它是红色的,所以尝试取消排除,如果没有,请显示ProductDao是如何配置为bean的。
我试图为我的项目设置配置位置,但我一直得到以下错误: java.io。FileNotFoundException:无法打开类路径资源[main/resources/app context.xml],因为它不存在 我的项目设置如下: 我将我的代码设置为: 我该怎么解决这个问题?
Spring护套2.0.3。释放 当我运行项目时,指出这个错误,但拦截器。可以找到类。 项目无法启动,但我nterceptor.class可以找到。 在此处输入图像描述
我正在开发一个添加了依赖项的Spring Boot应用程序。这个依赖项有一个spring。xml文件。我正在扫描这个xml文件并创建bean。其中一颗豆子正在寻找冬眠。类路径中的属性。我已将此属性文件添加到应用程序的“资源”文件夹下。但是,我仍然看到下面列出的例外情况。你能告诉我我错过了什么吗? JAVA木卫一。FileNotFoundException:无法打开类路径资源[hibernate.p
我正在使用我的第一个spring helloworld程序,使用STS和maven,这是一个简单的IOC示例 和实现类 还有例外 L 它显示无法找到xml文件的位置,但我指定了我使用Spring工具套件mvc maven项目的位置
问题内容: 我试图通过使用spring hibernatetemplate将我的hibernate示例移植到spring,但出现此错误,原因是:java.io.FileNotFoundException:无法打开ServletContext资源[/applicationContext.xml]。请建议我运行我的项目。我在公司里更新鲜 我的web.xml文件 我的applicationContext
我正试图通过遵循Pro Spring3这本书来学习Spring3。在第4章中,作者解释了IoC和DI。他使用GenericXmlApplication ationContext指定配置文件。他的工作如下: 我的结构是 src/main/resources/app上下文注释。xml IOException解析来自类路径资源[app context annotation.XML]的XML文档;嵌套的例