Hi Chainerit,
Glad you got that to work :).
1. As a rule, it is better to open a new thread (subject) for a new problem.
2. And usually it is also it is better to only bring up one problem at
the time :)
3. That said, on your client you should only be using the
juddi-client.jar and the uddi-ws.jar, right now you seem to
be using the persistence classes (any classes in org.apache.juddi.model)
from the juddi-core.jar.
4. Our mailing lists are listed here:
http://juddi.apache.org/mail-lists.html. You can find the current thread
here:
http://mail-archives.apache.org/mod_mbox/juddi-user/201103.mbox/browser
If you still have an issue I did not address then please start another
thread for that.
Good luck!
--Kurt
On 3/28/11 6:07 AM, chainerlt wrote:
Hi Kurt,
thank you for your previous reply. Somehow I think I was trying the same
steps before, but they didn't work well. However now I'm able to
successfully set up my juddi in tomcat bundle for 'XMLDocAuthenticator' or
'CryptedXMLDocAuthenticator' authentications. Everything seems to be working
except saving/deleting publishers. It throws me:
java wrote:
javax.xml.ws.soap.SOAPFaultException:
org.apache.juddi.model.UddiEntityPublisher cannot be cast to
org.apache.juddi.model.Publisher
at
com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at
com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at
com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy40.savePublisher(Unknown Source)
I wrote such a method for getting authentication token:
java wrote:
public AuthToken getAuthToken(String userID, String cred) throws
Exception
{
GetAuthToken getAuthToken = new GetAuthToken();
getAuthToken.setUserID(userID);
getAuthToken.setCred(cred);
return security.getAuthToken(getAuthToken);
}
And when I'm trying to save publisher, here is how I do it:
public PublisherDetail savePublisher(SavePublisher savePublisher)
throws Exception
{
return juddiApi.savePublisher(savePublisher);
}
...
public static SavePublisher GetSavePublisher(Publisher publisher,
AuthToken authToken) throws Exception
{
List listPublisher = new ArrayList<Publisher>();
listPublisher.add(publisher);
return GetSavePublisher(listPublisher, authToken);
}
...
public static SavePublisher GetSavePublisher(List<Publisher>
listPublisher, AuthToken authToken) throws Exception
{
SavePublisher sp = new SavePublisher();
sp.setAuthInfo(authToken.getAuthInfo());
sp.getPublisher().addAll(listPublisher);
return sp;
}
So I build SavePublisher object and pass it to the juddiApi, but it throws
this exception somewhere in the middle of compiled libs in this line:
return juddiApi.savePublisher(savePublisher);
Maybe you are interested in what Publisher object I pass as the parameter to
build SavePublisher. In the current situation I get PublisherDetail from:
public PublisherDetail getAllPublisherDetail
(GetAllPublisherDetail gapd) throws Exception
{
return juddiApi.getAllPublisherDetail(gapd);
}
...
public static GetAllPublisherDetail GetAllPublisherDetail(AuthToken
authToken) throws Exception
{
GetAllPublisherDetail gapd = new GetAllPublisherDetail();
gapd.setAuthInfo(authToken.getAuthInfo());
return gapd;
}
...
Next I can work with particular publisher getting it from PublisherDetail
object getPublisher() method getting List<Publisher>.
And another question I was worried about. As far as I understand juddiv3
does not work with "juddi-users.xml"/"juddi-users-encrypted.xml". It cares
only if there is a publisher by the given Authorized Name. So how can I
save/delete new/old users with their passwords? Maybe somehow with
CryptedXMLDocAuthentication or XMLDocAuthenticator objects in my java code?
I've tried to create them but it throws me that mentioned exception:
chainerlt wrote:
CryptedXMLDocAuthenticator x = new CryptedXMLDocAuthenticator();
But it throws me:
java.util.concurrent.ExecutionException:
org.apache.commons.configuration.ConfigurationException: Cannot locate
configuration source juddiv3.properties
And finally, how can I get into this mailing list system? I've subscribed
here: http://old.nabble.com/mailing_list/MailingListOptions.jtp?forum=240
But I don't get emails when some of you guys reply to my posts. So I
manually check mailing list here:
http://mail-archives.apache.org/mod_mbox/juddi-user/201103.mbox/browser And
these replies does not appear in the thread I've created
http://old.nabble.com/juddiv3-credentials-%28passwords-%29-tt31198695.html .
I remember asking for how to get finding all services/businesses and didn't
know you guys replied me quickly, and that took me for around a week to
figure it by myself :/
Thank you for helping :-)
#######################################################################
Kurt wrote:
Hi Chainerit,
The best way to get this working is to start with the working
juddi-tomcat bundle.
1. Verify things work then
2. edit the juddiv3.war/WEB-INF/class/juddiv3.properties file.
Here are all the properties you can use:
http://svn.apache.org/viewvc/juddi/tags/juddi-3.0.4/juddi-core/src/main/java/org/apache/juddi/config/Property.java?revision=1030350&view=markup
3. Switch to use
juddi.authenticator = org.apache.juddi.v3.auth.XMLDocAuthenticator
which by default will look to load juddi-users.xml from the classpath
(so put it in WEB-INF/classes),
in the unit tests we use
http://svn.apache.org/viewvc/juddi/tags/juddi-3.0.4/juddi-core-openjpa/src/test/resources/juddi-users.xml?revision=1030350&view=markup
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<juddi-users>
<user userid="anou_mana" password="password" />
<user userid="bozo" password="clown" />
<user userid="sviens" password="password" />
</juddi-users>
4. In tomcat you will need to restart any time you add files to a war to
get them on to deploy (and on the classpath)
5. Once you have that working you can try encryption.
Good luck!
--Kurt