Boa tarde pessoal blz?
Estou com um problema para subir minha aplicaçao web ( SpringMVC + JPA + Hibernate tudo feito no maven) em um servidor Weblogic..
Failed to execute goal com.oracle.weblogic:weblogic-maven-plugin:12.1.3-0-0:deploy (default) on project webapp: weblogic.Deployer$DeployerException: weblogic.deploy.api.tools.deployer.DeployerException: Task 15 failed: [Deployer:149026]deploy application webapp on AdminServer.
[ERROR] Target state: deploy failed on Server AdminServer
[ERROR] java.lang.IllegalStateException: Specified field type [class br.com.embraer.ewe.basic.services.UserService] is incompatible with resource type [javax.persistence.EntityManager]
Eu ja fiz a troca do @Autowired por @PersistenceContext
@Service("userService")
@Transactional
public class UserService {
//@Autowired <-- Aqui
@PersistenceContext
private UserRepository userRepository;
public List<User> findAllUsers() {
return userRepository.findAllUsers();
}
public User findById(Long id) {
return userRepository.findById(id);
}
public User findByLogin(String login) {
return userRepository.findByLogin(login);
}
public void saveUser(User user) {
userRepository.saveUser(user);
}
}
O que não compreendo é que possuo uma mesma classe de serviço identica para GroupService, porém essa nao da erro...
@Service("groupService")
@Transactional
public class GroupService {
@PersistenceContext
private GroupRepository groupRepositry;
public List<Group> findAllGroups() {
return groupRepositry.findAll();
}
public Group findGroupById(Integer id) {
return groupRepositry.findById(id);
}
public void saveGroup(Group group) {
groupRepositry.save(group);
}
}
Alguma idéia de como resolver isso?
Abraços!