You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@juddi.apache.org by Jonathan D Wilson <jd...@ecs.soton.ac.uk> on 2003/07/01 03:16:10 UTC

Re: [juddi-Users] Problems with Juddi/Uddi4j (unable to return a good connection, slack=50)

I have the problem sorted now. It seems that tomcat didn't search the 
class path and I got the Driver classname wrong in the server.xml.
Thanks.

Jonathan D Wilson wrote:
> I am running a simple lookup on Juddi to find services (it is taken from 
> the examples see below)...
> 
> However, I don't seem to be able to get the two to work together. Also 
> using the Sun JAXR I get errors (although that complains about a missing 
> Class file) it is again for a fault!
> 
> 
> 30-Jun-2003 11:24:55 com.sun.xml.registry.common.util.CastorUtil$2 run
> SEVERE: java.lang.ClassNotFoundException: 
> com.sun.xml.registry.uddi.bindingsv2.Fault
> java.lang.ClassCastException
>     at 
> com.sun.xml.registry.common.util.CastorUtil.unmarshalObject(Unknown Source)
>     at com.sun.xml.registry.uddi.Processor.processResponse(Unknown Source)
>     at com.sun.xml.registry.uddi.Processor.processRequest(Unknown Source)
>     at com.sun.xml.registry.uddi.UDDIMapper.findOrganizations(Unknown 
> Source)
>     at 
> com.sun.xml.registry.uddi.BusinessQueryManagerImpl.findOrganizations(Unknown 
> Source)
>     at Registry.main(Registry.java:44)
> 
> With the UDDI4J I get...
> 
> TransportFactory: Using transport 
> name:org.uddi4j.transport.ApacheSOAPTransport
> 
> Request body:
> <find_business generic="2.0" maxRows="5" 
> xmlns="urn:uddi-org:api_v2"><findQualifiers><findQualifier>caseSensitiveMatch</findQualifier></findQualifiers><name>S</name></find_business> 
> 
> 
> Response body:
> <Fault><faultactor/><faultcode/><faultstring>unable to return a good 
> connection, slack=50</faultstring></Fault>
> unable to return a good connection, slack=50
>     at org.uddi4j.UDDIElement.<init>(Unknown Source)
>     at org.uddi4j.response.BusinessList.<init>(Unknown Source)
>     at org.uddi4j.client.UDDIProxy.find_business(Unknown Source)
>     at Uddi4j.run(Uddi4j.java:99)
>     at Uddi4j.main(Uddi4j.java:41)
> 
> Juddi claims that it is happy, (happyjuddi) but neither of these piece 
> of code work. I have not published any services, but I would expect this 
> to just come back with an empty result set. Does anyone know what could 
> be wrong here??? I can provide any more details you require. I have been 
> struggling with this for a few days now.
> 
> I can login to the uddi database using "mysql -u juddi -password= 
> 'juddi'" fine and the publish and inquire links both seem to work. I 
> have deployed this under Tomcat 4.1.24.
> 
> Many thanks in advace.
> 
> Jon Wilson
> 
> /*
>  * The source code contained herein is licensed under the IBM Public 
> License
>  * Version 1.0, which has been approved by the Open Source Initiative.
>  * Copyright (C) 2001, International Business Machines Corporation
>  * Copyright (C) 2001, Hewlett-Packard Company
>  * All Rights Reserved.
>  *
>  */
> 
> import java.util.Properties;
> import java.util.Vector;
> import org.uddi4j.UDDIException;
> import org.uddi4j.client.UDDIProxy;
> import org.uddi4j.datatype.Name;
> import org.uddi4j.response.BusinessInfo;
> import org.uddi4j.response.BusinessList;
> import org.uddi4j.response.DispositionReport;
> import org.uddi4j.response.Result;
> import org.uddi4j.transport.TransportFactory;
> import org.uddi4j.util.FindQualifier;
> import org.uddi4j.util.FindQualifiers;
> 
> /**
>  * Sample code that exercises the Enquiry API. Attempts
>  * to find a business by name.
>  *
>  * <OL>
>  * <LI>Sets up a UDDIProxy object
>  * <LI>Finds businesses by name.
>  * </OL>
>  *
>  * @author David Melgar (dmelgar@us.ibm.com)
>  * @author Rajesh Sumra (rajesh_sumra@hp.com)
>  */
> 
> public class Uddi4j{
>     Properties config = null;
>     public static void main (String args[]){
>         Uddi4j app = new Uddi4j();
>         System.out.println("\n*********** Running FindBusinessExample 
> ***********");
>         app.run();
>         System.exit(0);
>     }
> 
>     public Properties getProperties(){
>         Properties config = new Properties();
>             try {
>                 config.load(new 
> java.io.FileInputStream("/home/jdw100/.eclipse/RPC/src/samples.prop"));
>             } catch (Exception e) {
>                 System.out.println("Error loading samples property 
> file\n" + e);
>             }
> 
>           // Configure UDDI4J system properties. Normally set on 
> commandline or elsewhere
>           // SOAP transport being used
>             if (System.getProperty(TransportFactory.PROPERTY_NAME)==null) {
>                 System.setProperty(TransportFactory.PROPERTY_NAME, 
> config.getProperty("TransportClassName"));
>             }
>           // Logging
>             if (System.getProperty("org.uddi4j.logEnabled")==null) {
>                 System.setProperty("org.uddi4j.logEnabled", 
> config.getProperty("logEnabled"));
>             }
> 
>           // Configure JSSE support
>             try {
>                 System.setProperty("java.protocol.handler.pkgs", 
> config.getProperty("handlerPackageName"));
> 
>                 // Dynamically loads security provider based on 
> properties. Typically configured in JRE
>                 java.security.Security.addProvider((java.security.Provider)
>                 
> Class.forName(config.getProperty("securityClassName")).newInstance());
>             } catch (Exception e) {
>                 System.out.println("Error configuring JSSE provider. 
> Make sure JSSE is in classpath.\n" + e);
>             }
>             return config;
>         }
>     public void run(){
>         // Load samples configuration
>         config = getProperties();
> 
>         // Construct a UDDIProxy object.
>         UDDIProxy proxy = new UDDIProxy();
> 
>         try{
>             // Select the desired UDDI server node
>             proxy.setInquiryURL(config.getProperty("inquiryURL"));
>             proxy.setPublishURL(config.getProperty("publishURL"));
> 
>             //creating vector of Name Object
>             Vector names = new Vector();
>             names.add(new Name("S"));
> 
>             // Setting FindQualifiers to 'caseSensitiveMatch'
>             FindQualifiers findQualifiers = new FindQualifiers();
>             Vector qualifier = new Vector();
>             qualifier.add(new FindQualifier("caseSensitiveMatch"));
>             findQualifiers.setFindQualifierVector(qualifier);
> 
>             // Find businesses by name
>             // And setting the maximum rows to be returned as 5.
>             BusinessList businessList = proxy.find_business(names, null, 
> null, null,null,findQualifiers,5);
> 
>             Vector businessInfoVector  = 
> businessList.getBusinessInfos().getBusinessInfoVector();
>             for( int i = 0; i < businessInfoVector.size(); i++ ){
>                 BusinessInfo businessInfo = 
> (BusinessInfo)businessInfoVector.elementAt(i);
> 
>                 // Print name for each business
>                 System.out.println(businessInfo.getDefaultNameString());
>             }           
>         }catch( UDDIException e ){
>             DispositionReport dr = e.getDispositionReport();
>             if( dr!=null ){
>                 System.out.println("UDDIException faultCode:" + 
> e.getFaultCode() +"\n operator:" + dr.getOperator() +"\n generic:"  + 
> dr.getGeneric() );
>                 Vector results = dr.getResultVector();
>                 for( int i=0; i<results.size(); i++ ){
>                     Result r = (Result)results.elementAt(i);
>                     System.out.println("\n errno:"    + r.getErrno() );
>                     if( r.getErrInfo()!=null ){
>                         System.out.println("\n errCode:"  + 
> r.getErrInfo().getErrCode() +"\n errInfoText:" + r.getErrInfo().getText());
>                     }
>                 }
>             }
>             e.printStackTrace();           
>         }catch( Exception e ){
>             e.printStackTrace();
>         }
>     }
> }
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
> _______________________________________________
> juddi-users mailing list
> juddi-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/juddi-users