Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1085051

Summary: [GSS] (6.4.0) customized CMP Mapper can not be used without changing the cmp module to add custom dependencies
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: wfink
Component: EJBAssignee: David M. Lloyd <david.lloyd>
Status: CLOSED CURRENTRELEASE QA Contact: Jan Martiska <jmartisk>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.2CC: jawilson, kkhan, sdouglas
Target Milestone: DR1   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1144032 (view as bug list) Environment:
Last Closed: 2019-08-19 12:38:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1144032    
Attachments:
Description Flags
Reproducer Project
none
Deployable EAR
none
Module none

Description wfink 2014-04-07 16:55:31 UTC
Created attachment 883698 [details]
Reproducer Project

Description of problem:
With the EJB2 CMP engine it is possible to use customized Mapper to transform the custom class to a SQL type.
This is done by adding a user-type-mapping to the jbosscmp-jdbc.xml deployment descriptor.
The Mapper implementation must be available for the CMP subsystem at runtime.


At the moment it is neither possible to add the mapper to the applicaition nor add as a global module. In both cases the deploy will throw an Exception

18:49:22,563 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.subunit."EJB2examples-cmp-fieldMapper-ear.ear"."ejb.jar".component.MapperCMPEntity.jdbc.store-manager.INIT: org.jboss.msc.service.StartException in service jboss.deployment.subunit."EJB2examples-cmp-fieldMapper-ear.ear"."ejb.jar".component.MapperCMPEntity.jdbc.store-manager.INIT: JBAS010784: Failed to start JDBCStore
	at org.jboss.as.cmp.jdbc.JdbcStoreManagerInitService.start(JdbcStoreManagerInitService.java:46)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
Caused by: java.lang.RuntimeException: JBAS010793: Could not create mapper: de.wfink.ejb2.examples.cmp.mapper.SimpleEnumDbMapper
	at org.jboss.as.cmp.jdbc.JDBCTypeFactory.createTypeSimple(JDBCTypeFactory.java:476)
	at org.jboss.as.cmp.jdbc.JDBCTypeFactory.getJDBCType(JDBCTypeFactory.java:412)
	at org.jboss.as.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.<init>(JDBCAbstractCMPFieldBridge.java:89)
	at org.jboss.as.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.<init>(JDBCCMP2xFieldBridge.java:72)
	at org.jboss.as.cmp.jdbc.bridge.JDBCEntityBridge.createCMPField(JDBCEntityBridge.java:926)
	at org.jboss.as.cmp.jdbc.bridge.JDBCEntityBridge.loadCMPFields(JDBCEntityBridge.java:801)
	at org.jboss.as.cmp.jdbc.bridge.JDBCEntityBridge.init(JDBCEntityBridge.java:150)
	at org.jboss.as.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:167)
	at org.jboss.as.cmp.jdbc.JdbcStoreManagerInitService.start(JdbcStoreManagerInitService.java:44)
	... 5 more
Caused by: java.lang.ClassNotFoundException: de.wfink.ejb2.examples.cmp.mapper.SimpleEnumDbMapper from [Module "org.jboss.as.cmp:main" from local module loader @fc2a074 (finder: local module finder @32b427c1 (roots: /srv/eap/6.2.2/cmp/modules,/srv/eap/6.2.2/cmp/modules/system/layers/base/.overlays/layer-base-jboss-eap-6.2.2.CP,/srv/eap/6.2.2/cmp/modules/system/layers/base))]
	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final-redhat-1]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final-redhat-1]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final-redhat-1]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final-redhat-1]
	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final-redhat-1]
	at org.jboss.as.cmp.jdbc.JDBCTypeFactory.createTypeSimple(JDBCTypeFactory.java:465)
	... 13 more


Version-Release number of selected component (if applicable):


How reproducible:
Find a reproducer project attached, look to the README for details

Expected Result:
If the class is defined in the a deployment descriptor it should be using the deployments class loader to load the class.

Comment 1 wfink 2014-04-07 16:56:19 UTC
Created attachment 883699 [details]
Deployable EAR

Comment 2 wfink 2014-04-07 16:56:56 UTC
Created attachment 883700 [details]
Module

Comment 4 wfink 2014-05-30 13:09:39 UTC
Is there any update on this as the customer is waiting for an update?

Comment 6 Jan Martiska 2014-09-18 08:33:37 UTC
Verified in EAP 6.4.0.DR1.1.