[Yanel-dev] Yarep jar problem

Josias Thöny josias.thoeny at wyona.com
Wed Feb 21 15:44:37 CET 2007


Paloma Gomez wrote:
[...]
> Yes, there was another reference in my user resource. However, after 
> fixing I kept getting  error messages regarding a "premature end of 
> file" in realms.xml. I checked it and it was fine. I set then

The error message is a bit misleading. The premature eof error is 
probably not caused by realms.xml, but by a user file. I will try to 
improve the error message.

It's a bit strange that adding the namespace seemed to solve the 
problem. I just added another user to the test repo:
https://svn.wyona.com/repos/public/security/trunk/src/test/repository/repository2/content/users/foo.xml

It doesn't have a namespace and the tests (./build.sh test) still run 
sucessfully.
But it's ok with me to add the namespace.

josias

> 
> <resource src="../src/contributions/resources/yanel-user/"    
> compile="false"/>
> 
> to see if my resource was the problem and tried again but the problems 
> were still there. I tried the yanel cli, which turned out to be more 
> verbose than tomcat  and I finally traced back the problem.
> 
> -------------------------------------------------------------------------------- 
> 
> [....]
> [java] org.wyona.yanel.core.ConfigurationException: Error reading realm 
> configuration from file 
> /usr/local/yanelTesting/build/webapps/yanel/WEB-INF/classes/realms.xml: 
> The element type "user" must be terminated by the matching end-tag 
> "</user>".     [java]     at 
> org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:180)
>     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:710)
>     [java]     at 
> org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:178)
>     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84)
>     [java]     at 
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>     [java]     at org.apache.tools.ant.Task.perform(Task.java:364)
>     [java]     at org.apache.tools.ant.Target.execute(Target.java:341)
>     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:369)
>     [java]     at 
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>     [java]     at 
> org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>     [java]     at 
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) 
> 
>     [java]     at 
> org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>     [java]     at org.apache.tools.ant.Main.runBuild(Main.java:668)
>     [java]     at org.apache.tools.ant.Main.startAnt(Main.java:187)
>     [java]     at 
> org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
>     [java]     at 
> org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
>     [java] Caused by: org.wyona.yanel.core.ConfigurationException: Error 
> reading realm configuration from file 
> /usr/local/yanelTesting/build/webapps/yanel/WEB-INF/classes/realms.xml: 
> The element type "user" must be terminated by the matching end-tag 
> "</user>".
> [....]
> ---------------------------------------------------------------------
> 
> 
> I had added a /users and /groups nodes to the ac-identities repository 
> of the use-cases realm. As the create resource usecase is broken for the 
> moment (at least it says so in the main page of the usecase realm), I 
> created users and groups manually. I looked at the createConfiguration() 
> method in YarepUser.java and YarepGroup.java to know about the structure 
> of the configuration files.
> 
> For instance, the YarepUser.java method is:
> ------------------------------------------------------------------------------------ 
> 
> protected Configuration createConfiguration() throws 
> AccessManagementException {
>        DefaultConfiguration config = new DefaultConfiguration(USER);
>        config.setAttribute(ID, getID());
>        DefaultConfiguration nameNode = new DefaultConfiguration(NAME);
>        nameNode.setValue(getName());
>        config.addChild(nameNode);
>        DefaultConfiguration emailNode = new DefaultConfiguration(EMAIL);
>        emailNode.setValue(getEmail());
>        config.addChild(emailNode);
>        DefaultConfiguration passwordNode = new 
> DefaultConfiguration(PASSWORD);
>        passwordNode.setValue(getPassword());
>        config.addChild(passwordNode);
> 
>        return config;
>    }
> ---------------------------------------------------------------------------------- 
> 
> 
> It doesn't set the xmlns attribute in the root tag, which seems to be 
> the problem.
> 
> Changing from
> 
> ---------------------------------------------------------------------------------------- 
> 
> <?xml version="1.0"?>
> <user id="lenya" >
>  <name>Michael Wechner</name>  <email>michi at wyona.org</email>
>  <password type="md5">8e07dafd13495561db9063ebe4db4b27</password>
> </user>
> ---------------------------------------------------------------------------------- 
> 
> 
> to
> ------------------------------------------------------------------
> <?xml version="1.0"?>
> <user id="lenya" xmlns="http://www.wyona.org/security/1.0">
>  <name>Michael Wechner</name>  <email>michi at wyona.org</email>
>  <password type="md5">8e07dafd13495561db9063ebe4db4b27</password>
> </user>
> -------------------------------------------------------------------------
> 
> fixes it.
> 
> So I'll add the xmlns attribute in YarepGroup#createConfiguration() and 
> YarepUser#createConfiguration(). WDYT?
> 
> Thanks,
> Paloma
>>
>> josias
>>
>>>
>>> Thanks,
>>> Paloma
>>>
>>> _______________________________________________
>>> Yanel-development mailing list
>>> Yanel-development at wyona.com
>>> http://wyona.com/cgi-bin/mailman/listinfo/yanel-development
>>>
>>
>>
>> _______________________________________________
>> Yanel-development mailing list
>> Yanel-development at wyona.com
>> http://wyona.com/cgi-bin/mailman/listinfo/yanel-development
>>
>>
> 
> 
> _______________________________________________
> Yanel-development mailing list
> Yanel-development at wyona.com
> http://wyona.com/cgi-bin/mailman/listinfo/yanel-development
> 




More information about the Yanel-development mailing list