0 Replies Latest reply on Sep 22, 2005 4:37 PM by u9707118

    EJB's looking at hypersonic database instead of mysql

    u9707118 Newbie

      This is a very strange problem...I have worked with JBOSS and Oracle many times without problem. However, now I am trying my hand at JBOSS and mySQL with some puzzling results.

      I have successfully created a Datasource that connects to mySQL and I have a class that performs JDBC queries (this class connects to this mySQL datasource -- see code below).

      System.out.println("Loading underlying JDBC driver.");
      try {
      } catch (ClassNotFoundException e) {
      final InitialContext context = new InitialContext();
      dataSource = (DataSource)context.lookup ("java:/BBIMDB")

      However the EJB's seem to be pointing at a different database (I guess hypersonic) because when I call a findByPrimaryKey() method on a bean with a row I know exists, it can't find it (NotFoundException). And when I create an entity bean - it works without error, however it is nowhere to be seen in the mySQL database!

      I have created a mySQL datasource (mysql-ds.xml) as follows:
      <?xml version="1.0" encoding="UTF-8"?>

      With my EJB's, I deploy the following jbosscmp-jdbc.xml file:
      <?xml version='1.0' encoding='windows-1252'?>

      and the following jboss.xml file
      <?xml version = '1.0' encoding = 'windows-1252'?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">

      Please can somebody help? I am at a loss :(
      I am using jboss-4.0.1sp1 on winXP with mySQL 4.1 and connectorj 3.1.10