aspose file tools*
The moose likes Web Services and the fly likes publishing to a registry Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "publishing to a registry" Watch "publishing to a registry" New topic
Author

publishing to a registry

kishani liyanage
Ranch Hand

Joined: Dec 08, 2003
Posts: 40
*I tried to run the samples provided with the "UDDI4j API" i was able to sun the "FindBusinessExample" , but when tried to publish a services using the "SaveBusinessExample" i encountered the following exception.(i compiled the the code by inserting the userid and password)
can somebody give me the reason and a solution to this problem
*Pls tell me whether i have to use jsse here.
The exception is this

C:\uddi4j\samples>java SaveBusinessExample
Get authtoken
[SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: javax.net.s
sl.SSLHandshakeException: untrusted server cert chain; targetException=java.lang
.IllegalArgumentException: Error opening socket: javax.net.ssl.SSLHandshakeExcep
tion: untrusted server cert chain]
at org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
tion.java:354)
at org.apache.soap.messaging.Message.send(Message.java:123)
at com.ibm.uddi.client.UDDIProxy.send(UDDIProxy.java:1217)
at com.ibm.uddi.client.UDDIProxy.send(UDDIProxy.java:1187)
at com.ibm.uddi.client.UDDIProxy.get_authToken(UDDIProxy.java:907)
at SaveBusinessExample.run(SaveBusinessExample.java:91)
at SaveBusinessExample.main(SaveBusinessExample.java:52)
C:\uddi4j\samples>
John Meloro
Ranch Hand

Joined: Dec 05, 2003
Posts: 37
I am experiencing the exact same problem as described above.
Can anyone shed any light on this?
I am using the example program that ships with UDDI4J to publish to a JUDDI Registry.
Thanks,
John M.
John Meloro
Ranch Hand

Joined: Dec 05, 2003
Posts: 37
Well,
At least I have a partial solution...
The error "Error Opening Socket" was caused in my case because jUDDI was not accepting connections over SSL.
When I changed the 'publish' URL from HTTPS to HTTP it cleared up that problem.
John Meloro
Ranch Hand

Joined: Dec 05, 2003
Posts: 37
More good news
I discovered this when I was looking through the log files:
SELECT PUBLISHER_NAME, LAST_NAME, FIRST_NAME, MIDDLE_INIT, WORK_PHONE, MOBILE_PHONE, PAGER, EMAIL_ADDRESS, ADMIN, ENABLED
FROM PUBLISHER
WHERE PUBLISHER_ID='juddi'
When I created the table in mySQL I only knew about PUBLISHER_NAME, PUBLISHER_ID and ADMIN.
I think this could be the source of my current problem!
John Meloro
Ranch Hand

Joined: Dec 05, 2003
Posts: 37
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...
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Glad that you got it working
Have you considered helping the UDDI4J project by submitting these findings to their bug tracking system?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: publishing to a registry
 
Similar Threads
Getting exception need help
NullPointerException in running UDDI4J samples!
SSLException: untrusted server cert chain
Problems with axis and tomcat4.0
Soap Error in WebServices