You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@juddi.apache.org by CocoyLola <mb...@ibit.org> on 2010/02/10 10:30:19 UTC
Help with juddi java client getting authentication token
Hello! I have some problemes geting a valid Authentication Token with java
cliente.
I'm using juddi cliente juddi 2.0rc6.jar
This is the test code i have just implemented.
Can anyone tell me how to load juddi.properties to use its properties??
Thank you so much. I w8 your replies.
cheers!
import java.util.Properties;
import org.apache.juddi.IRegistry;
import org.apache.juddi.datatype.request.AuthInfo;
import org.apache.juddi.datatype.response.AuthToken;
import org.apache.juddi.registry.proxy.RegistryProxy;
public class Test2 {
public static void main(String[] args){
Properties props = new Properties();
props.setProperty("juddi.proxy.adminURL","http://localhost:8080/juddi/admin");
props.setProperty("juddi.proxy.publishURL","http://localhost:8080/juddi/publish");
props.setProperty("juddi.proxy.securityProvider","com.sun.net.ssl.internal.ssl.Provider");
props.setProperty("juddi.proxy.protocolHandler","com.sun.net.ssl.internal.www.protocol");
IRegistry registry = new RegistryProxy(props);
try{
System.out.println(registry.getAuthToken("sviens","password"));
AuthToken authToken =
registry.getAuthToken("sviens","password");
AuthInfo authInfo = authToken.getAuthInfo();
System.out.println("AuthToken: "+ authInfo.getValue());
}catch (Exception e){
e.getStackTrace();
}
}
}
org.apache.axis2.AxisFault: Connection refused: connect
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:364)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:208)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:548)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
at
org.apache.juddi.registry.proxy.Axis2Transport.send(Axis2Transport.java:79)
at
org.apache.juddi.registry.proxy.RegistryProxy.execute(RegistryProxy.java:368)
at
org.apache.juddi.AbstractRegistry.getAuthToken(AbstractRegistry.java:344)
at Test2.main(Test2.java:24)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)
... 13 more
--
View this message in context: http://old.nabble.com/Help-with-juddi-java-client-getting-authentication-token-tp27527106p27527106.html
Sent from the jUDDI - User mailing list archive at Nabble.com.