-
1. Re: Unable to Run Example with MySQL
b0howard Dec 26, 2002 3:05 PM (in response to garymarsh)Hi Gary
I assume that your example is the template examples from
the free user doc's page.
I noticed that the
<config-property name="UserName" and
<config-property name="Password"
were not set in your mysql-service.xml file.
I configured the examples to work with mySQL 3.?? version
and I specified UserName with no password.
You might want to check the authentication parameters used to login to mySQL from the mysql.exe (windows) command line tool.
I had some different issues when changing the data source to mysql:
I changed the datasource names and mappings to not
use default names.
I had to change the .ant.properites file (the template
exampeles):
# Set the DB type mapping (Hypersonic SQL, PostgreSQL etc., see XDoclet's attribute "typemapping")
#type.mapping=Hypersonic SQL
type.mapping=mySQL
# Set the DataSource name your are going to use (java:/DefaultDS etc., see XDoclet's attribute "datasource")
# datasource.name=java:/DefaultDS
datasource.name=java:/MySqlDS
XDoclet uses these properties when building the app's
jbosscmp-jdbc.xml file.
You might need to change the .ant.properties "type.mapping" property if your using the template's build.xml file.
Check the jbosscmp-jdbc.xml file in the ejb-test.jar
in the JBoss deployment directory "your_jboss_path/server/default/deploy"
to see what exactly is being generated.
It should look something like this:
<jbosscmp-jdbc>
your_datasource_name
<datasource-mapping>mySQL</datasource-mapping>
your mapping might still be "Hypersonic SQL" which might also be causing the problem.
Cheer's
Bruce -
2. Re: Unable to Run Example with MySQL
garymarsh Dec 29, 2002 7:06 PM (in response to garymarsh)Actually Bruce, I was trying to run the cmp2 Ganster program. I modified the jbosscmp-jdbc.xml file found in the cmp2/src/resources/ejb-jar/META-INF directory. The ant build.xml file doesn't address the database directly only the jbosscmp-jdbc.xml file.
again I modified the values found in defaults datasource and datasource-mapping from
java:/DefaultDS
<datasource-mapping>Hypersonic SQL</datasource-mapping>
to
java:/MySqlDS
<datasource-mapping>mySQL</datasource-mapping>
Do you have any perls of wisdom on this example program?
Thanks,
Gary -
3. Re: Unable to Run Example with MySQL
garymarsh Dec 30, 2002 12:32 AM (in response to garymarsh)Bruce, I found two bugs, one in the cmp2 examples jbosscmp-jdbc.xml and the other is in the creation of the JMS_MESSAGES table.
The jbosscmp-jdbc.xml contains the following :
<ejb-name>OrganizationEJB</ejb-name>
<table-name>organization</table-name>
<cmp-field>
<field-name>name</field-name>
<column-name>name</column-name>
</cmp-field>
<cmp-field>
<field-name>description</field-name>
<column-name>desc</column-name>
<not-null/>
</cmp-field>
The word "desc" is reserved in MySQL and when JAWS trys to create the table it blows up.
The second error occurs when the "JMS_MESSAGES" table is created by JBoss. JAWS generated the following SQL script:
CREATE TABLE JMS_MESSAGES ( MESSAGEID INTEGER NOT NULL, DESTINATION VARCHAR(50) NOT NULL, TXID INTEGER, TXOP CHAR(1), MESSAGEBLOB OBJECT, PRIMARY KEY (MESSAGEID, DESTINATION) )
The problem is that there is no "OBJECT" type in MySQL. If you substitue "BLOB" for "OBJECT" and execute the above SQL script by hand the table is created and everything works.
Gary