vbNewbie
vbNewbie

Reputation: 3345

spring maven dependency not recognized, library giving errors

I have a spring application I am trying to run and updated the dependencies and downloaded the jars that could not be downloaded. It compiles fine but when running the program I get an error in one of the libraries with an IOEXception.

Exception in thread "main" org.springframework.amqp.AmqpIOException: java.io.IOException
at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:71)
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:504)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:628)
at 
com.microsoft.template.pattern.producer.ProducerContainer.prepareToStart(ProducerContainer.java:164)
at com.microsoft.template.pattern.producer.ProducerContainer.startProduce(ProducerContainer.java:69)
at com.microsoft.template.pattern.producer.ProducerTemplate.run(ProducerTemplate.java:92)
at com.microsoft.transform.KafkaRabbit.main(KafkaRabbit.java:54)
Caused by: java.io.IOException
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:126)
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:122)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:144)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:390)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:957)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:907)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1066)
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:466)
... 5 more

While trying to debug this by clicking on the ProducerTemplate reference line, it shows no source code attached. What does this mean and why would I get the above error? Is the library messed up?

Upvotes: 0

Views: 209

Answers (1)

Ramu
Ramu

Reputation: 681

No source code attached means the jar file's source attachment is missing. If you are using maven with eclipse IDE, right click on the project -> Maven -> Download Sources. This will download source code for all your dependencies and attaches to the jar provided the source code for that dependency is available on the repository. If the source code is not available on the central repository and if you have the source code, then you can attach it manually by right clicking on the jar, properties-> java source attachment and add the source.

Regarding the IOException it could be happening for any reason. Difficult to say without looking at the code.

Upvotes: 1

Related Questions