Juddi simple installation

xiaoxiao2021-03-06  57

Source: http://xio.mblogger.cn

Juddi, Judy, is a Java that serves WebServices UDDI implementation open source packages.

1 installation

1.1 download download address: http://ws.apache.org/juddi/releases.html

The latest version of Juddi is 0.9RC3 (Release Candidate # 3 for Version 0.9), but there are some bugs in this release.

Juddi0.9 release should not be a long time, you can refer to the following paragraph, is VIENS Stephen (Juddi's main developer) said in the mail list: Weide Closed 40 Issues Since January 1, 2005. WE 'll be releasing a 0.9rc4 as soon as axis 1.2 final is released and then limited a 0.9 final a few weeks after this. (MARCH 22, 2005)

1.2 Database Install UDDI The UDDI needs to have a place to store registered data, so you first select a relational database installation. Juddi can use any support of the ANSI Standard SQL relational database (such as MySQL, DB2, Sybase, JDATASTORE, etc.). This example uses mysql.

After the database installation is complete, Juddi-0.9RC3 / SQL / MySQL / CREATE_DATABASE.SQL, JUDDI-0.9RC3 / SQL / MySQL / INSERT_PUBLISHERS.SQL are run in the mysql database. The database is ready to complete.

1.3 Installing Juddi and Configuration First copy the Juddi folder under Juddi-0.9RC3 / WebApp to WebAPPs under Tomcat and use MySQL-Connector-Java-3.1.7 / MySQL-Connector-Java-3.1.7-bin. JAR is copied to Tomcat 5.0 / WebApps / Juddi / Web-INF / LIB.

Below is the connection to the database, add: Join in the Host Element of Tomcat / Conf / Server.xml:

SUFFIX = ". txt" TimeStamp = "true" />

factory

Org.apache.commons.dbcp.basicDataSourceFactory

Configure your mysqld max_connections large enough to handle

All of Your DB Connections. Set to 0 for no limit. ->

maxactive 100

Set to 0 for no limit. ->

Maxidle 30

maxwait 10000

username root

Password ****

driverclassname

com.mysql.jdbc.driver

The autoreconnect = true argument to the url makess sure what the the URL MAKES SURE THAT

MM.MYSQL JDBC Driver Will Automatically Reconnect IF MySQLD CLOSED THE

Connection. mysqld by Default Closes iDle Connections After 8 Hours.

Database URL connection configuration

->

URL

jdbc: mysql: //host.domain.com: 3306 / juddi? AutoreConnect = true

ValidationQuery

Select count (*) from Publisher

1.4 Local installation check Access http://127.0.0.1:8080/juddi/happyjuddi.jsp page, this page checks the correctness of the package and configuration necessary for Juddi, and tests whether the database connection is successful. If there is no red text, that is, the local installation is successful, you can make services such as WebServices.

2 test instance

The above installation is a UDDI server side, and the application of the client to find the client is developed with Juddi, UDDI4J and other packages. We can use Juddi's own test code to learn from the client.

2.1 Test using UDDI4J using UDDI4J as the client.

Code location: Juddi-0.9RC3 / SRC / UDDI4J / ORG / APACHE / JUDDI / UDDI4J

Newly established a project and introduce this code, then make the necessary modifications to the code, mainly the package name and configuration. Introduce the necessary bags, such as: junit.jar, uddi4j.jar, juddi.jar, soap.jar, etc. (because there are many codes in the European code database, there are many packages, do not know which other must be :).

Then the database is initialized, you need to insert a Publisher, SQL statement that add other Publisher, SQL statement: INSERT INTO PUBLISHER ('Juddi', 'Juddi User', 'True', 'True') ;

After debugging the code, run Testall test, you might find a lot of testing, some are some of the test code errors, and it is possible to be a defect of Juddi-0.9RC3 (Juddi-0.9RC3 is not a formal release).

The following is listed in some possible modifications for the failure of this test case test:

2.1.1 Uploading the configuration file When you have access to Samples.prop my solution is to create a new configuration file location, in the project directory: conf / samples.prop.

Code in the configurator.load () method can be modified like this:

Properties config = new profment ();

Try {

Config.Load (New Java.io.fileInputStream ("./ Conf / Samples.prop");

}

Catch (Exception E) {

System.out.Println ("Error Loading Samples Property File / N" E);

}

There are a lot of solutions, you can think about it.

2.1.2 TransportClassName Configuration Errors If there is such a report in the error message, this error may be:

ORG.XML.SAX.SAXPARSEEXCEPTION: ELEMENT OR Attribute DO NOT MATCH QNAME PRODUCTION: QNAME :: = (ncname ':')? NcName.

In the default configuration in the current test instance code, TransportClassName defines org.uddi4j.Transport.uddi4j.Transport.ApachesoAptransport, and the package we use is axis.jar, so you need to modify the corresponding class, the code is modified as follows: # -------------------------------------------------- ---------------------

# Transport classname. Typically Defined on CommandLine As

# -Dorg.uddi4j.transportClassName = xxx.

# ------------------------------------------------- ----------------------

# TransportClassName = Org.uddi4j.Transport.ApachesoAptransport

TransportClassName = Org.uddi4j.Transport.Apacheaxistransport

# TransportClassName = Org.uddi4j.transport.hpsoaptransport

2.1.3 TestFindBusiness case does not have case matching tests in TestFindBusiness, but in the case of cases in Juddi-0.9RC3, the casesensitiveMatch has bugs, so you can comment on the test case that matches the case match.

2.1.4 PublisherManager's code error When testing test_save_tmodel_TestAuthTokenExpired (), when we test expiration verification, when the error matched, the test failed, if you capture this match, you will find that the type of error is E_AUTHTOKENREQUIRED instead of the expected E_AUTHTOKENEXPIRED.

This is because the authtoken we have is empty, in the root source is in the PublisherManager. GetExpiredAuthToken (String, String) method, code:

RegistryProxy Proxy = new registryProxy ();

The configuration of the Example of Proxy is empty. Therefore, we modify this method to become:

/ **

* Changed by XIO

* @PARAM PUBLISHER STRING

* @Param Password String

* @Param TestProps Properties: Increased parameters, incoming basic configuration

* @Return String

* /

Public Static String getExpiredAuthToken (String Publisher, String Password,

Properties Testprops {

Properties PROPS = New Properties ();

Props.SetProperty (RegistryProxy.Admin_endpoint_property_name,

TestProps.getProperty ("adminURL");

Props.SETPROPERTY (RegistryProxy.INQUIRY_ENDPOINT_PROPERTY_NAME,

TestProps.getProperty ("InquiryURL"));

Props.SetProperty (registryProxy.publish_endpoint_property_name, testprops.getproperty ("publishurl");

RegistryProxy Proxy = New RegistryProxy (PrOPS);

Authtoken token = NULL;

Authinfo Authinfo = NULL;

String Ret = NULL;

Try {

Token = proxy.getauthtoken (Publisher, Password);

Authinfo = token.getAuthinfo ();

RET = Authinfo.getValue ();

System.out.println ("getExpiredAuthtoken:" authinfo);

Proxy.discardAuthtoken (Authinfo);

}

Catch (Exception EX) {

EX.PrintStackTrace ();

}

Return Ret;

}

2.2 Using Juddi Test In the code included in Juddi-0.9RC3, there is no client's use instance, although the test code of the entire project code is included, it is estimated that there is no one likes to learn the learning clients used here.

Of course, the instance of learning is still there, in the current engineering code of CVS, there is a Samples folder, this part of the code is a very complete instance (there are several classes that are not completed, but do not affect :).

CVS server data: http://ws.apache.org/juddi/cvs.html

WinCVS is available online to download.

Others: While performing code learning, it is recommended to read the WebServices related information documentation. Strongly recommended reading: Understand the WSDL series of the UDDI registration center (http://www-900.ibm.com/developerworks/cn/webservices/ws-uwsdl/part1/)

Reference:

http://wiki.apache.org/ws/juddi_how-tos

http://ws.apache.org/juddi/lists.html

Author: xio@qq.com Source: http: //xio.mblogger.cn

转载请注明原文地址:https://www.9cbs.com/read-40664.html

New Post(0)