The type org.springframework.context.ApplicationContextAware cannot be resolved. This indirectly refers to the required .class files

Compiling the following code gives this error:

The type org.springframework.context.ApplicationContextAware cannot be resolved. This indirectly refers to the required .class files (this error is for the last line of code)

I think I should add the .jar file to the build path, but I don't know what it is?

CamelContext context = new DefaultCamelContext(); ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_BROKER_URL); context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory)); 
+6
source share
1 answer

You need to add Spring Framework

 org.springframework.context-3.xxjar 

to the path of creating the project. Depending on which third-party library you are using, there may be additional Spring dependencies, and you will have to add these Spring jars. Most likely you will need org.springframework.core-3.xxjar .

See the documentation for your direct dependencies to find out what its dependencies are.

+11
source

Source: https://habr.com/ru/post/953852/


All Articles