启动Apache Tomcat时,出现以下错误:
@ComponentScan(basePackages =
{"com.ce.resources","com.ce.services","com.ce.repository)
@EnableJpaRepositories("com.ce.repository")
@EntityScan(basePackages ={"com.ce.entity","com.ce.tp"})
@SpringBootApplication
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-10-01 15:21:38.861 ERROR 15528 --- [ost-startStop-1] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 1 of constructor in com.ce.services.UserProfileService required a bean of type 'com.ce.tp.UserProfileMapper' that could not be found.
Action:
Consider defining a bean of type 'com.ce.tp.UserProfileMapper' in your configuration.
应用程序无法启动,并且存在问题
构造函数的参数1。这是我正在使用的注释:@Mapper(componentModel = "spring", uses = {})
。
如果需要,我可以提供完整的堆栈跟踪。
package com.ce.entity;
import org.mapstruct.Mapper;
import com.ce.dto.UserProfileDTO;
import com.ce.entity.EntityMapper;
import com.ce.entity.UserProfile;
/**
* Mapper for the entity UserProfile and its DTO UserProfileDTO.
*/
@Mapper(componentModel = "spring", uses = {})
public interface UserProfileMapper extends EntityMapper<UserProfileDTO, UserProfile> {
default UserProfile fromId(Long id) {
if(id==null) {
return null;
}else {
UserProfile userprofile=new UserProfile();
userprofile.setId(id);
return userprofile;
}
}
}