You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@juddi.apache.org by Al Caponi <do...@yahoo.com.sg> on 2002/02/26 03:28:01 UTC

[jUDDI-users] [juddi 0.5.0] Object marshalling of tags with empty text contents

Hi all,
I've got a simple application (using UDDI4J) to test the jUDDI 0.5.0 server.

I've been playing  around with jUDDI and I found out that if I make a
save_business call and I pass in an empty String as the business
description, jUDDI complains that there is a fault in the request.

Error message follows (line numbers may not match):
op : businessEntity : java.lang.reflect.InvocationTargetException
op : save_business : java.lang.reflect.InvocationTargetException
org.juddi.base.UDDIException: can't instantiate "save_business" in lookup
table
        at
org.juddi.base.UDDIXMLHandlerMaker.createInst(UDDIXMLHandlerMaker.java:174)
        at
org.juddi.base.UDDIXMLManager.createObject(UDDIXMLManager.java:42)
        at org.juddi.soap.Response.<init>(Response.java:70)
        at
org.juddi.soap.server.http.JUDDIListenerServlet.doPost(JUDDIListenerServlet.
java:93)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
        at org.apache.tomcat.core.Handler.service(Handler.java:287)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:80
6)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
        at java.lang.Thread.run(Thread.java:484)

Digging into the codes, I've found that the 'fault' comes from
org.juddi.base.Description.marshall().
When Xerces is reading the empty description tag
(<description></description>), it does not return an empty String but it
returns null.
Subsequently, the Description object created is null and this causes a
NullPointerExceptioin when putting it into a the BusinessEntity's
descriptions hashtable.

Now, my questions are:
1. Is it correct for Xerces to return a null value instead of an empty
String? (I guess this question would fit more on some apache mailing list
but my thinking is that jUDDI ppl will understand the situation better)
2. Assuming Xerces is designed to return a null value in such case,
shouldn't jUDDI do the empty String verification (or is this left to the
client)?
3. marshall methods in other classes like org.juddi.base.DiscoveryURL do not
check for empty String either. Wouldn't these cause any exception? (I
haven't experimented such situation yet though)

Thanks for bothering abt me :)
Regards,
Al


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




[jUDDI-users] Logic error in JDBCDataSource?

Posted by Al Caponi <do...@yahoo.com.sg>.
Hi all,
In JDBCDataSource find methods e.g. findBusiness(String sqlQuery, int
maxRow)

<snippet>
  private UDDIResponse findBusiness (String sqlQuery, int maxRow) throws
UDDIException {
    BusinessListResponse response = new BusinessListResponse();
    int currow = 0;
    try {
        // sqlQuery is the statement to conduct our criteria search by
        ResultSet entities = JDBCUtility.executeQuery(sqlQuery);
        while (entities.next()) {
          if (maxRow != 0 && currow < maxRow) { // <======= LOGIC ERROR!
...
...
</snippet>

If the client never specified a max_rows value, the default maxRow value
of -1 would cause jUDDI to return zero record all the time.

Shouldn't it be something like this?

<snippet>
  private UDDIResponse findBusiness (String sqlQuery, int maxRow) throws
UDDIException {
    BusinessListResponse response = new BusinessListResponse();
    int currow = 0;
    try {
        // sqlQuery is the statement to conduct our criteria search by
        ResultSet entities = JDBCUtility.executeQuery(sqlQuery);
        while (entities.next()) {
          if ((maxRow == -1 && !entities.isAfterLast())|| (maxRow != 0 &&
currow < maxRow)) { // <==== CHANGED!
...
...
</snippet>

Being aware that there's a complete rewriting, is this going to change?

Regards,
Al


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com