All,
I have finally got the UDDI4J SaveBusinessExample running under Windows Xp,
TomCat 4.1.30, mySQL 4.0.18 and jUDDI ver. 0.8.0.
Here is what I can pass on to anyone who will come after me:
1) My first problem was getting the Happy jUDDI Page to recognize the JNDI Datasource that I had set up. Examination of the happyjUDDI.jsp revealed that the following SQL needed to run successfully:
SELECT COUNT(*) FROM PUBLISHER;
When I looked into the mySQL database I indeed did have a PUBLISHER table and it indeed did have a single entry. However, the happyjuddi.jsp page continually failed that
test. It was not until I altered the code to print the Java Stack Dump that I discovered that jUDDI was attempting to connect to a database called JUUDI instead of one called JUDDI.
So, lesson #1 when you cannot get the happyjuddi page to recognize the JNDI Datasource that you have set up change the happyjuddi.jsp to print the Java Stack Dump in its entirety. I did this by changing the following (change is bolded):
First the original:
try
{
conn = ds.getConnection();
if (conn == null)
throw new Exception("No Connection (conn=null)");
out.print("<font color=\"green\">");
out.print("+ Got a
JDBC Connection!");
out.println("</font>");
}
catch(Exception ex)
{
out.print("<font color=\"red\">");
out.print("- DB connection was not aquired. ("+ex.getMessage()+")"); // Just provides a terse message
out.println("</font>");
}
and now the change:
try
{
conn = ds.getConnection();
if (conn == null)
throw new Exception( "No Connection (conn=null)" );
out.print( "<font color=\"green\">" );
out.print( "+ Got a JDBC Connection!" );
out.println( "</font>" );
}
catch( Exception ex )
{
out.print( "<font color=\"red\">" );
out.println( "- DB connection was not acquired!" );
out.println( ex ); // Dumps the entire Java Stack
out.println( "</font>" );
}
2) My second problem was that I was using HTTPS to connect to the 'publish' service that does not use HTTPS but rather HTTP. So, I changed the url from HTTPS to HTTP.
3) My third problem was that my PUBLISHER table was missing several key fields. The available documentation told me that I needed a table called PUBLISHER with the following three fields: publisher_id VARCHAR(25), publisher_name VARCHAR(25), admin VARCHAR(25). Indeed I did need those three fields and about eight others!
Here is the final schema for the publisher table:
PUBLISHER_ID VARCHAR(25)
PUBLISHER_NAME VARCHAR(25)
ADMIN VARCHAR(25)
LAST_NAME VARCHAR(50)
MIDDLE_INIT CHAR(1)
WORK_PHONE VARCHAR(12)
MOBILE_PHONE VARCHAR(12)
PAGER VARCHAR(12)
EMAIL_ADDRESS VARCHAR(50)
ENABLED VARCHAR(25)
4) My fourth problem was that I was missing the AUTH_TOKEN table as well:
Here is the final schema for the auth_token table:
auth_token VARCHAR(50)
publisher_id VARCHAR(25)
publisher_name VARCHAR(25)
created DATETIME
last_used DATETIME
number_of_uses INT
token_state INT
5) My fifth problem was that I was missing the BUSINESS_ENTITY table as well:
Here is the final schema for the business_entity table as well:
business_key VARCHAR(50)
authorized_name VARCHAR(50)
publisher_id VARCHAR(25)
opertor VARCHAR(25)
last_update BIGINT
6) My sixth problem was that I was missing the BUSINESS_NAME table as well:
Here is the final schema for the BUSINESS_NAME table as well:
business_key VARCHAR(50)
business_name_id VARCHAR(50)
lang_code VARCHAR(25)
name VARCHAR(50)
7) My seventh problem was that I was missing the DISCOVERY_URL table as well:
Here is the final schema for the DISCOVERY_URL table as well:
business_key VARCHAR(50)
discovery_url_id INT
use_type VARCHAR(50)
url VARCHAR(255)
8) My eigth problem was that I was missing the CONTACT table as well:
Here is the final schema for the CONTACT table as well:
business_key VARCHAR(50)
contact_id INT
use_type VARCHAR(50)
person_name VARCHAR(50)
9) My ninth problem was that I was missing the business_descr table as well:
lang_code VARCHAR(25)
descr VARCHAR(255)
business_key VARCHAR(50)
business_descr_id INT
10) My tenth problem was that I was missing the BUSINESS_SERVICE table as well:
Here is the final schema for the BUSINESS_SERVICE table
service_key VARCHAR(50)
business_key VARCHAR(50)
and then it finally worked...
