<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Palatla,<br>
    <br>
    I only saw in the documentation that the order of arguments in the
    sql-expression used in the function shortest_path_astar is slightly
    different from the one you are using:<br>
    <br>
    This is an example from the documentation
    (<a class="moz-txt-link-freetext" href="http://www.pgrouting.org/docs/1.x/astar.html">http://www.pgrouting.org/docs/1.x/astar.html</a>):<br>
    <br>
    <pre><span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">shortest_path_astar</span><span class="p">(</span><span class="s1">'SELECT gid AS id, source::int4,</span>
<span class="s1">             target::int4, length::double precision AS cost,length::double precision</span>
<span class="s1">        AS reverse_cost, x1, y1, x2, y2 FROM dourol'</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="k">true</span><span class="p">,</span> <span class="k">true</span><span class="p">);</span>
</pre>
    <br>
    As you can see, cost and reverse_cost are placed before the
    coordinates. Perhaps this might be the cause of the problem?<br>
    <br>
    Hope that helps,<br>
    <br>
    Birgit.<br>
    <br>
    <br>
    Am 22.02.2012 09:41, schrieb Palatla Srikanth:
    <blockquote
cite="mid:CAPou3n70SdCfi=+VjNeTEjkPsWFeWkOw8gCqTOahOU-H9Bn_9Q@mail.gmail.com"
      type="cite">
      <p class="MsoNormal"><span style="font-family:"Century
          Gothic","sans-serif"">Hi,</span></p>
      <p class="MsoNormal"><span style="font-family:"Century
          Gothic","sans-serif""> </span></p>
      <p class="MsoNormal"><span style="font-family:"Century
          Gothic","sans-serif"">We
          are developing an web application that users PostgreSQL 8.4 +
          PostGIS1.5 
          + Pgrouting 1.03 + development using (Java + Struts +
          Hibernate)</span></p>
      <p class="MsoNormal"><span style="font-family:"Century
          Gothic","sans-serif""> </span></p>
      <p class="MsoNormal"><b><span style="font-family:"Century
            Gothic","sans-serif"">When
            this Query is executed:</span></b></p>
      <p class="MsoNormal"><span style="font-family:"Century
          Gothic","sans-serif"">SELECT
          ST_AsText(the_geom),id AS Coords FROM delhi_road WHERE id IN
          (SELECT edge_id
          FROM shortest_path_astar('SELECT id, source,
          target,x1,y1,x2,y2,cost,reverse_cost from
          delhi_road',550,662,true,true))</span></p>
      <p class="MsoNormal"><span style="font-family:"Century
          Gothic","sans-serif""> </span></p>
      <p class="MsoNormal"><span style="font-family:"Century
          Gothic","sans-serif"">We
          are getting the below mentioned error and the other users
          accessing the
          application were too facing the database exceptions. Can
          someone help us to fix
          this issue</span>.</p>
      <p class="MsoNormal"> </p>
      <p class="MsoNormal">-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</p>
      <p class="MsoNormal"><b>Error from the postgreSQL query</b></p>
      <p class="MsoNormal"><span style="font-family:"Century
          Gothic","sans-serif""> </span></p>
      <p class="MsoNormal" style="margin-bottom:12.0pt">ERROR:  Error
        computing
        path: </p>
      <p class="MsoNormal">********** Error **********</p>
      <p class="MsoNormal" style="margin-bottom:12.0pt">ERROR: Error
        computing path: </p>
      <p class="MsoNormal">SQL state: 38001</p>
      <p class="MsoNormal"> </p>
      <p class="MsoNormal">------------------------------------------------------------------------</p>
      <p class="MsoNormal"><b>Query used:</b></p>
      <p class="MsoNormal"><b> </b></p>
      <p class="MsoNormal">SELECT ST_AsText(the_geom),id AS Coords FROM
        delhi_road
        WHERE id IN (SELECT edge_id FROM shortest_path_astar('SELECT id,
        source,
        target,x1,y1,x2,y2,cost,reverse_cost from
        delhi_road',550,662,true,true))</p>
      <p class="MsoNormal"> </p>
      <p class="MsoNormal">-------------------------------------------------------------------------</p>
      <p class="MsoNormal"><b>Error on the Application server (IDE)</b></p>
      <p class="MsoNormal"> </p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">[ INFO] 46:48
          (</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">MapServiceDAO.java:generateRoute:1525</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">Query
          is......SELECT
          ST_AsText(the_geom),id AS Coords FROM delhi_road WHERE id IN
          (SELECT edge_id
          FROM shortest_path_astar('SELECT id, source,
          target,x1,y1,x2,y2,cost,reverse_cost from
          delhi_road',550,662,true,true))</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10.0pt;font-family:"Courier New""> </span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier
          New';background-image:initial;background-color:yellow;background-repeat:initial
          initial">[
          INFO] 46:48 (</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy;background:yellow">MapServiceDAO.java:generateRoute:1552</span></u><span
          style="font-size:10pt;font-family:'Courier
          New';background-image:initial;background-color:yellow;background-repeat:initial
          initial">)</span><span
          style="font-size:10.0pt;font-family:"Courier
          New";background:yellow"></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier
          New';background-image:initial;background-color:yellow;background-repeat:initial
          initial">Exception
        </span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy;background:yellow">aala.........org.postgresql.util.PSQLException</span></u><span
          style="font-size:10pt;font-family:'Courier
          New';background-image:initial;background-color:yellow;background-repeat:initial
          initial">: ERROR: Error computing path: _</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10.0pt;font-family:"Courier New""> </span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">Feb 22, 2012
          11:46:48 AM
          org.apache.catalina.core.StandardWrapperValve invoke</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">SEVERE:
          Servlet.service() for servlet
          GenerateRoute threw exception</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">org.hibernate.SessionException</span></u><span
          style="font-size:10pt;font-family:'Courier New'">: Session was
          already closed</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          org.hibernate.impl.SessionImpl.close(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">SessionImpl.java:303</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          com.tis.hib.util.HibernateSessionFactory.closeSession(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">HibernateSessionFactory.java:86</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          com.tis.dao.impl.MapServiceDAO.generateRoute(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">MapServiceDAO.java:1572</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          com.tis.servlet.GenerateRoute.doGet(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">GenerateRoute.java:125</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          javax.servlet.http.HttpServlet.service(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">HttpServlet.java:690</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          javax.servlet.http.HttpServlet.service(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">HttpServlet.java:803</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">ApplicationFilterChain.java:290</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          org.apache.catalina.core.ApplicationFilterChain.doFilter(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">ApplicationFilterChain.java:206</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          org.apache.catalina.core.StandardWrapperValve.invoke(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">StandardWrapperValve.java:230</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          org.apache.catalina.core.StandardContextValve.invoke(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">StandardContextValve.java:175</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          org.apache.catalina.core.StandardHostValve.invoke(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">StandardHostValve.java:128</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          org.apache.catalina.valves.ErrorReportValve.invoke(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">ErrorReportValve.java:104</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          org.apache.catalina.core.StandardEngineValve.invoke(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">StandardEngineValve.java:109</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          org.apache.catalina.connector.CoyoteAdapter.service(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">CoyoteAdapter.java:261</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          org.apache.coyote.http11.Http11Processor.process(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">Http11Processor.java:844</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">Http11Protocol.java:581</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          org.apache.tomcat.util.net.JIoEndpoint$Worker.run(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">JIoEndpoint.java:447</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span><span
          style="font-size:10.0pt;font-family:"Courier New""></span></p>
      <p class="MsoNormal"><span
          style="font-size:10pt;font-family:'Courier New'">      at
          java.lang.Thread.run(</span><u><span
            style="font-size:10.0pt;font-family:"Courier
            New";color:navy">Thread.java:619</span></u><span
          style="font-size:10pt;font-family:'Courier New'">)</span></p>
      <p class="MsoNormal"><span style="font-family:"Century
          Gothic","sans-serif""> </span></p>
      <p class="MsoPlainText"><b>Regards,</b></p>
      <p class="MsoPlainText"><b>Palatla Srikanth</b></p>
      <p class="MsoPlainText"><br>
      </p>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
</pre>
    </blockquote>
  </body>
</html>