I made a maven project that includes EJB, WEB and EAR modules. But I don't use hibernate in my project. So I don't add hibernate dependencies. I successfuly tested my project in JBoss 5 but when I tried to test in JBoss 4.2.3 it failed. It complains about:
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.hibernate.SessionFactory
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Also I added hibernate jars but it didn't solve the problem. I only use EJB 3.0 and write some WebService. What is your suggestion?