4 Replies Latest reply on May 13, 2002 4:54 AM by jonlees

    jaws.xml datasource

      Hi,

      When starting up JBoss (2.4.4) with a new entity bean, I am getting a deployment exception - 'MyJawsDS not bound' (MyJawsDS is unique to the datasource reference in my jaws.xml). I am already able to query the database referenced by this datasource successfully using JDBC. Once JBoss has got the datasource name from jaws.xml, what does it do / where does it go that causes the not bound exception ?

      Hoping for a breakthrough :)

      Thanks,
      Neil

        • 1. Re: jaws.xml datasource
          rgjawanda

          A datasource is defined in the jboss.jcml file
          This is located in the jboss\conf\default (I think) directory (search for it)
          You define a datasource in that file.
          Your Entity bean jaws.xml file references that datasource
          mydatasource

          In jboss.jcml you will setup mydatasource to point to the database of joice. It also has login tags, userid tages for the database that you are going to use with your EJB.

          Ron

          • 2. Re: jaws.xml datasource

            Thanks Ron. I've tried having the datasource as mydatasource and as java:/mydatasource, and I already have the following mbean in jboss.jcml (which does the trick for my JDBC call) ...


            org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
            mydatasource
            jdbc:sybase:Tds:localhost:2638?ServiceName=stb
            dba
            sql


            Whichever of those I use, I get the same exception

            [17:03:21,040,ContainerFactory] DeploymentError
            org.jboss.deployment.DeploymentException: mydatasource not bound
            at org.jboss.ejb.plugins.jaws.metadata.JawsApplicationMetaData.init(JawsApplicationMetaData.java:154)
            at org.jboss.ejb.plugins.jaws.metadata.JawsXmlFileLoader.load(JawsXmlFileLoader.java:77)
            at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommandFactory.(JDBCCommandFactory.java:133)
            at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.init(JAWSPersistenceManager.java:83)
            at org.jboss.ejb.plugins.CMPPersistenceManager.init(CMPPersistenceManager.java:110)
            at org.jboss.ejb.EntityContainer.init(EntityContainer.java:292)
            at org.jboss.ejb.Application.init(Application.java:202)
            at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:372)
            at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:306)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.deployment.J2eeDeployer.startModules(J2eeDeployer.java:487)
            at org.jboss.deployment.J2eeDeployer.startApplication(J2eeDeployer.java:459)
            at org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:190)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:395)
            at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
            at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.java:371)
            at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:967)
            at $Proxy0.start(Unknown Source)
            at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
            at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
            at org.jboss.Main.(Main.java:208)
            at org.jboss.Main$1.run(Main.java:110)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.jboss.Main.main(Main.java:106)
            [17:03:21,090,BaseLocalContainerInvoker] Cleared method maps
            [17:03:21,090,JRMPContainerInvoker] Cleared method maps
            [17:03:21,090,J2eeDeployer] Starting HotelEJB.jar failed!


            If I change the datasource in jaws.xml to MyJawsDS (just to identify which 'datasource' it is having trouble with), the exception names MyJawsDS. So I guess I really want to know where JBoss uses the name in jaws.xml (and what for), so I can find out where the synch (or otherwise) problem really is. Am I barking up the wrong tree ?

            Neil

            • 3. Re: jaws.xml datasource
              jonlees

              Neil,

              It's probably no help to you, but I have exactly the same problem, albeit my datasource name is different "OracleDS", but otherwise the error messages are the same. If/when you find a fix, I'd be grateful if you'd let me know....! And likewise of course...

              • 4. Re: jaws.xml datasource
                jonlees

                OK I found the fix. I added the type-mapping tag to my Jaws.xml file in my deployed project. The unbound error is now history.

                However, in my example 4 "Cabin" bean, I still get the data storing into the Hypersonic database instead of my OracleDS database!! If anyone can help....


                OracleDS
                <type-mapping>Oracle8</type-mapping>
                true