You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Alessandro Colantoni <al...@gmail.com> on 2005/06/02 08:49:37 UTC

java.lang.NoSuchMethodError on criteria.addLike

I'm trying to use the ojb implementation of PropertySet (a framework of 
opensymphony.com <http://opensymphony.com>)
There is a piece of code
  
Criteria critere = new Criteria();
critere.addEqualTo("globalKey", globalKey);
critere.addLike("itemKey", key);

When executing the line critere.addLike("itemKey", key) I get the following 
error
java.lang.NoSuchMethodError:
org.apache.ojb.broker.query.Criteria.addLike(Ljava/lang/String;Ljava/lang/Objec
t;)
 I'm using db-ojb-1.0.1 with jakarta-tomcat-5.5.0 and jdk1.5.0_02
Could be a version problem??
thanks

Re: java.lang.NoSuchMethodError on criteria.addLike

Posted by Alessandro Colantoni <al...@gmail.com>.
ok.
I just had put the propertyset.jar in my web-inf/lib without checking which 
version of obj properyset was compiled with. 
proepertyset was compiled with rc4 and in my web-inf/lib I had 1.0
i downloaded the source of propertyset and recompiled with obj 1.0.
Now it's O.K
 thanks

 On 6/2/05, Martin Kalén <mk...@apache.org> wrote: 
> 
> Alessandro Colantoni wrote:
> > I'm trying to use the ojb implementation of PropertySet (a framework of
> > opensymphony.com <http://opensymphony.com> <http://opensymphony.com>)
> > There is a piece of code
> >
> > Criteria critere = new Criteria();
> > critere.addEqualTo("globalKey", globalKey);
> > critere.addLike("itemKey", key);
> >
> > When executing the line critere.addLike("itemKey", key) I get the 
> following
> > error
> > java.lang.NoSuchMethodError:
> > org.apache.ojb.broker.query.Criteria.addLike
> (Ljava/lang/String;Ljava/lang/Objec
> > t;)
> > I'm using db-ojb-1.0.1 with jakarta-tomcat-5.5.0 and jdk1.5.0_02
> > Could be a version problem??
> > thanks
> 
> Are you compiling your code with exactly the same OJB JAR in CLASSPATH
> as when you execute your webapp?
> 
> Check for and remove any OJB .class files in WEB-INF/classes and make
> sure you don't have conflicting OJB JAR files in WEB-INF/lib vs
> Tomcat common libs (CATALINA_HOME/common/lib).
> 
> Regards,
> Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
>

Re: java.lang.NoSuchMethodError on criteria.addLike

Posted by Martin Kalén <mk...@apache.org>.
Alessandro Colantoni wrote:
> I'm trying to use the ojb implementation of PropertySet (a framework of 
> opensymphony.com <http://opensymphony.com>)
> There is a piece of code
>   
> Criteria critere = new Criteria();
> critere.addEqualTo("globalKey", globalKey);
> critere.addLike("itemKey", key);
> 
> When executing the line critere.addLike("itemKey", key) I get the following 
> error
> java.lang.NoSuchMethodError:
> org.apache.ojb.broker.query.Criteria.addLike(Ljava/lang/String;Ljava/lang/Objec
> t;)
>  I'm using db-ojb-1.0.1 with jakarta-tomcat-5.5.0 and jdk1.5.0_02
> Could be a version problem??
> thanks

Are you compiling your code with exactly the same OJB JAR in CLASSPATH
as when you execute your webapp?

Check for and remove any OJB .class files in WEB-INF/classes and make
sure you don't have conflicting OJB JAR files in WEB-INF/lib vs
Tomcat common libs (CATALINA_HOME/common/lib).

Regards,
  Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org