1 Reply Latest reply on Nov 23, 2008 2:36 AM by jaikiran pai

    "No Classloader Found" During JBoss-Hibernate Deployment

    Chris Walters Newbie

      I am getting a "No Classloader Found" exception during the deployment of my Hibernate Application on a JBOSS server. I have provided the full stack trace along with the relevant Hibernate cinfiguration and mapping files below. Any help you can provide would be GREATLY appreciated as I have been stuck on this problem for several days now. Thanks

      JBOSS Server Version
      JBOSS 4.2.3

      Hibernate version:
      Hibernate 3.2.4.sp1

      Name and version of the database you are using:
      MySQL Server 5.0

      Hibernate Mapping File: GMStore.hbm.xml

      <?xml version="1.0"?>
      <!DOCTYPE hibernate-mapping PUBLIC
       "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
       "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
      
      <hibernate-mapping>
       <class name="com.clarksonville.gm.data.GMStore" table="GM_STORE">
       <id name="id" column="store_id">
       <generator class="native"/>
       </id>
       <property name="storeName" column="STORE_NAME"/>
       <property name="storeLocation" column="STORE_LOCATION"/>
       </class>
      </hibernate-mapping>


      EAR File Configuration - jboss-app.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-app>
       <loader-repoitory>
       com.clarksonville.gm.data:loader=GGGoMobile.ear
       </loader-repoitory>
       <module>
       <service>META-INF/hibernate-service.xml</service>
       </module>
      </jboss-app>
      

      Hibernate JMX Configuration - hibernate-service.xml
      <?xml version="1.0" encoding="utf-8"?>
      <server>
       <!-- ==================================================================== -->
       <!-- GGGoMobile Hibernate JMX Service -->
       <!-- ==================================================================== -->
      
       <mbean code="org.jboss.hibernate.jmx.Hibernate"
       name="jboss.gggomobile:name=GGGoMobileSessionFactory">
       <attribute name="DatasourceName">java:/GGGoMobileDS</attribute>
       <attribute name="Dialect">
       org.hibernate.dialect.MySQLDialect
       </attribute>
       <attribute name="SessionFactoryName">
       java:/hibernate/GGGoMobileSessionFactory
       </attribute>
       <attribute name="CacheProviderClass">
       org.hibernate.cache.HashtableCacheProvider
       </attribute>
       <attribute name="ShowSqlEnabled">true</attribute>
       <attribute name="ScanForMappingsEnabled">true</attribute>
       </mbean>
      </server>


      Hibernate Mapping File
      <?xml version="1.0"?>
      <!DOCTYPE hibernate-mapping PUBLIC
       "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
       "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
      
      <hibernate-mapping>
       <class name="com.clarksonville.gm.data.GMStore" table="GM_STORE">
       <id name="id" column="store_id">
       <generator class="native"/>
       </id>
       <property name="storeName" column="STORE_NAME"/>
       <property name="storeLocation" column="STORE_LOCATION"/>
       </class>
      </hibernate-mapping>


      Full stack trace of any exception that occurs:
      2008-11-20 23:54:01,292 INFO [org.hibernate.cfg.HbmBinder] Mapping class: com.clarksonville.gm.data.GMStore -> GM_STORE
      2008-11-20 23:54:01,761 DEBUG [org.jboss.hibernate.jmx.Hibernate] Starting failed jboss.gggomobile:name=GGGoMobileSessionFactory
      org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\JBoss\App Server\jboss-4.2.3.GA\server\default\tmp\deploy\tmp43128GGGoMobile.ear-contents\GGGoMobilePrototype-exp.war\WEB-INF\classes\com\clarksonville\gm\data\GMStore.hbm.xml
       at org.hibernate.cfg.Configuration.addFile(Configuration.java:319)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:662)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.jboss.hibernate.jmx.Hibernate.handleMappings(Hibernate.java:335)
       at org.jboss.hibernate.jmx.Hibernate.buildConfiguration(Hibernate.java:208)
       at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:228)
       at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:155)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      Caused by: org.hibernate.MappingException: class com.clarksonville.gm.data.GMStore not found while looking for property: id
       at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:74)
       at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
       at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:401)
       at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:334)
       at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
       at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
       at org.hibernate.cfg.Configuration.add(Configuration.java:669)
       at org.hibernate.cfg.Configuration.addFile(Configuration.java:309)
       ... 57 more
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.clarksonville.gm.data.GMStore
       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:252)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:169)
       at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
       at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:70)
       ... 64 more
      2008-11-20 23:54:01,761 WARN [org.jboss.system.ServiceController] Problem starting service jboss.gggomobile:name=GGGoMobileSessionFactory
      org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\JBoss\App Server\jboss-4.2.3.GA\server\default\tmp\deploy\tmp43128GGGoMobile.ear-contents\GGGoMobilePrototype-exp.war\WEB-INF\classes\com\clarksonville\gm\data\GMStore.hbm.xml
       at org.hibernate.cfg.Configuration.addFile(Configuration.java:319)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:662)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:659)
       at org.jboss.hibernate.jmx.Hibernate.handleMappings(Hibernate.java:335)
       at org.jboss.hibernate.jmx.Hibernate.buildConfiguration(Hibernate.java:208)
       at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:228)
       at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:155)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      Caused by: org.hibernate.MappingException: class com.clarksonville.gm.data.GMStore not found while looking for property: id
       at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:74)
       at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
       at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:401)
       at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:334)
       at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
       at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
       at org.hibernate.cfg.Configuration.add(Configuration.java:669)
       at org.hibernate.cfg.Configuration.addFile(Configuration.java:309)
       ... 57 more
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.clarksonville.gm.data.GMStore
       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:252)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:169)
       at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
       at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:70)
       ... 64 more
      2008-11-20 23:54:02,308 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: hibernate-service.xml