FileNotFoundException: ServletContext resource [/classpath*:dozer/*dozer.xml] cannot be resolved to URL because it does not exist
See original GitHub issueSpringcloud projects start error reporting.
Whats your runtime?
- Dozer version: 6.4.0_
- OS version: __mac os 10.13.4 ___
- JDK version: 8_
- SpringBoot version: 2.0.0.RELEASE
- SpringCloud version: Finchley.M8
Whats the problem?
1, pom
<dependency>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-core</artifactId>
<version>6.4.0</version>
</dependency>
<dependency>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-spring-boot-starter</artifactId>
<version>6.4.0</version>
</dependency>
2 application.yml,
dozer:
mappingFiles: classpath*:dozer/*.dozer.xml
3, mapping file :
src/main/resources/dozer/global.dozer.xml
Observed Results:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.dozermapper.spring.DozerBeanMapperFactoryBean]: Factory method 'dozerMapper' threw exception; nested exception is java.io.FileNotFoundException: ServletContext resource [/classpath*:dozer/*dozer.xml] cannot be resolved to URL because it does not exist
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:579)
... 45 common frames omitted
Caused by: java.io.FileNotFoundException: ServletContext resource [/classpath*:dozer/*dozer.xml] cannot be resolved to URL because it does not exist
at org.springframework.web.context.support.ServletContextResource.getURL(ServletContextResource.java:174)
at com.github.dozermapper.spring.DozerBeanMapperFactoryBean.setMappingFiles(DozerBeanMapperFactoryBean.java:81)
at com.github.dozermapper.springboot.autoconfigure.DozerAutoConfiguration.dozerMapper(DozerAutoConfiguration.java:58)
at com.github.dozermapper.springboot.autoconfigure.DozerAutoConfiguration$$EnhancerBySpringCGLIB$$c8b0337d.CGLIB$dozerMapper$0(<generated>)
at com.github.dozermapper.springboot.autoconfigure.DozerAutoConfiguration$$EnhancerBySpringCGLIB$$c8b0337d$$FastClassBySpringCGLIB$$2d9afb47.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361)
at com.github.dozermapper.springboot.autoconfigure.DozerAutoConfiguration$$EnhancerBySpringCGLIB$$c8b0337d.dozerMapper(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 46 common frames omitted
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (1 by maintainers)
Top Results From Across the Web
class path resource cannot be resolved to URL because it ...
FileNotFoundException : class path resource [com/mycompany/context-B.xml] cannot be resolved to URL because it does not exist.
Read more >Unable To Edit Element After Patch: java.io ... - Oracle Support
FileNotFoundException : ServletContext resource [/Xcelerate/OMTree. ... cannot be resolved to URL because it does not exist (Doc ID 2697377.1).
Read more >FileNotFoundException « Exception « Spring Q&A - Java2s.com
FileNotFoundException : class path resource cannot be opened because it does not exist stackoverflow.com. I want to pick up a property file app.properties ......
Read more >Search - appsloveworld.com
[Solved]-Java.io.FileNotFoundException: class path resource [../ProductDao.class] cannot be opened because it does not exist-Spring MVC.
Read more >Spring Mvc - Unexpected Exception Parsing Xml Document ...
FileNotFoundException : Could not open ServletContext resource. ... dozer: mappingFiles: classpath:dozer/.dozer.xml to URL because it does not exist at ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also have the problem.why
you can use this way to reduce it error