2 Replies Latest reply on Dec 28, 2004 12:28 PM by abcolson

    BUG: Bean Deployment Exception

    abcolson Newbie

      When deploying a bean I get the following exception in the log. It looks like a deployment bug and does not give me a hint on what is wrong (if anything) with my setup or .ear.

      I am using JBoss 4.0.0RC2 with MS Access.

      Debugging hints would be appreciated.

      Thanks
      Tony


      2004-12-21 09:59:10,265 ERROR [org.jboss.ejb.EntityContainer] Starting failed jboss.j2ee:jndiName=ejb/FaqLocal,service=EJB
      java.lang.StringIndexOutOfBoundsException: String index out of range: 0

      at java.lang.String.charAt(String.java:444)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCFunctionMappingMetaData.initFromString(JDBCFunctionMappingMetaData.java:44)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCFunctionMappingMetaData.<init>(JDBCFunctionMappingMetaData.java:29)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCTypeMappingMetaData.<init>(JDBCTypeMappingMetaData.java:181)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init>(JDBCApplicationMetaData.java:243)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:67)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:726)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:419)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:363)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:157)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:340)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
      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:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:848)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:373)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy65.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:394)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
      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:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:848)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:373)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy20.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:605)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:927)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
      at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:463)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)


        • 1. Re: BUG: Bean Deployment Exception
          Alexey Loubyansky Master

          There is a bad SQL function template in type-mapping you are using in jbosscmp-jdbc.xml.

          • 2. Re: BUG: Bean Deployment Exception
            abcolson Newbie

            Hi Alex,

            Yes, I downloaded the source and tracked it down to a SQL problem but it looks fine. In my test servlet I only use the User ejb (although I have defined a few others, one of which has a relation with User).

            Here is the relevant data:

            Stack Trace:

            java.lang.IllegalStateException: createBeanClassInstanceCommand == null
            at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:570)
            at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:124)
            at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:224)
            at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:146)
            at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:96)
            at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
            at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
            at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:129)
            at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:106)
            at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
            at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
            at org.jboss.ejb.Container.invoke(Container.java:881)
            at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:342)
            at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
            at $Proxy112.findAll(Unknown Source)


            The ejb-jar.xml entry is

            <query>
             <query-method>
             <method-name>findAll</method-name>
             <method-params>
             </method-params>
             </query-method>
             <ejb-ql>![CDATA[SELECT DISTINCT OBJECT(t) FROM User t]]</ejb-ql>
             </query>
            

            (The defined attributes match exactly the field definitions, all text and a long int for the primary key).

            The jbosscmp-jdbc.xml file includes

            <entity>
             <ejb-name>User</ejb-name>
             <create-table>true</create-table>
             <remove-table>true</remove-table>
             <read-only>false</read-only>
             <pk-constraint>true</pk-constraint>
             <table-name>user</table-name>
            
             <cmp-field>
             <field-name>id</field-name>
             <column-name>id</column-name>
            
             </cmp-field>
             <cmp-field>
             <field-name>firstName</field-name>
             <column-name>firstName</column-name>
            
             </cmp-field>
             <cmp-field>
             <field-name>lastName</field-name>
             <column-name>lastName</column-name>
            
             </cmp-field>
             <cmp-field>
             <field-name>email</field-name>
             <column-name>email</column-name>
            
             </cmp-field>
             <cmp-field>
             <field-name>phone</field-name>
             <column-name>phone</column-name>
            
             </cmp-field>
             <cmp-field>
             <field-name>tieline</field-name>
             <column-name>tieline</column-name>
            
             </cmp-field>
             <cmp-field>
             <field-name>password</field-name>
             <column-name>password</column-name>
            
             </cmp-field>
             <cmp-field>
             <field-name>title</field-name>
             <column-name>title</column-name>
            
             </cmp-field>
             <cmp-field>
             <field-name>loginName</field-name>
             <column-name>loginName</column-name>
            
             </cmp-field>
            
             </entity>
            


            Additionally, I turned on trace logging and get the following:

            2004-12-28 08:57:23,125 TRACE [org.jboss.ejb.plugins.LogInterceptor] Start method=findAll
            2004-12-28 08:57:23,125 TRACE [org.jboss.ejb.plugins.TxInterceptorCMT] Current transaction in MI is null2004-12-28 08:57:23,125 TRACE [org.jboss.ejb.plugins.TxInterceptorCMT] TX_REQUIRED for findAll timeout=0
            2004-12-28 08:57:23,125 TRACE [org.jboss.ejb.plugins.TxInterceptorCMT] Thread came in with tx null
            2004-12-28 08:57:23,125 TRACE [org.jboss.ejb.plugins.TxInterceptorCMT] Starting new tx TransactionImpl:XidImpl[FormatId=257, GlobalId=LJ301825/5, BranchQual=, localId=5]
            2004-12-28 08:57:23,125 TRACE [org.jboss.ejb.plugins.EntityInstancePool] Get instance org.jboss.ejb.plugins.EntityInstancePool@af8b32#0#class epi.cmp.UserCMP
            2004-12-28 08:57:23,125 TRACE [org.jboss.ejb.plugins.TxInterceptorCMT] TxInterceptorCMT: In finally
            2004-12-28 08:57:23,125 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException in method: public abstract java.util.Collection epi.cmp.UserLocalHome.findAll() throws javax.ejb.FinderException:
            java.lang.IllegalStateException: createBeanClassInstanceCommand == null
            at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:570)
            at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:124)
            at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:224)
            at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:146)
            at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:96)
            at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
            at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
            at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:129)
            at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:106)
            at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
            at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
            at org.jboss.ejb.Container.invoke(Container.java:881)
            at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:342)
            at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
            at $Proxy130.findAll(Unknown Source)
            at EJBServlet.doGet(Unknown Source)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:122)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
            at java.lang.Thread.run(Thread.java:534)
            2004-12-28 08:57:23,125 TRACE [org.jboss.ejb.plugins.LogInterceptor] End method=findAll


            (I italicized and bolded the things which I don't understand yet)

            I had thought I would get a translation of the sql being passed to the database but I didn't. Perhaps that means that the problem is before/during the generation (translation) of the sql.

            Thanks Alex,
            Tony