EJB3, iBatis, and CGLIB
asack Mar 9, 2006 4:22 PMHi,
I'm working on a big project that is going to be completely EJB3/JBoss based (great work guys) and I'm running into an odd problem that the Wiki/FAQ and numerous Search tries are not resolving. I'm using JBoss 4.0.3SP1-EJB3RC5, JDK1.5_06 and iBatis 2.1.7-597 (latest).
My issue is that I've had to inherit some iBatis stuff that is dying with essentially the stack trace at the end of this post. It occurs when I try to use a complex query in iBatis, i.e.:
#
# <result property="prop1" column="prop1_column" nullable="false"
# select="some_sub_query"/>
#
So I'm trying to map a field to a subquery via the "select" clause which should ultimately return a Boolean. The "some_sub_query" should return a "java.lang.Boolean" as its resultClass.
What I have found is that the cglib shipped with JBoss and/or EJB3 seems to break iBatis (it could be pilot error but my map file is most certainly valid). If I remove cglib from both default/lib and the ejb3.deployer, everything works.
I realize this is not an iBatis forum, but can someone explain to me what might be going on AND more importantly, is CGLIB required for EJB3 deployment? I removed all CGLIB jars, restarted JBoss, and EJB3 seems to still work fine but I might be living very dangerously.
Any info would come much appreciated!
-aps
15:50:58,546 INFO [STDOUT] java.lang.IllegalArgumentException: Cannot subclass final class boolean
15:50:58,546 INFO [STDOUT] at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:446)
15:50:58,546 INFO [STDOUT] at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
15:50:58,546 INFO [STDOUT] at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
15:50:58,546 INFO [STDOUT] at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
15:50:58,546 INFO [STDOUT] at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)
15:50:58,546 INFO [STDOUT] at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:660)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.mapping.result.loader.EnhancedLazyResultLoader$EnhancedLazyResultLoaderImpl.loadResult(EnhancedLazyResultLoader.java:104)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.mapping.result.loader.EnhancedLazyResultLoader.loadResult(EnhancedLazyResultLoader.java:59)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.loadResult(ResultLoader.java:53)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getNestedSelectMappingValue(BasicResultMap.java:455)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults(BasicResultMap.java:315)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:394)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:185)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:561)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:536)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:93)
15:50:58,546 INFO [STDOUT] at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:70)
...started from an EJB3 invoke on my Proxy object...