10 Replies Latest reply on Mar 13, 2007 10:28 AM by Peter Johnson

    Duke's Bank Example Problem

    Rishi Anand Newbie

      Hello,

      I am getting the following error while trying to run the duke's bank example on JBoss AS 4.0.5, anyone has any ideas about this?

      Thanks,

      Rishi

      2007-03-09 11:50:10,651 DEBUG [org.jboss.ejb.EjbModule] Starting failed jboss.j2ee:service=EjbModule,module=bank-ejb.jar
      org.jboss.deployment.DeploymentException: Error: can't find data source: java:/DefaultDS; - nested throwable: (javax.naming.NameNotFoundException: DefaultDS not bound)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.init(JDBCEntityBridge.java:153)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:435)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:368)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:172)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:414)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor2.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.GeneratedMethodAccessor9.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 $Proxy24.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:662)
      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.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      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 $Proxy25.start(Unknown Source)
      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.GeneratedMethodAccessor24.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 $Proxy8.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$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      Caused by: javax.naming.NameNotFoundException: DefaultDS not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.init(JDBCEntityBridge.java:149)
      ... 69 more
      2007-03-09 11:50:10,651 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:service=EjbModule,module=bank-ejb.jar
      org.jboss.deployment.DeploymentException: Error: can't find data source: java:/DefaultDS; - nested throwable: (javax.naming.NameNotFoundException: DefaultDS not bound)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.init(JDBCEntityBridge.java:153)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:435)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:368)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:172)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:414)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor2.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.GeneratedMethodAccessor9.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 $Proxy24.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:662)
      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.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      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 $Proxy25.start(Unknown Source)
      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.GeneratedMethodAccessor24.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 $Proxy8.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$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      Caused by: javax.naming.NameNotFoundException: DefaultDS not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.init(JDBCEntityBridge.java:149)
      ... 69 more
      2007-03-09 11:50:10,698 INFO [org.jboss.ejb.EJBDeployer] Deployed: fil

        • 1. Re: Duke's Bank Example Problem
          Peter Johnson Master

          You did not, by any chance, remove the hsqldb-ds.xml file from the server/xxx/deploy directory? That file declares the DefaultDS datasource.

          • 2. Re: Duke's Bank Example Problem
            Rishi Anand Newbie

            Hi Peter,

            No, I didn't - although I did modify the file according to the examples and here's what it looks like:


            <!-- =====================================================================
            -->
            -
            - <local-tx-datasource>
            <jndi-name>DefaultDS</jndi-name>
            <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
            <driver-class>org.hsqldb.jdbcDriver</driver-class>
            <user-name>sa</user-name>

            <min-pool-size>5</min-pool-size>
            <max-pool-size>20</max-pool-size>
            - <!-- The time before an unused connection is destroyed
            -->
            - <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use
            -->
            - <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections
            -->
            <idle-timeout-minutes>0</idle-timeout-minutes>
            - <!--
            Whether to check all statements are closed when the connection is returned to the pool,
            this is a debugging feature that should be turned off in production

            -->
            <track-statements />
            - <!-- Use the security domain defined in conf/login-config.xml
            -->
            <security-domain>HsqlDbRealm</security-domain>
            - <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional)
            -->
            -
            <type-mapping>Hypersonic SQL</type-mapping>

            - <!-- This mbean can be used when using in process persistent hypersonic
            -->
            jboss:service=Hypersonic,database=localDB
            </local-tx-datasource>
            - <!-- This mbean can be used when using in process persistent db
            -->
            -
            1701
            true
            default
            false
            true
            - <!-- attribute name="InProcessMode">true</attribute
            -->




            Thanks,

            Rishi

            • 3. Re: Duke's Bank Example Problem
              Peter Johnson Master

              Were there any errors when you brought up the app server? Most likely, the DefaultDS data source did not get properly deployed, but if that happened an error would show up.

              Also, when posting xml, bracket the xml source with [ code ] [ /code ] (without the spaces, of course).

              • 4. Re: Duke's Bank Example Problem
                Rishi Anand Newbie

                Peter,

                Here's what I noticed on the console while bringing up the app server:

                ObjectName: jboss.jca:service=LocalTxCM,name=DefaultDS
                State: CONFIGURED
                I Depend On:
                jboss.jca:service=ManagedConnectionPool,name=DefaultDS
                jboss.jca:service=CachedConnectionManager
                jboss.security:service=JaasSecurityManager
                jboss:service=TransactionManager
                Depends On Me:
                jboss.jca:service=DataSourceBinding,name=DefaultDS

                ObjectName: jboss.jca:service=ManagedConnectionPool,name=DefaultDS
                State: CONFIGURED
                I Depend On:
                jboss.jca:service=ManagedConnectionFactory,name=DefaultDS
                Depends On Me:
                jboss.jca:service=LocalTxCM,name=DefaultDS

                ObjectName: jboss.jca:service=ManagedConnectionFactory,name=DefaultDS
                State: CONFIGURED
                I Depend On:
                jboss:service=Hypersonic,database=localDB
                jboss.jca:service=RARDeployment,name='jboss-local-jdbc.rar'
                Depends On Me:
                jboss.jca:service=ManagedConnectionPool,name=DefaultDS

                ObjectName: jboss.jca:service=DataSourceBinding,name=DefaultDS
                State: CONFIGURED
                I Depend On:
                jboss.jca:service=LocalTxCM,name=DefaultDS
                jboss:service=invoker,type=jrmp
                Depends On Me:
                jboss.ejb:service=EJBTimerService,persistencePolicy=database
                jboss:service=KeyGeneratorFactory,type=HiLo
                jboss.mq:service=StateManager
                jboss.mq:service=PersistenceManager

                ObjectName: jboss.j2ee:service=EjbModule,module=bank-ejb.jar
                State: FAILED
                Reason: org.jboss.deployment.DeploymentException: Error: can't find data sourc
                e: java:/DefaultDS; - nested throwable: (javax.naming.NameNotFoundException: Def
                aultDS not bound)

                --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                ObjectName: jboss:service=Hypersonic,database=localDB
                State: NOTYETINSTALLED
                Depends On Me:
                jboss.jca:service=ManagedConnectionFactory,name=DefaultDS

                ObjectName: jboss.j2ee:service=EjbModule,module=bank-ejb.jar
                State: FAILED
                Reason: org.jboss.deployment.DeploymentException: Error: can't find data sourc
                e: java:/DefaultDS; - nested throwable: (javax.naming.NameNotFoundException: Def
                aultDS not bound)


                Rishi

                • 5. Re: Duke's Bank Example Problem
                  Peter Johnson Master

                  Earlier in the output there should be some stack traces.

                  • 6. Re: Duke's Bank Example Problem
                    Andrew Newbie

                    I've had the same problem with jboss 4.0.5 under ubuntu linux.
                    In this line of hsqldb-ds.xml:

                    I changed name to name="jboss:service=Hypersonic,database=localDB" and the application was deployed with no errors. (I have no idea why as i'm new to both jboss and j2ee). Anyways - it deployed, but the 'Account List' option in the app itself throws some exceptions but I haven't looked into it yet.
                    Cheers,
                    Andrew

                    • 7. Re: Duke's Bank Example Problem
                      Andrew Newbie

                      the tag i posted earlier got eaten, here it is:

                      <mbean code="org.jboss.jdbc.HypersonicDatabase" name="jboss:service=Hypersonic">


                      • 8. Re: Duke's Bank Example Problem
                        Peter Johnson Master

                        The database needs to be initialized with data for Duke's Bank, and the only way to do that is to run the database such that it opens port 1701. The ant command that initializes the data access the database via that port. If you change HSQLDB to not open port 1701 (actually, leave the hsqldb-ds.xml as is), then the database is not initialized and you will then get errors when running Duke's Bank.

                        • 9. Re: Duke's Bank Example Problem
                          Andrew Newbie

                          Thanks for the explanation Peter. I guess there is still a long way ahead of me before I really start to understend all that is going on:)

                          Andrew

                          • 10. Re: Duke's Bank Example Problem
                            Peter Johnson Master

                            Actually, if you are a Java EE beginner, it might be easier to work through the JBoss at Work book. They start you off with a simple web application that they add more and more functionality to, including database access. The only issue is that the book uses 4.0.2 and some of the stuff doesn't work on later releases, but the book is still worth having if you are just getting started. (If you do use the book, make sure you use the same versions of the software that they used.)