[Yanel-dev] Yarep jar problem
Paloma Gomez
paloma.gomez at wyona.com
Wed Feb 21 14:02:09 CET 2007
Josias Thöny escribió:
> Paloma Gomez wrote:
>> Hi all,
>>
>> I get the following error when I try to access
>> http://127.0.0.1:8080/yanel:
>>
>> --------------------------------------------------------------------------------------------------------------------
>>
>>
>> 99 2007-02-20 17:15:43,360 [http-8080-Processor24] ERROR
>> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/yanel].log():675
>> - StandardWrapper.Throwable
>> java.lang.NoSuchMethodError:
>> org.wyona.yarep.core.RepositoryFactory.reset()V
>> at
>> org.wyona.yanel.core.map.RealmConfiguration.readRealms(RealmConfiguration.java:128)
>>
>> at
>> org.wyona.yanel.core.map.RealmConfiguration.<init>(RealmConfiguration.java:97)
>>
>> at
>> org.wyona.yanel.core.map.RealmConfiguration.<init>(RealmConfiguration.java:71)
>>
>> at org.wyona.yanel.core.Yanel.init(Yanel.java:61)
>> at org.wyona.yanel.servlet.YanelServlet.init(YanelServlet.java:111)
>> [...]
>> 204 2007-02-20 17:15:43,365 [http-8080-Processor24] ERROR
>> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/yanel].[YanelServlet].invoke():145
>> - Excepción de reserva de espacio para servlet YanelServlet
>> java.lang.NoSuchMethodError:
>> org.wyona.yarep.core.RepositoryFactory.reset()V
>> at
>> org.wyona.yanel.core.map.RealmConfiguration.readRealms(RealmConfiguration.java:128)
>>
>> at
>> org.wyona.yanel.core.map.RealmConfiguration.<init>(RealmConfiguration.java:97)
>>
>> at
>> org.wyona.yanel.core.map.RealmConfiguration.<init>(RealmConfiguration.java:71)
>>
>> at org.wyona.yanel.core.Yanel.init(Yanel.java:61)
>> [...]
>>
>> ---------------------------------------------------------------------------------------------------------------------
>>
>>
>> The offending line can be found in RealmConfiguration.java:
>>
>> RepositoryFactory repoFactory =
>> yanel.getRepositoryFactory("DefaultRepositoryFactory");
>> repoFactory.reset();
>>
>>
>> I have tried removing the jars from .m2 and downloading them again:
>>
>> --------------------------------------------------------------------------------------------------------------------------------
>>
>> dependencies:
>> [artifact:dependencies] Downloading:
>> yarep/yarep-impl/0.0.1-dev-r22672/yarep-impl-0.0.1-dev-r22672.pom
>> [artifact:dependencies] Transferring 0K
>> [artifact:dependencies] Downloading:
>> yarep/yarep-impl/0.0.1-dev-r22672/yarep-impl-0.0.1-dev-r22672.pom
>> [artifact:dependencies] Transferring 0K
>> [artifact:dependencies] [WARNING] *** CHECKSUM FAILED - Checksum
>> failed on download: local = 'bcec231efdd0059a6cb05707867ca16f';
>> remote = 'd41d8cd98f00b204e9800998ecf8427e' - IGNORING
>> [artifact:dependencies] Downloading:
>> yarep/yarep-core/0.0.1-dev-r22584/yarep-core-0.0.1-dev-r22584.pom
>> [artifact:dependencies] Transferring 0K
>> [artifact:dependencies] Downloading:
>> yarep/yarep-impl/0.0.1-dev-r22672/yarep-impl-0.0.1-dev-r22672.jar
>> [artifact:dependencies] Transferring 83K
>> [artifact:dependencies] Downloading:
>> yarep/yarep-core/0.0.1-dev-r22584/yarep-core-0.0.1-dev-r22584.jar
>> [artifact:dependencies] Transferring 17K
>> -----------------------------------------------------------------------------------------------------------------------------------------
>>
>>
>> As you can see the core revision number and the impl revision number
>> are not the same.
>> Could that be the problem?
>>
>> I have also tried checking out yarep:
>> sh build.sh install-jar
>>
>> The revision numbers I get in this case are the same: 22584
>>
>> I have tried using this jars and it didn't work either.
>>
>> Any hints?
>
> The reset() method was added in r22584, so it should be contained in
> your jar files. Could it be that somewhere in your yanel there is
> another reference to an older yarep jar? (maybe in your user resource)
>
> That's the only idea i'm having right now...
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
<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
>
>
More information about the Yanel-development
mailing list