Hi Kurt,
Okay I did check out. But I still have some questions. Here is what I found
in '*org.apache.juddi.v3.auth.XMLDocAuthenticator.java*' (in '*jUDDI Core*')
when I made a check out: ( http://codepaste.net/gttc3a )
Since I wasn't able to build with '*mvn clean install*' I looked deeper into
the code.
I see in the commit (
http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/v3/auth/XMLDocAuthenticator.java?p2=%2Fjuddi%2Ftrunk%2Fjuddi-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fjuddi%2Fv3%2Fauth%2FXMLDocAuthenticator.java&p1=%2Fjuddi%2Ftrunk%2Fjuddi-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fjuddi%2Fv3%2Fauth%2FXMLDocAuthenticator.java&r1=1086999&r2=1086998&view=diff&pathrev=1086999)
that the only changes were made to '
*public UddiEntityPublisher identify(String authInfo, String authorizedName)
*' method. But as if you say I could simply replace whole class with (
http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/v3/auth/XMLDocAuthenticator.java?revision=1086999&view=markup&pathrev=1086999)
I can see more changes in your posted class. I've checkout via
NetBeans
and after replacing class code it throw me an error in code and I noticed
that not only '*identify*' method is changed:
public synchronized void readUserFile() throws JAXBException, IOException,
> ConfigurationException
> {
> ...
> InputStream stream = ClassUtil.getResource(usersFileName,
> this.getClass()).openStream();
> ...
> }
>
Error cannot find symbol symbol: method
> getResource(java.lang.String,java.lang.Class<capture#1 of ? extends
> org.apache.juddi.v3.auth.XMLDocAuthenticator>) location: class
> org.apache.juddi.ClassUtil XMLDocAuthenticator.java
> ~/juddi-3.0.4/juddi-core/src/main/java/org/apache/juddi/v3/auth/XMLDocAuthenticator.java:93
>
However I was able to replace '*identify*' method with the new one and
successfully build '*jUDDI Core*' project. But maybe I have a lack of
knowledge on what actually happens. As far as I understand '*jUDDI Core*'
builds new '*juddi-core-3.0.4.jar*' in '*~\juddi-3.0.4\juddi-core\target*'.
So I replaced it with the one in my tomcat:
'~\webapps\uddi-portlets\WEB-INF\lib'. And also '*XMLDocAuthenticator*.class'
in '*
~\webapps\juddiv3\WEB-INF\lib\juddi-core-openjpa-3.0.4.jar\org\apache\juddi\v3\auth\
*'. Therefore Class cast exception disappeared and seems like problems went
out (I can successfully save/delete publishers now). But what about that
discrepancy in '*XMLDocAuthenticator.java'*?
Nomater if I'm talking nonsense, I have a question about 'juddi-users.xml'
(or 'juddi-users-encrypted.xml'). How should I work with this file from my
code if I wanna create new/edit/delete users with passwords. Seems like this
has nothing to do with juddi, so how should I take care of managing users
(especially if I'm using CryptedXMLDocAuthenticator). Should there be any
synchronization between this file and publishers in the database?
Thanks,
Martin
2011/3/30 Kurt T Stam <[email protected]>
> Hi Martin,
>
> All fixed. If you are using juddi-3.0.4, you should check out the source
> for juddi-3.0.4, and apply the patch:
>
>
> http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/v3/auth/XMLDocAuthenticator.java?p2=%2Fjuddi%2Ftrunk%2Fjuddi-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fjuddi%2Fv3%2Fauth%2FXMLDocAuthenticator.java&p1=%2Fjuddi%2Ftrunk%2Fjuddi-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fjuddi%2Fv3%2Fauth%2FXMLDocAuthenticator.java&r1=1086999&r2=1086998&view=diff&pathrev=1086999
>
> or simply replace it with
>
>
> http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/v3/auth/XMLDocAuthenticator.java?revision=1086999&view=markup&pathrev=1086999
>
> then from the juddi-core directory, run:
>
> mvn clean install.
>
> This is create a new juddi-core-3.0.4.jar in the target directory.
>
> We will also soon release juddi-3.1.0 which will contain this fix.
>
> Thx,
>
> -Kurt
>
> p.s. the Encrypted version inherits from this one, so the patch fixes that
> one too.
>
>
>
> On 3/30/11 11:50 AM, Martynas A. (chainer) wrote:
>
> Kurt,
>
> Same happens with CryptedXMLDocAuthenticator. Fix that too. Btw when is it
> possible to expect the fix and in what form (new release/patch)?
>
> Martin
>
> 2011/3/30 Kurt T Stam <[email protected]>
>
>> Hi Martin,
>>
>> I can reproduce it now. The XMLDocAuthenticator has a bug and should be
>> returning a Publisher.
>> I reopened the issue.
>>
>> --Kurt
>>
>>
>> On 3/30/11 10:45 AM, Martynas A. (chainer) wrote:
>>
>> Yes, my code worked properly with 'juddi.authenticator =
>> org.apache.juddi.v3.auth.JUDDIAuthenticator' in juddi.properties, because it
>> was default and I wasn't playing around with authentication. I just changed
>> back to JUDDIAuthenticator to check and it works fine.
>>
>> 2011/3/30 Kurt T Stam <[email protected]>
>>
>>> OK I will try one more time. Are you saying it only happens when you
>>> change the authentication properties and users.xml?
>>>
>>> On 3/30/11 10:00 AM, Martynas A. (chainer) wrote:
>>>
>>> Kurt,
>>>
>>> Well I just simply tried to download a fresh
>>> 'juddi-portal-bundle-3.0.4.zip', unzip it, setup authentication in
>>> propeties, create users.xml, startup it and try to save publisher. Same
>>> exception. In my project I use only "juddi-client-3.0.4.jar" and
>>> "uddi-ws-.3.0.4.jar" which are related to juddi. No idea.
>>>
>>> --Martin
>>>
>>> 2011/3/30 Kurt T Stam <[email protected]>
>>>
>>>> Martin,
>>>>
>>>> The code is fine. Can it be you deployed the juddi-core.jar more then
>>>> once? It looks to me like that classcast might be caused by
>>>> classloading issues, or version mismatch.
>>>>
>>>> --Kurt
>>>>
>>>>
>>>>
>>>
>>
>>
>
>