You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Abduladem Eljamel <a_...@yahoo.co.uk.INVALID> on 2016/08/23 14:08:29 UTC

No Such Method Error

Hi ALL
I have migrated from  Jena 2.11 to Jena 3.1.0 Lately. After modifying my code to fit JENA 3.1.0  I have gotten this error exception:    

java.lang.NoSuchMethodError: org.apache.jena.atlas.lib.Cache.getIfPresent(Ljava/lang/Object;)Ljava/lang/Object;

After searching the jena-users mailing list, I found that it had to do with different versions of Jean being found in the classpath or one of jena libraries in my code calling an old class it didn't have the method. I tried with my best knowledge (which is not enough) to find a solution, but I have failed. the only thing I could find is that the method wich are responsible for this error  in my could is:

 OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, null);
 
 Could any one help me please.
 
 Thanks in Advance
 Abdul 


Re: No Such Method Error

Posted by Abduladem Eljamel <a_...@yahoo.co.uk.INVALID>.
Thanks Andy for answring my emails.
It is solved. It is web application. I just cleaned and rebuilt the application. 

I think the old libraries were in the server.
Thanks agian
Abdul




      From: Andy Seaborne <an...@apache.org>
 To: users@jena.apache.org 
 Sent: Tuesday, 23 August 2016, 21:34
 Subject: Re: No Such Method Error
   
On 23/08/16 17:07, Abduladem Eljamel wrote:
> Thanks AndySorry, it could be a basic question. I could not understand what I have done wrong to make my project call old jena library. I removed all jena 2.11 libraries from my project but I still get this exception.
>
> ThanksAbdul
>

There is some incompatible jar on the runtime execution classpath.

https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodError.html

In 2.11, org.apache.jena.atlas.lib.Cache was in jena-arq. In Jena 3.1.0, 
it is in jena-base.

Some org.apache.jena.atlas.lib.Cache is on the classpath, maybe multiple 
times.  The first one found is not compatible though.

Something is still wrong with the setup but theer is no evidence as to 
what in the emails.

    Andy

>
>      From: Andy Seaborne <an...@apache.org>
>  To: users@jena.apache.org
>  Sent: Tuesday, 23 August 2016, 16:06
>  Subject: Re: No Such Method Error
>
> On 23/08/16 15:08, Abduladem Eljamel wrote:
>> Hi ALL
>> I have migrated from  Jena 2.11 to Jena 3.1.0 Lately. After modifying my code to fit JENA 3.1.0  I have gotten this error exception:
>>
>> java.lang.NoSuchMethodError: org.apache.jena.atlas.lib.Cache.getIfPresent(Ljava/lang/Object;)Ljava/lang/Object;
>>
>> After searching the jena-users mailing list, I found that it had to do with different versions of Jean being found in the classpath or one of jena libraries in my code calling an old class it didn't have the method. I tried with my best knowledge (which is not enough) to find a solution, but I have failed. the only thing I could find is that the method wich are responsible for this error  in my could is:
>>
>>  OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, null);
>>
>>  Could any one help me please.
>>
>>  Thanks in Advance
>>  Abdul
>>
>>
>
> What you found searching the list is correct.
>
> In Jena 3.1.0, the Cache class is in the jena-base jar.
>
>    Andy
>
>
>
>
>



  

Re: No Such Method Error

Posted by Andy Seaborne <an...@apache.org>.
On 23/08/16 17:07, Abduladem Eljamel wrote:
> Thanks AndySorry, it could be a basic question. I could not understand what I have done wrong to make my project call old jena library. I removed all jena 2.11 libraries from my project but I still get this exception.
>
> ThanksAbdul
>

There is some incompatible jar on the runtime execution classpath.

https://docs.oracle.com/javase/8/docs/api/java/lang/NoSuchMethodError.html

In 2.11, org.apache.jena.atlas.lib.Cache was in jena-arq. In Jena 3.1.0, 
it is in jena-base.

