2 Replies Latest reply on Aug 5, 2019 8:09 AM by sphola

    Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408

    sphola

      Hi Everyone

      i am facing the below error:

      11:41:25,001 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "healthy-heart-score-batch.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"healthy-heart-score-batch.ear\".WeldStartService" => "Failed to start service
          Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type JMSMessageProcessService with qualifiers @Default
        at injection point [BackedAnnotatedField] @Inject private com.company.service.healthyheartscore.processor.HealthyHeartScoreBatchProcessor.messageProvider
        at com.company.service.healthyheartscore.processor.HealthyHeartScoreBatchProcessor.messageProvider(HealthyHeartScoreBatchProcessor.java:0)
      WELD-001474: Class com.company.service.healthyheartscore.utils.JMSMessageProcessService is on the classpath, but was ignored because a class it references was not found: [unknown].
      "}}
      @

       

      Trying to deploy this application on WildFly 16.

      Here is the class.

       

      JMSMessageProcessService.java

      @Defaultpublic class JMSMessageProcessService {
      
         private static final Logger LOGGER = LoggerFactory
        .getLogger(JMSMessageProcessService.class);  private QueueConnectionFactory getConnectionFactory(String conFactJNDIName) {
        Context ctx = null;   QueueConnectionFactory conFactory = null;  try {
        ctx = new InitialContext();   conFactory = (QueueConnectionFactory) ctx.lookup(conFactJNDIName);   } catch (NamingException e) {
         LOGGER.error("NamingException: {}", e);   }
         return conFactory;   }
      
      
         public void pushMessageInTopic(String topicConnectionFactory, String topic, String message, Properties messageSelectors) throws Exception {
        javax.jms.TopicConnection connection = null;   TopicSession session = null;   Topic destinationTopic = null;   TopicPublisher requestProducer = null;   TextMessage requestMessage = null;  try {
        connection = getTopicConnectionFactory(topicConnectionFactory).createTopicConnection();   session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);   destinationTopic = getTopic(topic);   requestProducer = session.createPublisher(destinationTopic);   LOGGER.debug("requestProducer created");   requestMessage = session.createTextMessage();   LOGGER.debug("requestMessage created");  if (null != messageSelectors && !messageSelectors.isEmpty()) {
         for (Map.Entry<object, object> e : messageSelectors.entrySet()) {
        String key = (String) e.getKey();   String value = (String) e.getValue();   requestMessage.setObjectProperty(key, value);   }
        }
        requestMessage.setText(message);   requestProducer.publish(requestMessage);   LOGGER.debug("Sent request");   LOGGER.debug("Request Message Text: {}", requestMessage.getText());   } catch (JMSException e) {
         LOGGER.error("Create Topic Message: JMSException {}", e);  throw e;   } catch (Exception e) {
         LOGGER.error("Create Topic Message: Exception {}", e);  throw e;   } finally {
         try {
         if (session != null) {
        session.close();   }
         if (connection != null) {
        connection.close();   }
        } catch (JMSException e) {
         LOGGER.error("JMSException occured while closing session {}", e);  throw e;   }
        }
        }
      
      
      }

       

       

      i am injecting it here

      HealthyHeartScoreBatchProcessor.java

      @Statelesspublic class HealthyHeartScoreBatchProcessor {
      
         private static final Logger LOGGER = LoggerFactory
        .getLogger(HealthyHeartScoreBatchProcessor.class);   @Inject   private HealthyHeartScoreUtils healthyHeartScoreUtils;   @Inject   private AgeUtils ageUtils;   @Inject   private JMSMessageProcessService messageProvider;   @Inject   private HealthyHeartScoreDAO healthyHeartScoreDao;   @Inject   private HealthyHeartScoreOdmWrapper healthyHeartScoreOdmWrapper;

       

       

      bean.xml is empty

       

      i would really appriciate some help.

        • 1. Re: Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408
          manovotn

          Hello,

           

          that's interesting error, I think good lead is the WELD-001474 error.

          WELD-001474: Class com.company.service.healthyheartscore.utils.JMSMessageProcessService is on the classpath, but was ignored because a class it references was not found: [unknown]. 

           

          During bootstrap of the app (before the error), do you see some other Weld logs? Specifically something like (error code 119, level INFO):

          Not generating any bean definitions from {0} because of underlying class loading error: Type {1} not found. If this is unexpected, enable DEBUG logging to see the full error."

          Because that would explain why the class is not turned into a bean.

          It might be handy to see a full bootstrap log with DEBUG enabled.

          Also, do you use any special deployment structure? EAR/WFLY modules/.... ?

          Alternatively, if you have a shareable reproducer, I can see for myself and poke into that.

          • 2. Re: Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408
            sphola

            HI

             

            Thanks for taking time and looking into this problem. somehow i just changed javaee version from 6 to 7 and it worked.

             

            Thank you