Closed zuihou closed 4 years ago
The line that is throwing the error, is a spring class:
Not sure how its a dozer problem...
We also have tests using classpath lookup, which dont fail:
@zuihou ; if you still have this issue, please provide a github repo with a junit test showing the problem.
I also have the problem.why
@tryIdea ; as the comment above says, please provide a github repo with a junit test showing the issue.
@garethahealy github repo: dozer-test
@tryIdea ; i am unable to build your example. get the following error:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.1.RELEASE:repackage (repackage) on project dozer-test-domain: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.1.RELEASE:repackage failed: Unable to find main class
@garethahealy Code has been updated
@garethahealy ServletContext resource cannot load "classpath*",the reson maybe the interface Resource of Resource[] mappingFiles,injected by springboot, now only support dozer.mappingFiles=classpath:dozer/global-configuration.xml,classpath:dozer/user-mapping.xml
Hello
Same problem here
The path is correct but still got FileNotFoundException
@zuihou Did you find a solution please ? I am using spring boot as well
Thank you
Hello Same problem here The path is correct but still got
FileNotFoundException
@zuihou Did you find a solution please ? I am using spring boot as well
Thank you
dozer: mappingFiles:
@kazuki43zoo ; if you are able, can you have a look at this please
@garethahealy @zuihou
I've investigated this behavior and I found that it occurred since Spring Boot 2.x (1.5.x work fine). I think this issue's cause belong the Spring Boot project. Hence I've created the spring-projects/spring-boot#15835.
you can use this way to reduce it error
create applicationContext.xml to assign where is your dozer xml location
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2005-2019 Dozer Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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="implicitMapper" class="com.github.dozermapper.core.DozerBeanMapperBuilder" factory-method="buildDefault"/>
<!-- Provided Spring Integration -->
<bean id="byFactory" class="com.github.dozermapper.spring.DozerBeanMapperFactoryBean">
<!--this value is your dozer xml -->
<property name="mappingFiles" value="classpath*:dozer/*.xml"/>
</bean>
2. config your application.yml
server: port: 80
spring: config: location: classpath:applicationContext.xml
Springcloud projects start error reporting.
Whats your runtime?
Whats the
problem?
1, pom
2 application.yml,
3, mapping file :
Observed Results: