0

I am trying to create a MQConnectionFactory using @ Bean annotation which is invoked by SpringBootApplication. Below is the exception stack.

`Startup failed ’org.springframework.beans.factory.config.BeanExpressionException’ expression parsing fail 
nested exception is org.springframework.expression.spel.spelevaluationexception 
EL1008e property or field ‘queueManagerName ’can not be found on the object of type org.springframework.beans.factory.config.beanexpressioncontext

Config class is described below *:-

@Configuration
class MQConfig{

@Value("${queue.manager}")
private String queueManagerName;

   @Bean
   public MQConnectionFactory defaultConnectionFactory(){

      MQConnectionFactory mqConnectionFactory = new MQConnectionFactory();

      mqConnectionFactory.setQueueManagerName(queueManagerName);

      return mqConnectionFactory;

   }

}

Usage is like below *:-

@Component
QueueMsgReceiver{

     @JmsListener(destination="${main.job.queue}",concurrency="1")
     public void updateMsg(Message jsonMsg) throws     JmsException,ExecutionException,InterruptedException{

    }
}

Invoker is like below*:-

@EnableJMS
@SpringBootApplication(exclude={FreeMarkerAutoConfiguration.class})

    public class Application{

       public static void main(String args[])
       {
           SpringApplication.run(Application.class,args);
       }

    }
  • You need to show your configuration, including the place where you have a SpEL expression referencing `queueManagerName`. The error implies you are trying to reference a bean that doesn't exist, but we can't tell without seeing the configuration. – Gary Russell Mar 18 '18 at 19:30
  • @GaryRussell I have updated the configuration. Please have a look – Prashant Pandey Mar 19 '18 at 09:43
  • There must be more you are not showing; none of that will generate a SpEL evaluation exception. – Gary Russell Mar 19 '18 at 13:20

0 Answers0