Some org.apache.jena.atlas.lib.Cache is on the classpath, maybe multiple 
times.  The first one found is not compatible though.

Something is still wrong with the setup but theer is no evidence as to 
what in the emails.

	Andy

>
>       From: Andy Seaborne <an...@apache.org>
>  To: users@jena.apache.org
>  Sent: Tuesday, 23 August 2016, 16:06
>  Subject: Re: No Such Method Error
>
> On 23/08/16 15:08, Abduladem Eljamel wrote:
>> Hi ALL
>> I have migrated from  Jena 2.11 to Jena 3.1.0 Lately. After modifying my code to fit JENA 3.1.0  I have gotten this error exception:
>>
>> java.lang.NoSuchMethodError: org.apache.jena.atlas.lib.Cache.getIfPresent(Ljava/lang/Object;)Ljava/lang/Object;
>>
>> After searching the jena-users mailing list, I found that it had to do with different versions of Jean being found in the classpath or one of jena libraries in my code calling an old class it didn't have the method. I tried with my best knowledge (which is not enough) to find a solution, but I have failed. the only thing I could find is that the method wich are responsible for this error  in my could is:
>>
>>   OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, null);
>>
>>   Could any one help me please.
>>
>>   Thanks in Advance
>>   Abdul
>>
>>
>
> What you found searching the list is correct.
>
> In Jena 3.1.0, the Cache class is in the jena-base jar.
>
>     Andy
>
>
>
>
>


Re: No Such Method Error

Posted by Abduladem Eljamel <a_...@yahoo.co.uk.INVALID>.
Thanks AndySorry, it could be a basic question. I could not understand what I have done wrong to make my project call old jena library. I removed all jena 2.11 libraries from my project but I still get this exception. 

ThanksAbdul


      From: Andy Seaborne <an...@apache.org>
 To: users@jena.apache.org 
 Sent: Tuesday, 23 August 2016, 16:06
 Subject: Re: No Such Method Error
   
On 23/08/16 15:08, Abduladem Eljamel wrote:
> Hi ALL
> I have migrated from  Jena 2.11 to Jena 3.1.0 Lately. After modifying my code to fit JENA 3.1.0  I have gotten this error exception:
>
> java.lang.NoSuchMethodError: org.apache.jena.atlas.lib.Cache.getIfPresent(Ljava/lang/Object;)Ljava/lang/Object;
>
> After searching the jena-users mailing list, I found that it had to do with different versions of Jean being found in the classpath or one of jena libraries in my code calling an old class it didn't have the method. I tried with my best knowledge (which is not enough) to find a solution, but I have failed. the only thing I could find is that the method wich are responsible for this error  in my could is:
>
>  OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, null);
>
>  Could any one help me please.
>
>  Thanks in Advance
>  Abdul
>
>

What you found searching the list is correct.

In Jena 3.1.0, the Cache class is in the jena-base jar.

    Andy



  

Re: No Such Method Error

Posted by Andy Seaborne <an...@apache.org>.
On 23/08/16 15:08, Abduladem Eljamel wrote:
> Hi ALL
> I have migrated from  Jena 2.11 to Jena 3.1.0 Lately. After modifying my code to fit JENA 3.1.0  I have gotten this error exception:
>
> java.lang.NoSuchMethodError: org.apache.jena.atlas.lib.Cache.getIfPresent(Ljava/lang/Object;)Ljava/lang/Object;
>
> After searching the jena-users mailing list, I found that it had to do with different versions of Jean being found in the classpath or one of jena libraries in my code calling an old class it didn't have the method. I tried with my best knowledge (which is not enough) to find a solution, but I have failed. the only thing I could find is that the method wich are responsible for this error  in my could is:
>
>  OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, null);
>
>  Could any one help me please.
>
>  Thanks in Advance
>  Abdul
>
>

What you found searching the list is correct.

In Jena 3.1.0, the Cache class is in the jena-base jar.

     Andy