2

I had written a custom ejb component with schedular attached to it. In the scheduled ejb method, I am calling the RabbitMQ methods to dequeue the messages. The whole thing works with in eclipse while debugging the individual java file. but the same while build and deployed on the Wildfly server, throws the "Caused by: java.lang.NoClassDefFoundError: com/rabbitmq/client/ConnectionFactory. Seems like a classpath issue but even adding the dependent jars in the manifest file doesn't help. I am blocked with this issue. Could anyone help me on this? "

Ramanan K
  • 33
  • 6
  • you're probably missing the jar containing that class on the server. :) – toskv Aug 27 '15 at 21:08
  • I am using wildfly server and new to Java ee development. Could you please let me know on how to add the missing jars? – Ramanan K Aug 29 '15 at 17:54
  • I think this question might help: http://stackoverflow.com/questions/10088604/how-to-include-dependencies-in-war-file – toskv Aug 29 '15 at 17:57
  • Basically make sure that the jar containing RabbitMQ is in your war's WEB-INF/lib folder. – toskv Aug 29 '15 at 17:58
  • Thanks.. The ejb is bundled as a jar file and the dependent jar's are also within it. Manifest-Version: 1.0 Class-Path: rabbitmq-client.jar – Ramanan K Aug 29 '15 at 18:38
  • If you found a fix please make an answer to the question with it too. :) – toskv Aug 29 '15 at 18:39

1 Answers1

1

I converted the project to dynamic web project and added the Rabbit mq client libraries to the web-inf\lib folder. Now when I tried to deploy to the Wildfly server, its detecting the external assemblies and I am able to create the connection factory. Not sure its the right way to solve the issue.

Ramanan K
  • 33
  • 6