4 Replies Latest reply on Feb 13, 2016 3:38 AM by Alberto Moreno

    No ClassLoaders found when deploying on Windows

    Mike Burton Newbie
      Hi Folks,

      I'm getting a strange problem when I deploy my app on Windows (XP or 2k3)

      Here's the server.log output when it deploys successfully on Mac or Linux:

      15:22:33,664 INFO  [EARDeployer] Init J2EE application: file:/usr/local/jboss-4.2.2.GA/server/default/deploy/gar01.ear
      15:22:35,484 INFO  [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.entity.PersistenceUnitDeployment
      15:22:35,485 INFO  [JmxKernelAbstraction] installing MBean: persistence.units:ear=gar01.ear,unitName=gar01 with dependencies:
      15:22:35,485 INFO  [JmxKernelAbstraction]      jboss.jca:name=gar01Datasource,service=DataSourceBinding
      15:22:35,486 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=gar01.ear,unitName=gar01
      15:22:35,488 INFO  [Ejb3Configuration] Processing PersistenceUnitInfo [
           name: gar01
           ...]
      15:22:35,504 INFO  [Ejb3Configuration] found EJB3 Entity bean: ws.myco.gar.Client
      15:22:35,605 INFO  [Configuration] Reading mappings from resource : META-INF/orm.xml
      15:22:35,605 INFO  [Ejb3Configuration] [PersistenceUnit: gar01] no META-INF/orm.xml found
      15:22:35,607 INFO  [AnnotationBinder] Binding entity from annotated class: ws.myco.gar.Client
      15:22:35,607 INFO  [EntityBinder] Bind entity ws.myco.gar.Client on table Client

      But when I try to deploy it on Windows the log output is like this:
      2010-03-18 15:16:41,755 INFO  [org.jboss.deployment.EARDeployer] Init J2EE application: file:/C:/Program Files/jboss-4.2.2.GA/server/default/deploy/gar01.ear
      2010-03-18 15:16:53,724 INFO  [org.jboss.ejb3.JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.entity.PersistenceUnitDeployment
      2010-03-18 15:16:53,724 INFO  [org.jboss.ejb3.JmxKernelAbstraction] installing MBean: persistence.units:ear=gar01.ear,unitName=gar01 with dependencies:
      2010-03-18 15:16:53,724 INFO  [org.jboss.ejb3.JmxKernelAbstraction]      jboss.jca:name=gar01Datasource,service=DataSourceBinding
      2010-03-18 15:16:53,724 INFO  [org.jboss.ejb3.entity.PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=gar01.ear,unitName=gar01
      2010-03-18 15:16:53,740 INFO  [org.hibernate.ejb.Ejb3Configuration] Processing PersistenceUnitInfo [
           name: gar01
           ...]
      2010-03-18 15:16:53,740 INFO  [org.hibernate.ejb.Ejb3Configuration] found EJB3 Entity bean: ws.myco.gar.Client
      2010-03-18 15:16:53,849 WARN  [org.jboss.system.ServiceController] Problem starting service persistence.units:ear=gar01.ear,unitName=gar01
      javax.persistence.PersistenceException: [PersistenceUnit: gar01] class or package not found
           at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1089)
           at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:886)
           at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:772)
           at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:407)
           at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
           at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
      .......
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: ws.myco.gar.Client
           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:251)
           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Class.java:242)
           at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:112)
           at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1005)
           at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1077)
           ... 104 more

      Then later when I run the app it fails because the session bean it accesses is null.

      Curiously, older versions of the app deploy OK on both platforms, I can't see what I've changed that would cause this problem.

      Any ideas please?

      Best Regards

      Mike Burton