Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

component class not found - but where should it be?

 
Arnie Morein
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an old WAR app that used a ContextListener to initialize Hibernate and stored the SessionFactory in the Session context. Now I'm trying to get JBoss and the HAR deployer to create the SessionFactory and put it in JNDI. I've created the configuration files to get the DataSource mapped to the service correctly. The problem appears when the HAR deployer is scanning the classes and attempting to build the SessionFactory. Its not finding what it calls a Component Class.

The database in question is already in production. The PKs are normal, multi-field Keys, not a single integer field. In my case, MyEclipse generated the following files:

Mapping File


[bold]and the following Class Files:[/bold]



As you can see, the PK is listed as a composite-key:



I've got the .class and .hbm.xml files bundled into a HAR file and the deployer sees it, deploys everything and starts mapping classes w/o issue. Then...

16:16:22,734 INFO [EARDeployer] Init J2EE application: file:/C:/Dev/jboss405ga/server/default/deploy/PortalRegistration.ear/
16:16:23,000 INFO [Configuration] Searching for mapping documents in jar: tmp29012appsec.har
16:16:23,000 INFO [Configuration] Found mapping document in jar: CodeAddressType.hbm.xml
16:16:23,296 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeAddressType -> code_address_type
16:16:23,328 INFO [Configuration] Found mapping document in jar: CodeAgency.hbm.xml
16:16:23,359 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeAgency -> code_agency
16:16:23,359 INFO [Configuration] Found mapping document in jar: CodeBusinessUnit.hbm.xml
16:16:23,375 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeBusinessUnit -> code_business_unit
16:16:23,390 INFO [Configuration] Found mapping document in jar: CodeDeptDivision.hbm.xml
16:16:23,406 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeDeptDivision -> code_dept_division
16:16:23,406 INFO [Configuration] Found mapping document in jar: CodeEdirOu.hbm.xml
16:16:23,437 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeEdirOu -> code_edir_ou
16:16:23,437 INFO [Configuration] Found mapping document in jar: CodeExternalApplication.hbm.xml
16:16:23,453 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeExternalApplication -> code_external_application
16:16:23,453 INFO [Configuration] Found mapping document in jar: CodeLogEventType.hbm.xml
16:16:23,468 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeLogEventType -> code_log_event_type
16:16:23,468 INFO [Configuration] Found mapping document in jar: CodeMotdType.hbm.xml
16:16:23,484 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeMotdType -> code_motd_type
16:16:23,484 INFO [Configuration] Found mapping document in jar: CodeNextId.hbm.xml
16:16:23,515 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeNextId -> code_next_id
16:16:23,515 INFO [Configuration] Found mapping document in jar: CodeOwnerType.hbm.xml
16:16:23,531 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeOwnerType -> code_owner_type
16:16:23,531 INFO [Configuration] Found mapping document in jar: CodePhoneType.hbm.xml
16:16:23,546 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodePhoneType -> code_phone_type
16:16:23,546 INFO [Configuration] Found mapping document in jar: CodeProvisionStatus.hbm.xml
16:16:23,562 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeProvisionStatus -> code_provision_status
16:16:23,562 INFO [Configuration] Found mapping document in jar: CodeRequestResult.hbm.xml
16:16:23,578 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeRequestResult -> code_request_result
16:16:23,578 INFO [Configuration] Found mapping document in jar: CodeRequestStatus.hbm.xml
16:16:23,593 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeRequestStatus -> code_request_status
16:16:23,593 INFO [Configuration] Found mapping document in jar: CodeRole.hbm.xml
16:16:23,625 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeRole -> code_role
16:16:23,625 INFO [Configuration] Found mapping document in jar: CodeRoleDept.hbm.xml
16:16:23,656 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeRoleDept -> code_role_dept
16:16:23,656 INFO [Configuration] Found mapping document in jar: CodeRoleType.hbm.xml
16:16:23,687 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeRoleType -> code_role_type
16:16:23,687 INFO [Configuration] Found mapping document in jar: CodeTreeviewNode.hbm.xml
16:16:23,718 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeTreeviewNode -> code_treeview_node
16:16:23,718 INFO [Configuration] Found mapping document in jar: InfoAccessRequest.hbm.xml
16:16:23,718 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoAccessRequest -> info_access_request
16:16:23,734 INFO [Configuration] Found mapping document in jar: InfoAccessRequest2.hbm.xml
16:16:23,734 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoAccessRequest2 -> info_access_request
16:16:23,734 INFO [Configuration] Found mapping document in jar: InfoAccessRequestLog.hbm.xml
16:16:23,750 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoAccessRequestLog -> info_access_request_log
16:16:23,750 INFO [Configuration] Found mapping document in jar: InfoCompanyContact.hbm.xml
16:16:23,765 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoCompanyContact -> info_company_contact
16:16:23,765 INFO [Configuration] Found mapping document in jar: InfoDelegateAdministrator.hbm.xml
16:16:23,781 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoDelegateAdministrator -> info_delegate_administrator
16:16:23,796 INFO [Configuration] Found mapping document in jar: InfoExternalProvisionStatus.hbm.xml
16:16:23,796 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoExternalProvisionStatus -> info_external_provision_status
16:16:23,796 INFO [Configuration] Found mapping document in jar: InfoLogUser.hbm.xml
16:16:23,812 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoLogUser -> info_log_user
16:16:23,812 INFO [Configuration] Found mapping document in jar: InfoPhone.hbm.xml
16:16:23,828 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoPhone -> info_phone
16:16:23,828 INFO [Configuration] Found mapping document in jar: InfoPortalMotd.hbm.xml
16:16:23,843 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoPortalMotd -> info_portal_motd
16:16:23,843 INFO [Configuration] Found mapping document in jar: InfoPublicAddress.hbm.xml
16:16:23,875 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoPublicAddress -> info_public_address
16:16:23,875 INFO [Configuration] Found mapping document in jar: InfoPublicCompany.hbm.xml
16:16:23,875 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoPublicCompany -> info_public_company
16:16:23,890 INFO [Configuration] Found mapping document in jar: InfoRoleAdministrator.hbm.xml
16:16:23,890 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoRoleAdministrator -> info_role_administrator
16:16:23,890 INFO [Configuration] Found mapping document in jar: InfoRoleAppResource.hbm.xml
16:16:23,906 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoRoleAppResource -> info_role_app_resource
16:16:23,906 INFO [Configuration] Found mapping document in jar: InfoRoleMember.hbm.xml
16:16:23,921 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoRoleMember -> info_role_member
16:16:23,921 INFO [Configuration] Found mapping document in jar: InfoRoleReport.hbm.xml
16:16:23,937 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoRoleReport -> info_role_report
16:16:23,937 INFO [Configuration] Found mapping document in jar: InfoUser.hbm.xml
16:16:23,953 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoUser -> info_user
16:16:23,953 INFO [Configuration] Found mapping document in jar: InfoUserLog.hbm.xml
16:16:23,968 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoUserLog -> info_user_log
16:16:23,968 INFO [Configuration] Found mapping document in jar: Messages.hbm.xml
16:16:23,984 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.Messages -> messages
16:16:23,984 INFO [Configuration] Found mapping document in jar: SysParameter.hbm.xml
16:16:23,984 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.SysParameter -> sys_parameter
16:16:24,000 INFO [Configuration] Found mapping document in jar: SysPrevValues.hbm.xml
16:16:24,015 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.SysPrevValues -> sys_prev_values
16:16:24,015 INFO [Configuration] Found mapping document in jar: SysSearchCriteria.hbm.xml
16:16:24,015 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.SysSearchCriteria -> sys_search_criteria
16:16:24,250 WARN [ServiceController] Problem starting service jboss.jca:service=HbmSessFacDevApplicationSecurity
org.hibernate.MappingException: component class not found: us.tx.state.oag.ApplicationSecurity.db.CodeDeptDivisionId
at org.hibernate.mapping.Component.getComponentClass(Component.java:104)
at org.hibernate.tuple.component.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:130)
at org.hibernate.tuple.component.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:43)
at org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:38)
at org.hibernate.tuple.component.ComponentEntityModeToTuplizerMapping.<init>(ComponentEntityModeToTuplizerMapping.java:52)
at org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:50)
at org.hibernate.mapping.Component.buildType(Component.java:152)
at org.hibernate.mapping.Component.getType(Component.java:145)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
at org.hibernate.mapping.RootClass.validate(RootClass.java:193)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1026)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:231)
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.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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:302)
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.GeneratedMethodAccessor52.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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 $Proxy7.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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 $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:490)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: us.tx.state.oag.ApplicationSecurity.db.CodeDeptDivisionId
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
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:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
at org.hibernate.mapping.Component.getComponentClass(Component.java:101)
... 106 more


Which I just don't get. What could be wrong? The HAR file contains both .class files and the mapping file. Now, the .war/WEB-INF/classes/.../db folder has the same .class files. Don't they have to be there so the application classes can use them? Or can they find the ones deployed via the HAR?
 
Arnie Morein
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DOH!

I posted the CodeBusinessUnit java code instead of CodeDeptDivision, but you get the idea...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic