I resolved this tricky problem. Jena and XWiki both use Xerces. I found the
actualValueType field in the xerces API (
http://xerces.apache.org/xerces2-j/javadocs/xerces2/org/apache/xerces/impl/…
).
. The fact is that it seems that XWiki uses a jar file which is less
complete than the one provided by Jena (called xercesImpl.jar). I therefore
deleted
<http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/xwiki/xwiki/trunk/lib/xerces-2.4.0.jar?view=log&rev=468>
xerces-2.4.0.jar from WEB-INF/lib and replaced it with the one provided by
xerces.
However, this looks more like a hack to a real solution. Does anyone know
where I could configure XWiki to give priority to the Jena jar when I call
my plugin rather than to the XWiki one?
Thanks a lot!
On 05/04/06, Julien Bourdon <bourdux(a)gmail.com> wrote:
Hi all!
I'm trying to develop a plugin to interact with Jena (
http://jena.sourceforge.net), a semantic web framework.
I developed the plugin as I documented it in the plugin development
tutorial. I have a hello() method which works perfectly. however when I try
to call this method:
public List<String> test1(){
Vector<String> uris = new Vector<String>();
OntModel model = ModelFactory.createOntologyModel(
OntModelSpec.RDFS_MEM_RDFS_INF, null );
model.read("
http://www.dcs.shef.ac.uk/~zzc05jb/environmentOntology/pollutionInventory.r…
");
model.read("
http://www.dcs.shef.ac.uk/~zzc05jb/environmentOntology/instances/disposalRe…
");
Iterator iter = model.listIndividuals();
while(iter.hasNext()){
OntResource ontClass = (OntResource)iter.next();
uris.add(ontClass.getURI());
}
return uris;
}
I get this exception:
Error number 4001 in 4: Error while parsing velocity page
Tests.OntologyPlugin Wrapped Exception: Invocation of method 'test1' in
class secoia.plugin.OntologyPluginApi threw exception class
java.lang.NoSuchFieldError : actualValueType
I can't really make sense of it. This method works if i use it form a
classic Java application. I copied all the Jena jar files to the
webapps/xwiki/WEB-INF/lib directory. Moreover, I don't know where this
actualValueType comes from. Does it come from XWiki?
Any clue on this problem?
Thanks a lot!
--
_ _ Julien Bourdon
(o)(o)--.
http://purl.org/net/JulienBourdon
\../ ( ) self isAddictedTo:(#Squeak&#linux)
m\/m--m'`--. ^true
--
_ _ Julien Bourdon
(o)(o)--.
http://purl.org/net/JulienBourdon
\../ ( ) self isAddictedTo:(#Squeak&#linux)
m\/m--m'`--. ^true