org.jboss.weld.exceptions.DeploymentException: WELD-001408 Error

43 views
Skip to first unread message

Yakup Karıksız

unread,
Mar 28, 2017, 8:56:40 AM3/28/17
to mybatis-user
Dear All,

When I try to upgrade mybatis-cdi to 1.0.0 version, I got below error.  Could you please help me solve this problem?

After I updated my pom.xml I made below changes.

1. Removing @Mapper annotation from injection points.
2. @SessionFactoryProvider is added to producer Resource class.

Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type UserRepository with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject tr.com.epias.ecms.core.user.service.UserService.userRepository
  at tr.com.epias.ecms.core.user.service.UserService.userRepository(UserService.java:0)

at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:359)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)

Related classes like also below:

package tr.com.epias.ecms.core.user.service;

import java.util.Date;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import tr.com.epias.ecms.core.cache.CacheProvider;
import tr.com.epias.ecms.core.organization.model.Organization;
import tr.com.epias.ecms.core.organization.model.type.OrganizationStatus;
import tr.com.epias.ecms.core.organization.service.OrganizationService;
import tr.com.epias.ecms.core.user.model.User;
import tr.com.epias.ecms.core.user.repository.UserRepository;
import tr.com.epias.ecms.core.util.DateUtils;

@ApplicationScoped
public class UserService {

  @Inject
  OrganizationService organizationService;

  @Inject
  UserRepository userRepository;

  /**
   * returns given user by id from database.
   * 
   * @param userId.
   * @return user
   */
  public User findUserById(Long userId) {
    User user = null;
    user = CacheProvider.getInstance().getFromOneDayCache("user_" + userId);
    if (null != user) {
      return user;
    }

    user = userRepository.findUserById(userId);
    if (null != user) {
      user.setRoles(userRepository.findUserRoles(user.getRoleGroupId()));
      Organization organization = organizationService.findOrganization(user.getOrganizationId(),
          OrganizationStatus.ACTIVE, DateUtils.newDate());
      user.setOrganization(organization);
      CacheProvider.getInstance().putToOneDayCache("user_" + userId, user);
    }
    return user;
  }

}

package tr.com.epias.ecms.core.user.repository;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import tr.com.epias.ecms.core.user.model.Role;
import tr.com.epias.ecms.core.user.model.User;

@Mapper
public interface UserRepository {

  @Select("SELECT kullanici_id AS USER_ID, " + "DECODE(kullanici_durum,2,'ACTIVE','PASSIVE') AS STATUS, "
      + "organizasyon AS ORGANIZATION_ID,  kullanici_ad AS USERNAME,"
      + "kullanici_gercek_ad AS FULLNAME, kullanici_telefon AS TELEPHONE," + "kullanici_eposta AS EMAIL,"
      + "DECODE(kullanici_mod,1,'ORGANIZATION_ADMIN','USER') AS USER_MODE,"
      + "DECODE(kullanici_tip,2,'EPIAS',4,'PK',5,'RETAIL',6,'TRANSMISSION',7,'DISTRIBUTION') AS USER_TYPE,"
      + "kullanici_yetki_grup AS ROLE_GROUP_ID FROM dgpys.kullanici k where k.kullanici_id=#{userId} ")
  @Results({@Result(id = true, column = "USER_ID", property = "userId"),
      @Result(column = "STATUS", property = "status"), @Result(column = "ORGANIZATION_ID", property = "organizationId"),
      @Result(column = "USERNAME", property = "username"), @Result(column = "FULLNAME", property = "fullname"),
      @Result(column = "EMAIL", property = "email"), @Result(column = "USER_MODE", property = "mode"),
      @Result(column = "USER_TYPE", property = "type"), @Result(column = "ROLE_GROUP_ID", property = "roleGroupId")})
  public User findUserById(Long userId);

}

Best Regards.

Frank Martínez

unread,
Apr 15, 2017, 1:38:21 PM4/15/17
to mybati...@googlegroups.com
Hi Yakup,

Can you provide a sample project?
Which application server you are using and which version?

Can you try to deploy this sample app: https://github.com/mnesarco/mybatis-cdi-samples ?

Cheers,

Frank.


--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Frank D. Martínez M.
Reply all
Reply to author
Forward
0 new messages