We have been getting this aweful exception ever since we upgrade our JVM to Java 6.
We are using Tomcat 5.5.23, and Redhat 4.5.
The exception that occurs when our Spring/Hibernate based webapp starts up is:
Code:
ChannelException: failed loading class: java.lang.ClassNotFoundException: [Lorg.jgroups.Address;
at org.jgroups.conf.ClassConfigurator.init(ClassConfigurator.java:94)
at org.jgroups.conf.ClassConfigurator.getInstance(ClassConfigurator.java:114)
at org.jgroups.stack.ProtocolStack.<init>(ProtocolStack.java:51)
at org.jgroups.JChannel.<init>(JChannel.java:205)
at org.jgroups.JChannel.<init>(JChannel.java:185)
at org.jgroups.blocks.NotificationBus.<init>(NotificationBus.java:62)
at com.opensymphony.oscache.plugins.clustersupport.JavaGroupsBroadcastingListener.initialize(JavaGroupsBroadcastingListener.java:113)
at com.opensymphony.oscache.base.AbstractCacheAdministrator.configureStandardListeners(AbstractCacheAdministrator.java:328)
at com.opensymphony.oscache.general.GeneralCacheAdministrator.createCache(GeneralCacheAdministrator.java:305)
at com.opensymphony.oscache.general.GeneralCacheAdministrator.<init>(GeneralCacheAdministrator.java:99)
at com.opensymphony.oscache.general.GeneralCacheAdministrator.<init>(GeneralCacheAdministrator.java:90)
at com.opensymphony.oscache.hibernate.OSCacheProvider.start(OSCacheProvider.java:112)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
"[Lorg.jgroups.Address;" is the string representation of an Array of org.jgroups.Address objects.
The problem is, jgroups 2.2.8 is trying to use loadClass to get the Class representing an array of Address objects, which works fine in Java 5, but Java 6's ClassLoader.loadClass(String className) does not support loading an object Array this way.
The solution is to upgrade your jgroups-2.2.8.jar to jgroups 2.4.1 or newer (which is also available for maven)
I hope this post saves you tons of time if you run into this problem.
Peace