ClassCastException on loading admin console - library conflicts?

I’‘m currently working on a custom auth provider which does authentication by calling to a remote service using SOAP. I’'m using a set of stub classes which use Apache AXIS to make the relevant SOAP calls.

I had Wildfire working just fine until I came to install my auth provider. Apache AXIS has a bunch of dependencies, so I copied these into Wildfire’‘s lib directory so that they’'d be available on load. However, it appears that this is upsetting something since now the admin console component is failing with the following exception:

Error starting admin console: org.apache.commons.logging.impl.Jdk14Logger

Trouble initializing admin console

java.lang.ClassCastException: org.apache.commons.logging.impl.Jdk14Logger

at org.jivesoftware.wildfire.container.AdminConsolePlugin.initializePlugin(AdminCo nsolePlugin.java:158)

at org.jivesoftware.wildfire.container.PluginManager.loadPlugin(PluginManager.java :281)

at org.jivesoftware.wildfire.container.PluginManager.access$200(PluginManager.java :48)

at org.jivesoftware.wildfire.container.PluginManager$PluginMonitor.run(PluginManag er.java:658)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

at java.util.concurrent.FutureTask.runAndReset(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknow n Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

I’‘m not really familiar with the Apache Commons logging stuff, but I took a quick look at the bit of code that’‘s failing here and from what I can see the admin console is assuming that it’‘ll get a particular logger class but it’'s now getting a different one due to the differing libraries.

The extra libraries I added are:

wsdl4j-1.5.1.jar (com.ibm.wsdl)

jaxrpc.jar (javax.xml.rpc)

saaj.jar (javax.xml.soap)

commons-discovery-0.2.jar (org.apache.commons.discovery)

Also, I had originally copied the log4j JAR from AXIS into the lib directory and the error message changed to a Log4J logger instead of a JDK logger, further reinforcing my suspicions that these extra libraries are causing the log factory to return a different logger implementation and causing the admin console to crash.

After searching the forum I’‘ve found a few similar problems to this but they all seem to relate to Tomcat, and since I’‘m not using Tomcat I can’'t apply the answers.

Does anyone have any ideas?

Hi Yudeben,

does it help if you load the Wifi classes before the new ones? Maybe using “-Xbootclasspath/a:” ?

LG

Yudeben,

I created JM-622 for this issue and fixed it for the upcoming 2.6.0 release. The new logic is to check for the log impl that comes back once requested and abort the custom log logic if it’'s not the implementation we expect.

Regards,

Matt