Oh and here is the content of the map.xml file. Perhaps the error is in
this file?
<?xml version="1.0" encoding="utf-8"?>
<data-map project-version="1.1">
<db-entity name="BUDGET" schema="IRF">
<db-attribute name="amount" type="DOUBLE"
isMandatory="true"/>
<db-attribute name="description" type="VARCHAR"
isMandatory="true" length="100"/>
<db-attribute name="project" type="VARCHAR"
isPrimaryKey="true" isMandatory="true" length="10"/>
</db-entity>
<obj-entity name="Budget" className="auto.Budget"
dbEntityName="BUDGET">
<qualifier><![CDATA[auto]]></qualifier>
<obj-attribute name="amount" type="java.lang.Double"
db-attribute-path="amount"/>
<obj-attribute name="description"
type="java.lang.String" db-attribute-path="description"/>
</obj-entity>
</data-map>
-----Original Message-----
From: Fredrik Liden
Sent: Monday, February 14, 2005 5:32 PM
To: cayenne-use..bjectstyle.org
Subject: Error running SelectQuery
Hi,
I'm trying to run a query and I get the following error (see trace
below).
Does anyone know what causes this error?
I get the error when I run the following line.
If someone could give me some pointers I'd be grateful.
List budgets = kontext.performQuery(query);
//--section that I'm trying to get to work--
DataContext kontext =
BasicServletConfiguration.getDefaultContext(session);
SelectQuery query = new SelectQuery(Budget.class);
List budgets = kontext.performQuery(query);
//------------------------------------------
//--if I run an sql template type of query it works--
// SQLTemplate rawSelect = new SQLTemplate(Budget.class, "select *
from BUDGET", true);
// rawSelect.setFetchLimit(1000);
// List artists = kontext.performQuery(rawSelect);
//--Stack trace---
Using CATALINA_BASE:
C:\fredriks\IntelliJ-IDEA-4.5\system\tomcat_Tomcat 5.5_c6174ff
Using CATALINA_HOME: C:\fredriks\jakarta-tomcat-5.5.7
Using CATALINA_TMPDIR: C:\fredriks\jakarta-tomcat-5.5.7\temp
Using JAVA_HOME: C:\Program Files\Java\jdk1.5.0_01
Feb 14, 2005 5:26:48 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Feb 14, 2005 5:26:48 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 766 ms
Feb 14, 2005 5:26:48 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 14, 2005 5:26:48 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
Feb 14, 2005 5:26:48 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
log4j:WARN No appenders could be found for logger
(org.apache.catalina.startup.TldConfig).
log4j:WARN Please initialize the log4j system properly.
INFO QueryLogger: Created connection pool:
jdbc:mysql://localhost/irf?user=root
Driver class: com.mysql.jdbc.Driver
Min. connections in the pool: 1
Max. connections in the pool: 1
Feb 14, 2005 5:26:49 PM org.apache.catalina.core.ApplicationContext log
INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain:
[org.apache.webapp.balancer.RuleChain:
[org.apache.webapp.balancer.rules.URLStringMatchRule: Target string:
News / Redirect URL: http://www.cnn.com],
[org.apache.webapp.balancer.rules.RequestParameterRule: Target param
name: paramName / Target param value: paramValue / Redirect URL:
http://www.yahoo.com],
[org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL:
http://jakarta.apache.org]]
Feb 14, 2005 5:26:50 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Feb 14, 2005 5:26:50 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Feb 14, 2005 5:26:50 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Feb 14, 2005 5:26:50 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Feb 14, 2005 5:26:50 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Feb 14, 2005 5:26:50 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Feb 14, 2005 5:26:50 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15 config=null
Feb 14, 2005 5:26:50 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Feb 14, 2005 5:26:50 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2234 ms
Connected to server
INFO QueryLogger: --- will run 1 query.
INFO QueryLogger: Opening connection:
jdbc:mysql://localhost/irf?user=root
Login: root
Password: *******
INFO QueryLogger: +++ Connecting: SUCCESS.
INFO QueryLogger: --- transaction started.
INFO QueryLogger: *** error.
org.objectstyle.cayenne.exp.ExpressionException: [v.1.1 December 6 2004]
Can't resolve path component: [Budget.auto].
at
org.objectstyle.cayenne.map.Entity$PathIterator.next(Entity.java:371)
at
org.objectstyle.cayenne.access.trans.QueryAssemblerHelper.appendObjPath(
QueryAssemblerHelper.java:125)
at
org.objectstyle.cayenne.access.trans.QualifierTranslator.objectNode(Qual
ifierTranslator.java:425)
at
org.objectstyle.cayenne.exp.Expression.traverse(Expression.java:569)
at
org.objectstyle.cayenne.exp.Expression.traverse(Expression.java:546)
at
org.objectstyle.cayenne.access.trans.QualifierTranslator.doTranslation(Q
ualifierTranslator.java:109)
at
org.objectstyle.cayenne.access.trans.SelectTranslator.createSqlString(Se
lectTranslator.java:150)
at
org.objectstyle.cayenne.access.trans.QueryAssembler.createStatement(Quer
yAssembler.java:131)
at
org.objectstyle.cayenne.access.DataNode.runSelect(DataNode.java:385)
at
org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:350
)
at
org.objectstyle.cayenne.access.DataDomain.performQueries(DataDomain.java
:654)
at
org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.ja
va:1408)
at
org.objectstyle.cayenne.access.Transaction.performQueries(Transaction.ja
va:179)
at
org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.ja
va:1366)
at
org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java
:1622)
at
org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java
:1485)
at
org.apache.jsp.hello_jsp._jspService(org.apache.jsp.hello_jsp:58)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:325)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:214)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
48)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:82
5)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:738)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:526)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow
erWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:684)
at java.lang.Thread.run(Thread.java:595)
ERROR StandardWrapper[:jsp]: Servlet.service() for servlet jsp threw
exception
org.objectstyle.cayenne.CayenneRuntimeException: [v.1.1 December 6 2004]
Query exception.
at
org.objectstyle.cayenne.access.util.SelectObserver.nextQueryException(Se
lectObserver.java:213)
at
org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:364
)
at
org.objectstyle.cayenne.access.DataDomain.performQueries(DataDomain.java
:654)
at
org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.ja
va:1408)
at
org.objectstyle.cayenne.access.Transaction.performQueries(Transaction.ja
va:179)
at
org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.ja
va:1366)
at
org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java
:1622)
at
org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java
:1485)
at
org.apache.jsp.hello_jsp._jspService(org.apache.jsp.hello_jsp:58)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:325)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:214)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
48)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:82
5)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:738)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:526)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow
erWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.objectstyle.cayenne.exp.ExpressionException: [v.1.1
December 6 2004] Can't resolve path component: [Budget.auto].
at
org.objectstyle.cayenne.map.Entity$PathIterator.next(Entity.java:371)
at
org.objectstyle.cayenne.access.trans.QueryAssemblerHelper.appendObjPath(
QueryAssemblerHelper.java:125)
at
org.objectstyle.cayenne.access.trans.QualifierTranslator.objectNode(Qual
ifierTranslator.java:425)
at
org.objectstyle.cayenne.exp.Expression.traverse(Expression.java:569)
at
org.objectstyle.cayenne.exp.Expression.traverse(Expression.java:546)
at
org.objectstyle.cayenne.access.trans.QualifierTranslator.doTranslation(Q
ualifierTranslator.java:109)
at
org.objectstyle.cayenne.access.trans.SelectTranslator.createSqlString(Se
lectTranslator.java:150)
at
org.objectstyle.cayenne.access.trans.QueryAssembler.createStatement(Quer
yAssembler.java:131)
at
org.objectstyle.cayenne.access.DataNode.runSelect(DataNode.java:385)
at
org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:350
)
... 27 more
This archive was generated by hypermail 2.0.0 : Mon Feb 14 2005 - 20:36:29 EST