0

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you so much for your response. I tried that and it seems that the repo I downloaded the library from is the issue or just the library is messed up. It still shows the 'source attachment does not contain the source for the file, ProducerTemplate.class'. I will keep your suggestion as a possible answer if no one else responds. Thanks
Can you post the dependency URL and if possible, sample reproducible code?
The repo url is internal so could not share but I did resolve. Restarted spring IDE tried downloading the source again and debugged. The main issue was the properties file that was missing a rabbitmq property that the library required. Thanks for your assistance though.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.