Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The type org.springframework.context.ApplicationContextAware cannot be resolved. It is indirectly referenced from required .class files

Compiling the following code yields this error:

The type org.springframework.context.ApplicationContextAware cannot be resolved. It is indirectly referenced from required .class files (this error is for last line of code)

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

CamelContext context = new DefaultCamelContext(); 
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_BROKER_URL);
context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
like image 479
Mohammad Parsa Avatar asked Sep 15 '13 10:09

Mohammad Parsa


1 Answers

You need to add Spring Framework's

org.springframework.context-3.x.x.jar

to your project's build path. Depending on which third party library you're using it may have additional Spring dependencies and you would have to add those Spring jars too. You'd most likely need org.springframework.core-3.x.x.jar too.

Consult your direct dependencies' documentation to find out what its dependencies are.

like image 105
Ravi K Thapliyal Avatar answered Sep 21 '22 13:09

Ravi K Thapliyal