Help: Full source for connecting to MySQL under JBoss!?!


EJB programming & troubleshooting: Help: Full source for connecting to MySQL under JBoss!?!

  1. Hi,
    I have problems connecting to a MySQL server, from JBoss.

    As far as I have seen, I'm not the only one with this problem.

    I have downloaded the mm.mysql-2.0.10, unpackt it to the right dir, and Ibelive that I have made the right changes to jboss.jcml..

    Would anyone please share the full source to make the connection, in the bean, and the XML-files + maybe the source from 'jboss.jcml'.

    Looking forward to some help :)

    Thanks in advance,
    Martin Hansen
  2. In all previous versions it was:

      <!-- ==================================================================== -->
      <!-- JDBC -->
      <!-- ==================================================================== -->

      <mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider">
        <attribute name="Drivers"></attribute>

      <mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=mysql">
        <attribute name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</attribute>
       <attribute name="PoolName">website</attribute>
       <attribute name="URL">jdbc:mysql://localhost/test</attribute>
       <attribute name="JDBCUser">jgibbons</attribute>
       <attribute name="Password">apassword</attribute>
       <attribute name="MaxSize">20</attribute>

    But I just tried this with the latest JBoss and failed. But that could be something to do with user permissions in MySQL. I have yet to investigate.

    For EJB and Strut code generation visit:

  3. I have tried to use MySQL with JBoss. For some reason my CMP 1.1 EJB's throws exception Find failed.
    I have MM.MySQL 2.0.7, MySQL 3.23.38-nt, JBoss 2.4.3

    However the same bean worked with MySQL on WebLogic 6.1.

    Please let me know if you have managed it.

    smike at apollo dot lv

    [CarmichaelSessionBean] TRANSACTION ROLLBACK EXCEPTION:null
    Embedded Exception
    Find failed; nested exception is:
            javax.ejb.EJBException: null
    Embedded Exception
    Find failed
    [CarmichaelSessionBean] javax.ejb.FinderException: Find failed
    [CarmichaelSessionBean] at org.jboss.ejb.plugins.jaws.jd

    <mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=DefaultDS">
        <attribute name="PoolName">DefaultDS</attribute>
        <attribute name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</attribute>
        <attribute name="URL">jdbc:mysql://localhost/JBossCMP</attribute>
        <attribute name="JDBCUser">root</attribute>
        <attribute name="Password">dbsx34</attribute>