db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frédéric Trifiro <li...@trifiro.net>
Subject RE: Error OQLQuery
Date Fri, 25 Jul 2003 12:57:57 GMT
Hi again !

I tried your solution and it works !!! I spent a lot of time on this problem 
and the solution was this missing jar file !!!

Thank you so much :) !

Cheers, Frederic.

En réponse à Charles Anthony <charles.anthony@hpdsoftware.com>:

> You need this file so that OJB can "parse" the OQL query string.
> 
> See http://db.apache.org/ojb/deployment.html for a list of all the jar
> files
> that need to be on the classpath.
> 
> 
> Cheers,
> 
> Charles
> 
> >-----Original Message-----
> >From: Frédéric Trifiro [mailto:liste@trifiro.net]
> >Sent: 25 July 2003 13:35
> >To: OJB Developers List
> >Subject: Re: Error OQLQuery
> >
> >
> >Hi Jim (and others !) !
> >
> >Why should i need this file ?
> >
> >I have no problem with other persistence actions like 
> >inserting a row for 
> >example... Just this OQLQuery problem :(
> >
> >Please help :p ! 
> >
> >Frederic
> >
> >En réponse à Jim Shingler <shing@iwaynet.net>:
> >
> >> Maybe the antlr jar file is missing from you your webapp
> >> 
> >> Quoting Frédéric Trifiro <liste@trifiro.net>:
> >> 
> >> > Hi everyone, 
> >> > 
> >> > I'm new to this list and i'm glad to see we are so many to 
> >use OJB ! I
> >> hope 
> >> > someone will help me with my problem...
> >> > 
> >> > You can find below my source code and the apache trace... 
> >The source
> >> line
> >> > where 
> >> > the error occurs is "OQLQuery query = odmg.newOQLQuery();" in the
> >> "getAll
> >> > (Implementation odmg, Transaction tx)" method.
> >> > 
> >> > Thank you for any help, Frederic.
> >> > 
> >> > **
> >> > 
> >> > package com.eads.agit.metier.administration;
> >> > 
> >> > import java.util.Vector;
> >> > import org.odmg.Transaction;
> >> > import org.odmg.Implementation;
> >> > import org.odmg.QueryInvalidException;
> >> > import org.odmg.QueryException;
> >> > import org.odmg.DList;
> >> > import org.odmg.OQLQuery;
> >> > import org.apache.log4j.Logger;
> >> > 
> >> > public class TypeConteneur {
> >> > 	
> >> > 	private String tcoId = null;
> >> > 	private String tcoLib = null;
> >> > 	private double tcoPctDepAn = 0;
> >> > 	private double tcoPctDepMax = 0;
> >> > 	private double tcoValS10Ans = 0;
> >> > 	private double tcoValS15Ans = 0;
> >> > 
> >> > 	public String getTcoId() {
> >> > 		return tcoId;
> >> > 	}
> >> > 
> >> > 	public void setTcoId(String tcoId) {
> >> > 		this.tcoId = tcoId;
> >> > 	}
> >> > 	
> >> > 	public String getTcoLib() {
> >> > 		return tcoLib;
> >> > 	}
> >> > 
> >> > 	public void setTcoLib(String tcoLib) {
> >> > 		this.tcoLib = tcoLib;
> >> > 	}	
> >> > 	
> >> > 	public double getTcoPctDepAn() {
> >> > 		return tcoPctDepAn;
> >> > 	}
> >> > 
> >> > 	public void setTcoPctDepAn(double tcoPctDepAn) {
> >> > 		this.tcoPctDepAn = tcoPctDepAn;
> >> > 	}
> >> > 	
> >> > 	public double getTcoPctDepMax() {
> >> > 		return tcoPctDepMax;
> >> > 	}
> >> > 
> >> > 	public void setTcoPctDepMax(double tcoPctDepMax) {
> >> > 		this.tcoPctDepMax = tcoPctDepMax;
> >> > 	}	
> >> > 
> >> > 	public double getTcoValS10Ans() {
> >> > 		return tcoValS10Ans;
> >> > 	}
> >> > 
> >> > 	public void setTcoValS10Ans(double tcoValS10Ans) {
> >> > 		this.tcoValS10Ans = tcoValS10Ans;
> >> > 	}	
> >> > 	
> >> > 	public double getTcoValS15Ans() {
> >> > 		return tcoValS15Ans;
> >> > 	}
> >> > 
> >> > 	public void setTcoValS15Ans(double tcoValS15Ans) {
> >> > 		this.tcoValS15Ans = tcoValS15Ans;
> >> > 	}	
> >> > 	
> >> > 	public void store(Transaction tx) {
> >> > 			tx.lock(this, Transaction.WRITE);		
> >> > 		}
> >> > 		
> >> > 	public static Vector getAll(Implementation odmg, 
> >Transaction tx) {
> >> > 		
> >> > 		Vector v = new Vector();
> >> > 		DList allTCon = null;
> >> > 		Logger logger = Logger.getLogger(TypeConteneur.class);
> >> > 		
> >> > 		// fabrication de la requête
> >> > 		OQLQuery query = odmg.newOQLQuery();
> >> > 		
> >> > 		try {
> >> > 			query.create("select tcoId from " + 
> >> > TypeConteneur.class.getName());
> >> > 		} catch (QueryInvalidException e) {
> >> > 			e.printStackTrace();
> >> > 		}	
> >> > 					
> >> > 		// exécution de la requête			
> >		
> >> > 		try {
> >> > 			allTCon = (DList) query.execute();
> >> > 			tx.commit();
> >> > 		} catch (QueryException e) {
> >> > 			e.printStackTrace();
> >> > 		}
> >> > 			
> >> > 		// vérif résultat
> >> > 		java.util.Iterator iter = allTCon.iterator();	
> >> > 		while (iter.hasNext()) {
> >> > 			System.out.println(iter.next());	
> >		
> >> > 		}			
> >> > 			
> >> > 		return v;		
> >> > 	}
> >> > 	
> >> > 	public String toString() {
> >> > 		return (tcoId + " // " + tcoLib + " // ");
> >> > 	}
> >> > }
> >> > 
> >> > **
> >> > 
> >> > Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
> >> > 
> >> >
> >> 
> >---------------------------------------------------------------
> >---------------
> >> --
> >> > 
> >> > type Exception report
> >> > 
> >> > message Internal Server Error
> >> > 
> >> > description The server encountered an internal error 
> >(Internal Server
> >> Error)
> >> > 
> >> > that prevented it from fulfilling this request.
> >> > 
> >> > exception 
> >> > 
> >> > javax.servlet.ServletException: Servlet execution threw an 
> >exception
> >> > 	at 
> >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> >> > (ApplicationFilterChain.java:269)
> >> > 	at org.apache.catalina.core.ApplicationFilterChain.doFilter
> >> > (ApplicationFilterChain.java:193)
> >> > 	at org.apache.catalina.core.StandardWrapperValve.invoke
> >> > (StandardWrapperValve.java:243)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:566)
> >> > 	at org.apache.catalina.core.StandardPipeline.invoke
> >> > (StandardPipeline.java:472)
> >> > 	at
> >>
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >> > 	at org.apache.catalina.core.StandardContextValve.invoke
> >> > (StandardContextValve.java:190)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:566)
> >> > 	at org.apache.catalina.valves.CertificatesValve.invoke
> >> > (CertificatesValve.java:246)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:564)
> >> > 	at org.apache.catalina.core.StandardPipeline.invoke
> >> > (StandardPipeline.java:472)
> >> > 	at
> >>
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >> > 	at org.apache.catalina.core.StandardContext.invoke
> >> > (StandardContext.java:2343)
> >> > 	at org.apache.catalina.core.StandardHostValve.invoke
> >> > (StandardHostValve.java:180)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:566)
> >> > 	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
> >> > (ErrorDispatcherValve.java:170)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:564)
> >> > 	at org.apache.catalina.valves.ErrorReportValve.invoke
> >> > (ErrorReportValve.java:170)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:564)
> >> > 	at org.apache.catalina.valves.AccessLogValve.invoke
> >> > (AccessLogValve.java:468)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:564)
> >> > 	at org.apache.catalina.core.StandardPipeline.invoke
> >> > (StandardPipeline.java:472)
> >> > 	at
> >>
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >> > 	at org.apache.catalina.core.StandardEngineValve.invoke
> >> > (StandardEngineValve.java:174)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:566)
> >> > 	at org.apache.catalina.core.StandardPipeline.invoke
> >> > (StandardPipeline.java:472)
> >> > 	at
> >>
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >> > 	at org.apache.catalina.connector.http.HttpProcessor.process
> >> > (HttpProcessor.java:1012)
> >> > 	at org.apache.catalina.connector.http.HttpProcessor.run
> >> > (HttpProcessor.java:1107)
> >> > 	at java.lang.Thread.run(Thread.java:536)
> >> > 
> >> > 
> >> > root cause 
> >> > 
> >> > java.lang.NoClassDefFoundError: antlr/TokenStreamException
> >> > 	at org.apache.ojb.odmg.OJB.newOQLQuery(Unknown Source)
> >> > 	at com.eads.agit.metier.administration.TypeConteneur.getAll
> >> > (TypeConteneur.java:80)
> >> > 	at com.eads.agit.struts.administration.ActGestTconIn.execute
> >> > (ActGestTconIn.java:29)
> >> > 	at 
> >org.apache.struts.action.RequestProcessor.processActionPerform
> >> > (RequestProcessor.java:480)
> >> > 	at org.apache.struts.action.RequestProcessor.process
> >> > (RequestProcessor.java:274)
> >> > 	at org.apache.struts.action.ActionServlet.process
> >> > (ActionServlet.java:1420)
> >> > 	at
> >>
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
> >> > 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> >> > 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >> > 	at org.apache.catalina.core.ApplicationDispatcher.invoke
> >> > (ApplicationDispatcher.java:683)
> >> > 	at org.apache.catalina.core.ApplicationDispatcher.doForward
> >> > (ApplicationDispatcher.java:431)
> >> > 	at org.apache.catalina.core.ApplicationDispatcher.forward
> >> > (ApplicationDispatcher.java:355)
> >> > 	at org.apache.struts.action.RequestProcessor.doForward
> >> > (RequestProcessor.java:1058)
> >> > 	at 
> >org.apache.struts.action.RequestProcessor.processForwardConfig
> >> > (RequestProcessor.java:451)
> >> > 	at 
> >org.apache.struts.action.RequestProcessor.processActionForward
> >> > (RequestProcessor.java:401)
> >> > 	at org.apache.struts.action.RequestProcessor.process
> >> > (RequestProcessor.java:279)
> >> > 	at org.apache.struts.action.ActionServlet.process
> >> > (ActionServlet.java:1420)
> >> > 	at
> >>
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
> >> > 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> >> > 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >> > 	at 
> >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> >> > (ApplicationFilterChain.java:247)
> >> > 	at org.apache.catalina.core.ApplicationFilterChain.doFilter
> >> > (ApplicationFilterChain.java:193)
> >> > 	at org.apache.catalina.core.StandardWrapperValve.invoke
> >> > (StandardWrapperValve.java:243)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:566)
> >> > 	at org.apache.catalina.core.StandardPipeline.invoke
> >> > (StandardPipeline.java:472)
> >> > 	at
> >>
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >> > 	at org.apache.catalina.core.StandardContextValve.invoke
> >> > (StandardContextValve.java:190)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:566)
> >> > 	at org.apache.catalina.valves.CertificatesValve.invoke
> >> > (CertificatesValve.java:246)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:564)
> >> > 	at org.apache.catalina.core.StandardPipeline.invoke
> >> > (StandardPipeline.java:472)
> >> > 	at
> >>
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >> > 	at org.apache.catalina.core.StandardContext.invoke
> >> > (StandardContext.java:2343)
> >> > 	at org.apache.catalina.core.StandardHostValve.invoke
> >> > (StandardHostValve.java:180)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:566)
> >> > 	at org.apache.catalina.valves.ErrorDispatcherValve.invoke
> >> > (ErrorDispatcherValve.java:170)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:564)
> >> > 	at org.apache.catalina.valves.ErrorReportValve.invoke
> >> > (ErrorReportValve.java:170)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:564)
> >> > 	at org.apache.catalina.valves.AccessLogValve.invoke
> >> > (AccessLogValve.java:468)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:564)
> >> > 	at org.apache.catalina.core.StandardPipeline.invoke
> >> > (StandardPipeline.java:472)
> >> > 	at
> >>
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >> > 	at org.apache.catalina.core.StandardEngineValve.invoke
> >> > (StandardEngineValve.java:174)
> >> > 	at org.apache.catalina.core.StandardPipeline.invokeNext
> >> > (StandardPipeline.java:566)
> >> > 	at org.apache.catalina.core.StandardPipeline.invoke
> >> > (StandardPipeline.java:472)
> >> > 	at
> >>
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> >> > 	at org.apache.catalina.connector.http.HttpProcessor.process
> >> > (HttpProcessor.java:1012)
> >> > 	at org.apache.catalina.connector.http.HttpProcessor.run
> >> > (HttpProcessor.java:1107)
> >> > 	at java.lang.Thread.run(Thread.java:536)
> >> > 
> >> > 
> >> > 
> >---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> >> > For additional commands, e-mail: ojb-dev-help@db.apache.org
> >> > 
> >> > 
> >> 
> >> 
> >> 
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> >> For additional commands, e-mail: ojb-dev-help@db.apache.org
> >> 
> >> 
> >
> >
> >
> >---------------------------------------------
> >Résonance > http://www.resonance-online.com
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> >For additional commands, e-mail: ojb-dev-help@db.apache.org
> >
> 
> 
> This email and any attachments are strictly confidential and are
> intended
> solely for the addressee. If you are not the intended recipient you
> must
> not disclose, forward, copy or take any action in reliance on this
> message
> or its attachments. If you have received this email in error please
> notify
> the sender as soon as possible and delete it from your computer
> systems.
> Any views or opinions presented are solely those of the author and do
> not
> necessarily reflect those of HPD Software Limited or its affiliates.
> 
>  At present the integrity of email across the internet cannot be
> guaranteed
> and messages sent via this medium are potentially at risk.  All
> liability
> is excluded to the extent permitted by law for any claims arising as a
> re-
> sult of the use of this medium to transmit information by or to 
> HPD Software Limited or its affiliates.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 



---------------------------------------------
Résonance > http://www.resonance-online.com

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


Mime
View raw message