10 Replies Latest reply on Aug 8, 2002 3:21 PM by Chris Mactaggart


    alskdjfa Newbie

      Hello folks

      I would like to make my CMP beans connect with a mysql datasource. I set up the mysql datasource like in the example in /docs/examples/jca/mysql-service.xml and the datasource works fine.

      I only need to know what is the <type-mapping> to use in jaws.xml to make that work. I tried mysql, MySQL, MySql,mySql and I get a datasource-mapping not found during deployment.

      What is the datasource-mapping I should use?


        • 1. Re: OracleDS not bound
          alskdjfa Newbie

          I have tried all the options but failed,I will be thankful to you if you could answer this
          1)Can jboss3 be configured with Oracle9i
          If so can you send be the appropriate form of oracle-service.xml file ,classes12.jar I can get ......
          I have been configuring the three mbeans which have been specified by the docs but get the Null pointer exception in the console refeerring to Launcher failure.......Also the classes 12.jar are placed in the jboss/lib not in the ext of jdk1.3
          regads vicky

          • 2. Re: datasource-mapping
            Tung Dang Novice

            which version of JBoss do you use? Since JBoss 3.0, Jboss ignores the jaws.xml and use jbosscmp-jdbc.xml for mapping information.

            • 3. Re: datasource-mapping
              alskdjfa Newbie

              Thanks for your attention tdang. I use jboss 3

              I did not knew jboss only use jbosscmp-jdbc.xml and not jaws.xml. But anyway I modified <datasource-mapping>Hypersonic SQL</datasource-mapping> to datasource-mapping>mySQL</datasource-mapping> in both files and I know jboss is "aware" that I am trying to load a different jdbc mapping than Hypersonic, the problem is that he does not know what mapping "mySQL" means.

              So my initial question remain unanswered :( : what is the name of the jdbc mapping for mysql? What should I write between datasource tags in the jbosscmp-jdbc.xml?

              Thx in advance

              • 4. Re: datasource-mapping
                Ben Wong Newbie

                The CMP 2.0 documentation explains a lot of stuff - especially the tags in jbosscmp-jdbc.xml. Buy it if you haven't already.


                • 5. Re: datasource-mapping
                  Ed Brown Newbie

                  Buying documentation when you want to do an eval of the product seems counterproductive to the cause of JBoss.

                  I've found the JBoss3.0 process very disheartening.

                  • 6. Re: datasource-mapping
                    alskdjfa Newbie

                    " Buy the doc if you haven't already "

                    Here are the comments I found at flashline about this doc:
                    -"I ripped the $10 cmr chapter up and placed it in the trash can."
                    -"What a waste of money."
                    -"I was expecting a LOT more content when they were refering to to sections of the documentation as chapters."

                    In my opinion, it's all right to sell documentation to finance an open source project, as long as:
                    1-It is always possible to find an alternative, free source of information (maybe of lower quality, but still covering all the topics of the project)
                    2-The $$$ documentation should be of a higher quality

                    When I learn an open source tool, I usually read free online documents. But then, once I am familiar with the tool, I buy one or two good books as references. I dont think the existence of free documentation kills the market of $$documentation.

                    Refusing to give basic information and replying "Buy the doc" make me less confortable in the jboss community than in jakarta.apache or freebsd community.

                    I am very enthousiastic about jboss, but I also found the learning process (what's more, I have to learn EJB, JNDI, RMI, CMP/CMR 2, Java transact. API and JAAS at the same time) very difficult .. At the point that we almost dropped jboss for jrun last week because of the lack of documentation. But I am working VERY hard since 2 week (means more than 100 hours a week = ALL the day+night) to learn jboss and to make it a part of our corporate solutions (I work for Bell Canada, we are developing web services for cisco IP phones). It will be a breakthrough for the open source in our department.

                    So my initial question remain unanswered: what is the name of the jdbc mapping for mysql? What should I write between datasource tags in the jbosscmp-jdbc.xml?

                    • 7. Re: datasource-mapping
                      Jason Essington Newbie


                      a quick peek at standardjbosscmp-jdbc.xml and standardjaws.xml shows that the type mapping for mySQL is defined by the word mySQL in both files.

                      good luck


                      • 8. Re: datasource-mapping
                        alskdjfa Newbie

                        thx Essington, i am now able to connect and load a jdbcmapping. But when deploying an application (the cmp2 example provided by jboss), the deployer creates the first table (gangster) successfuly (I can also see with mysql utility that the table is setup correctly), but then when trying to create the second table, mysql thows errors to jboss:'Error while creating table ...'...

                        My hypothesis is that because jboss creates tables of type MyISAM (from what I have seen when I inspected the table gangster create by the deployer). Wouldn't be better to make the deployer create INNO DB tables? Would that settle the 'Error while creating table' error in your opinion? I looked in standardjbosscmp-jdbc.xml, but I found no 'create table' patterns defined.

                        What do you think of that? Does one of you run a successful jboss-mysql environment?

                        Thank you in advance for your assistance.

                        Ps: more details about the error thrown:
                        org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable: (java.sql.SQLException: Syntax error or access violation: You have an error in your SQL syntax near 'desc VARCHAR(255) BINARY NOT NULL, the_boss INTEGER, CONSTRAINT pk_organization ' at line 1

                        Ps2: I know it is not an access violation: the datasource is logged as root in mysql

                        • 9. Re: datasource-mapping
                          Ed Brown Newbie

                          Would you please post the mysql-service.xml file that you used to get your code running?I've looked at the examples and I am confident my jboss.xml, ejb-jar.xml, and jbosscmp-jdbc.xml files are correct.When I deploy my ejb, I get MySQL not bound errors.Thank you.

                          • 10. Re: datasource-mapping
                            Chris Mactaggart Newbie

                            I came across the same problem when I tried to run with postgresql. What I ended up doing was inside jbosscmp-jdbc.xml on line 29 where the 'description' field is mapped to 'desc' column name for OrganizationEJB, I changed 'desc' to 'descr' because I am guessing the 'desc' is a reserved word (ex. 'ORDER BY name DESC')