You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Dang Nguyen <da...@gmail.com> on 2012/10/04 01:25:35 UTC

Regarding "NoSuchMethodError: com.hp.hpl.jena.sparql.pfunction.PropFuncArg.evalIfExists"

Hello everyone,

I am a newbie to Jena and would greatly appreciate your help regarding my
problem in using Jena.
Currently I am attempting to use the GLEEN library to make regular path
expression queries on Jena models but every time I execute my codes I get
the following error:

Exception in thread "main" java.lang.NoSuchMethodError:
com.hp.hpl.jena.sparql.pfunction.PropFuncArg.evalIfExists(Lcom/hp/hpl/jena/sparql/engine/binding/Binding;)Lcom/hp/hpl/jena/sparql/pfunction/PropFuncArg;
    at edu.washington.sig.gleen.OnPath.exec(OnPath.java:113)
    at
com.hp.hpl.jena.sparql.pfunction.PropertyFunctionBase$RepeatApplyIteratorPF.nextStage(PropertyFunctionBase.java:108)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage(QueryIterRepeatApply.java:113)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding(QueryIterRepeatApply.java:65)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:108)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIterProcedure.hasNextBinding(QueryIterProcedure.java:74)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:108)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIterConvert.hasNextBinding(QueryIterConvert.java:59)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:108)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:40)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:108)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:40)
    at
com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:108)
    at
com.hp.hpl.jena.sparql.engine.ResultSetStream.hasNext(ResultSetStream.java:72)
    at
com.hp.hpl.jena.sparql.resultset.ResultSetMem.<init>(ResultSetMem.java:95)
    at
com.hp.hpl.jena.sparql.resultset.TextOutput.write(TextOutput.java:147)
    at
com.hp.hpl.jena.sparql.resultset.TextOutput.write(TextOutput.java:130)
    at
com.hp.hpl.jena.sparql.resultset.TextOutput.write(TextOutput.java:118)
    at
com.hp.hpl.jena.sparql.resultset.TextOutput.format(TextOutput.java:65)
    at
com.hp.hpl.jena.query.ResultSetFormatter.out(ResultSetFormatter.java:135)
    at edu.utsa.cs.testing.Ex1.main(Ex1.java:77)

On line 77 of Ex1.java is the following statement:
        ResultSetFormatter.out(System.out, rs, query);

I did look up the source code for the *PropFuncArg* and there were no
implementation of any *evalIfExists* method.
I was able to use GLEEN before but at the time I was using ARQ 2.8.8.
On my current system I am using ARQ 2.9.3.
I suppose some functions were removed from the new version.
Is that where the problem arises from?

Regards,
-- 
*Dang Nguyen*

Re: Regarding "NoSuchMethodError: com.hp.hpl.jena.sparql.pfunction.PropFuncArg.evalIfExists"

Posted by Andy Seaborne <an...@apache.org>.
On 04/10/12 00:25, Dang Nguyen wrote:
> Hello everyone,
>
> I am a newbie to Jena and would greatly appreciate your help regarding my
> problem in using Jena.
> Currently I am attempting to use the GLEEN library to make regular path
> expression queries on Jena models but every time I execute my codes I get
> the following error:
>
> Exception in thread "main" java.lang.NoSuchMethodError:
> com.hp.hpl.jena.sparql.pfunction.PropFuncArg.evalIfExists(Lcom/hp/hpl/jena/sparql/engine/binding/Binding;)Lcom/hp/hpl/jena/sparql/pfunction/PropFuncArg;
>      at edu.washington.sig.gleen.OnPath.exec(OnPath.java:113)
>      at
...
> com.hp.hpl.jena.query.ResultSetFormatter.out(ResultSetFormatter.java:135)
>      at edu.utsa.cs.testing.Ex1.main(Ex1.java:77)
>
> On line 77 of Ex1.java is the following statement:
>          ResultSetFormatter.out(System.out, rs, query);
>
> I did look up the source code for the *PropFuncArg* and there were no
> implementation of any *evalIfExists* method.
> I was able to use GLEEN before but at the time I was using ARQ 2.8.8.
> On my current system I am using ARQ 2.9.3.
> I suppose some functions were removed from the new version.
> Is that where the problem arises from?

Yes.


"java.lang.NoSuchMethodError" is because you have an in incompatible set 
of jars on the classpath.

As this occurs at a call in edu.washington.sig.gleen.OnPath.exec to Jena 
code, it looks like the ARQ jar is not compatible.

It does say on their web pages:

"""
Download GLEEN V0.6.1 beta, for ARQ 2.2
"""

and ARQ 2.2 is very, very old.

The GLEEN release is June 2008.

SPARQL 1.1 has property paths as part of the language - these may do 
what you want.

Else you will have to
1/ contact the creators of GLEEN
2/ update the code your self to work with ARQ 2.9.3.

	Andy





>
> Regards,
>