[google-appengine] Re: DatastoreNeedIndexException: no matching index found.

2010-08-02 Thread Coutinho
Odd it seems it was cuz the object is uppercase... but.. locally they
are not upper case.
Why the objects are being created as upper case in gae server? Why
they are not in Dev server? And how i can change it?

On Jul 29, 10:12 am, Coutinho rafael.couti...@gmail.com wrote:
 I have an index serving like the following:

 FoodCategory
 isMainCategory ▲ , name ▲   Serving

 And I have the following query:
 select from FoodCategory where isMainCategory=true order by name

 However i always get:
 com.google.appengine.api.datastore.DatastoreNeedIndexException: no
 matching index found..

 Why is that?

 another question is, i don't know why the auto index file created 2indexesone 
 for FoodCategory and another for the same but alluppercaseFOODCATEGORY

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Re: DatastoreNeedIndexException: no matching index found.

2009-08-04 Thread Jason (Google)
Are you sure that this is the only query in your application? Do you have
auto-generation of indexes enabled? By any chance, have you tried using the
non-JDOQL syntax?
Query query = pm.newQuery(Entry.class);
ListEntry results = (ListEntry) query.execute();

- Jason

On Sun, Aug 2, 2009 at 11:31 AM, Sudan sudan.ce...@googlemail.com wrote:


 Hello,

 I have a very simple web application which retrieves objets from the
 datastore with the following query:

 select from  + Entry.class.getName();

 Entry is the persistence capable class, full body off which is given
 at the end of this mail. My application works fine on the hosted mode,
 and on 127.0.0.1:8080. But when I deploy the application, I get the
 following error in the server logs (shortened for clarity):

 com.google.appengine.api.datastore.DatastoreNeedIndexException: no
 matching index found.

 If I try to manually add an index to the datastore-indexes.xml file,
 then the deploy fails saying that this index was not necessary and
 cannot be created. I can see that new entries are being added to the
 datastore via the application but getting them raises this exception.

 Can someone with experience with indexes on GAE help me understand why
 the indexes are not autogenerated for this simople query?

 package com.sudancevap.app.server;

 import java.util.Date;

 import javax.jdo.annotations.IdGeneratorStrategy;
 import javax.jdo.annotations.IdentityType;
 import javax.jdo.annotations.PersistenceCapable;
 import javax.jdo.annotations.Persistent;
 import javax.jdo.annotations.PrimaryKey;

 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class Entry {

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Long id;

  @Persistent
  private Date date;

  @Persistent
  private String content;

  public Entry(String entryText) {
this.content = entryText;
  }

  // getters, setters for private fields
 }

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: DatastoreNeedIndexException: no matching index found.

2009-07-14 Thread GArchitect

Hi Nick,

The id field was from the examples.  Anyway, was trying to remove the
old index but without success (no remove in Java SDK, and no success
with the Python SDK either). Right now I have both the old and the new
index running on the server (the new one is just the old one with id
removed) so perhaps there may be conflicts.

Or should I just create a totally new class name with the right fields
and build the index on those new classes for now until the Java vacuum
index is ready?

Best,

Tommy

On 7月7日, 下午9時54分, Nick Johnson (Google) nick.john...@google.com
wrote:
 Hi GArchitect,

 The index you list isn't suitable for that query - the index includes
 the 'id' field at the start, but you don't appear to be filtering or
 sorting on it.

 -Nick Johnson



 On Mon, Jul 6, 2009 at 4:28 AM, GArchitecttommy...@gmail.com wrote:

  Hi, I got the following exception in a method executing a query:

  C 07-05 07:23PM 42.069
  Uncaught exception from servlet
  com.google.appengine.api.datastore.DatastoreNeedIndexException: no
  matching index found.
         at
  com.google.appengine.api.datastore.DatastoreApiHelper.translateError
  (DatastoreApiHelper.java:34)
         at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
  (DatastoreApiHelper.java:55)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
  $PreparedQueryImpl.runQuery(DatastoreServiceImpl.java:310)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
  $PreparedQueryImpl.access$100(DatastoreServiceImpl.java:240)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
  $PreparedQueryImpl$1.iterator(DatastoreServiceImpl.java:269)
         at
  org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterable.iterator
  (RuntimeExceptionWrappingIterable.java:42)
         at org.datanucleus.store.appengine.query.StreamingQueryResult.init
  (StreamingQueryResult.java:72)
         at
  org.datanucleus.store.appengine.query.DatastoreQuery.fulfillEntityQuery
  (DatastoreQuery.java:253)
         at 
  org.datanucleus.store.appengine.query.DatastoreQuery.performExecute
  (DatastoreQuery.java:220)
         at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
  (JDOQLQuery.java:85)
         at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
  (JDOQLQuery.java:31)
         at org.datanucleus.store.query.Query.executeQuery(Query.java:1466)
         at org.datanucleus.store.query.Query.executeWithArray(Query.java:
  1340)
         at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:240)
         at
  com.solveware.gwt.sample.stockwatcher.server.HistoricalQuote.getAllQuotesOnSymbol
  (HistoricalQuote.java:130)
  ...

  However, according to the admin console, the required index is up and
  running

  HistoricalQuote
  id ▲ , symbol ▲ , date ▲  Serving

  And the code for executing the query:

           public static ListHistoricalQuote getAllQuotesOnSymbol(String
  symbol) {
                     PersistenceManager pm = 
  PMF.get().getPersistenceManager();
                     Query query = pm.newQuery(HistoricalQuote.class);
                     query.setFilter(symbol == userSubmittedSymbol);
                     query.setOrdering(date ASC);
                     query.declareParameters(String userSubmittedSymbol);
                     ListHistoricalQuote entries = (ListHistoricalQuote)
  query.execute(symbol);
                     return entries;
           }

  So I wonder if anyone can shed some light on why this is happening?
  Is it a problem on the GAE side that is waiting to be fixed?

  Any help is appreciated.  Thanks.

  Best,

  Tommy

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: DatastoreNeedIndexException: no matching index found.

2009-07-14 Thread Nick Johnson (Google)

Hi GArchitect,

There's no problem with having both indexes. But the index you listed
isn't compatible with the query you provided.

-Nick Johnson

On Tue, Jul 14, 2009 at 10:12 AM, GArchitecttommy...@gmail.com wrote:

 Hi Nick,

 The id field was from the examples.  Anyway, was trying to remove the
 old index but without success (no remove in Java SDK, and no success
 with the Python SDK either). Right now I have both the old and the new
 index running on the server (the new one is just the old one with id
 removed) so perhaps there may be conflicts.

 Or should I just create a totally new class name with the right fields
 and build the index on those new classes for now until the Java vacuum
 index is ready?

 Best,

 Tommy

 On 7月7日, 下午9時54分, Nick Johnson (Google) nick.john...@google.com
 wrote:
 Hi GArchitect,

 The index you list isn't suitable for that query - the index includes
 the 'id' field at the start, but you don't appear to be filtering or
 sorting on it.

 -Nick Johnson



 On Mon, Jul 6, 2009 at 4:28 AM, GArchitecttommy...@gmail.com wrote:

  Hi, I got the following exception in a method executing a query:

  C 07-05 07:23PM 42.069
  Uncaught exception from servlet
  com.google.appengine.api.datastore.DatastoreNeedIndexException: no
  matching index found.
         at
  com.google.appengine.api.datastore.DatastoreApiHelper.translateError
  (DatastoreApiHelper.java:34)
         at 
  com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
  (DatastoreApiHelper.java:55)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
  $PreparedQueryImpl.runQuery(DatastoreServiceImpl.java:310)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
  $PreparedQueryImpl.access$100(DatastoreServiceImpl.java:240)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
  $PreparedQueryImpl$1.iterator(DatastoreServiceImpl.java:269)
         at
  org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterable.iterator
  (RuntimeExceptionWrappingIterable.java:42)
         at org.datanucleus.store.appengine.query.StreamingQueryResult.init
  (StreamingQueryResult.java:72)
         at
  org.datanucleus.store.appengine.query.DatastoreQuery.fulfillEntityQuery
  (DatastoreQuery.java:253)
         at 
  org.datanucleus.store.appengine.query.DatastoreQuery.performExecute
  (DatastoreQuery.java:220)
         at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
  (JDOQLQuery.java:85)
         at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
  (JDOQLQuery.java:31)
         at org.datanucleus.store.query.Query.executeQuery(Query.java:1466)
         at org.datanucleus.store.query.Query.executeWithArray(Query.java:
  1340)
         at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:240)
         at
  com.solveware.gwt.sample.stockwatcher.server.HistoricalQuote.getAllQuotesOnSymbol
  (HistoricalQuote.java:130)
  ...

  However, according to the admin console, the required index is up and
  running

  HistoricalQuote
  id ▲ , symbol ▲ , date ▲  Serving

  And the code for executing the query:

           public static ListHistoricalQuote getAllQuotesOnSymbol(String
  symbol) {
                     PersistenceManager pm = 
  PMF.get().getPersistenceManager();
                     Query query = pm.newQuery(HistoricalQuote.class);
                     query.setFilter(symbol == userSubmittedSymbol);
                     query.setOrdering(date ASC);
                     query.declareParameters(String userSubmittedSymbol);
                     ListHistoricalQuote entries = (ListHistoricalQuote)
  query.execute(symbol);
                     return entries;
           }

  So I wonder if anyone can shed some light on why this is happening?
  Is it a problem on the GAE side that is waiting to be fixed?

  Any help is appreciated.  Thanks.

  Best,

  Tommy

 --
 Nick Johnson, App Engine Developer Programs Engineer
 Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
 Number: 368047
 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: DatastoreNeedIndexException: no matching index found.

2009-07-07 Thread Nick Johnson (Google)

Hi GArchitect,

The index you list isn't suitable for that query - the index includes
the 'id' field at the start, but you don't appear to be filtering or
sorting on it.

-Nick Johnson

On Mon, Jul 6, 2009 at 4:28 AM, GArchitecttommy...@gmail.com wrote:

 Hi, I got the following exception in a method executing a query:

 C 07-05 07:23PM 42.069
 Uncaught exception from servlet
 com.google.appengine.api.datastore.DatastoreNeedIndexException: no
 matching index found.
        at
 com.google.appengine.api.datastore.DatastoreApiHelper.translateError
 (DatastoreApiHelper.java:34)
        at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
 (DatastoreApiHelper.java:55)
        at com.google.appengine.api.datastore.DatastoreServiceImpl
 $PreparedQueryImpl.runQuery(DatastoreServiceImpl.java:310)
        at com.google.appengine.api.datastore.DatastoreServiceImpl
 $PreparedQueryImpl.access$100(DatastoreServiceImpl.java:240)
        at com.google.appengine.api.datastore.DatastoreServiceImpl
 $PreparedQueryImpl$1.iterator(DatastoreServiceImpl.java:269)
        at
 org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterable.iterator
 (RuntimeExceptionWrappingIterable.java:42)
        at org.datanucleus.store.appengine.query.StreamingQueryResult.init
 (StreamingQueryResult.java:72)
        at
 org.datanucleus.store.appengine.query.DatastoreQuery.fulfillEntityQuery
 (DatastoreQuery.java:253)
        at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute
 (DatastoreQuery.java:220)
        at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
 (JDOQLQuery.java:85)
        at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
 (JDOQLQuery.java:31)
        at org.datanucleus.store.query.Query.executeQuery(Query.java:1466)
        at org.datanucleus.store.query.Query.executeWithArray(Query.java:
 1340)
        at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:240)
        at
 com.solveware.gwt.sample.stockwatcher.server.HistoricalQuote.getAllQuotesOnSymbol
 (HistoricalQuote.java:130)
 ...

 However, according to the admin console, the required index is up and
 running

 HistoricalQuote
 id ▲ , symbol ▲ , date ▲  Serving

 And the code for executing the query:

          public static ListHistoricalQuote getAllQuotesOnSymbol(String
 symbol) {
                    PersistenceManager pm = PMF.get().getPersistenceManager();
                    Query query = pm.newQuery(HistoricalQuote.class);
                    query.setFilter(symbol == userSubmittedSymbol);
                    query.setOrdering(date ASC);
                    query.declareParameters(String userSubmittedSymbol);
                    ListHistoricalQuote entries = (ListHistoricalQuote)
 query.execute(symbol);
                    return entries;
          }

 So I wonder if anyone can shed some light on why this is happening?
 Is it a problem on the GAE side that is waiting to be fixed?

 Any help is appreciated.  Thanks.

 Best,

 Tommy

 




-- 
Nick Johnson, App Engine Developer Programs Engineer
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
Number: 368047

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: DatastoreNeedIndexException: no matching index found.

2009-07-06 Thread GArchitect

Update: I get the following error when I try to access the datastore
index link again:

Server Error
A server error has occurred.

I am not sure if this error is related to the index problem, or to
exceeding quota.  Please note that the quota was not exceeded when I
post the last error / exception message.  It is very strange now as I
was able to click into the datastore index page/link when I posted the
last error, but now I can't even access it anymore.

And I am having trouble deploying the modified application.  I get
errors saying it failed to upload / create the index at the server.  I
wonder if something is wrong with the index on the server right now?
Is anyone else having similar problems?

Any light would be appreciated.

Tommy




On 7月6日, 上午11時28分, GArchitect tommy...@gmail.com wrote:
 Hi, I got the following exception in a method executing a query:

 C 07-05 07:23PM 42.069
 Uncaught exception from servlet
 com.google.appengine.api.datastore.DatastoreNeedIndexException: no
 matching index found.
         at
 com.google.appengine.api.datastore.DatastoreApiHelper.translateError
 (DatastoreApiHelper.java:34)
         at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
 (DatastoreApiHelper.java:55)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
 $PreparedQueryImpl.runQuery(DatastoreServiceImpl.java:310)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
 $PreparedQueryImpl.access$100(DatastoreServiceImpl.java:240)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
 $PreparedQueryImpl$1.iterator(DatastoreServiceImpl.java:269)
         at
 org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterable.iter­ator
 (RuntimeExceptionWrappingIterable.java:42)
         at org.datanucleus.store.appengine.query.StreamingQueryResult.init
 (StreamingQueryResult.java:72)
         at
 org.datanucleus.store.appengine.query.DatastoreQuery.fulfillEntityQuery
 (DatastoreQuery.java:253)
         at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute
 (DatastoreQuery.java:220)
         at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
 (JDOQLQuery.java:85)
         at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
 (JDOQLQuery.java:31)
         at org.datanucleus.store.query.Query.executeQuery(Query.java:1466)
         at org.datanucleus.store.query.Query.executeWithArray(Query.java:
 1340)
         at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:240)
         at
 com.solveware.gwt.sample.stockwatcher.server.HistoricalQuote.getAllQuotesOn­Symbol
 (HistoricalQuote.java:130)
 ...

 However, according to the admin console, the required index is up and
 running

 HistoricalQuote
 id ▲ , symbol ▲ , date ▲  Serving

 And the code for executing the query:

           public static ListHistoricalQuote getAllQuotesOnSymbol(String
 symbol) {
                     PersistenceManager pm = PMF.get().getPersistenceManager();
                     Query query = pm.newQuery(HistoricalQuote.class);
                     query.setFilter(symbol == userSubmittedSymbol);
                     query.setOrdering(date ASC);
                     query.declareParameters(String userSubmittedSymbol);
                     ListHistoricalQuote entries = (ListHistoricalQuote)
 query.execute(symbol);
                     return entries;
           }

 So I wonder if anyone can shed some light on why this is happening?
 Is it a problem on the GAE side that is waiting to be fixed?

 Any help is appreciated.  Thanks.

 Best,

 Tommy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: DatastoreNeedIndexException: no matching index found after app uploaded to Google

2009-05-07 Thread Ted O'Connor

I got the same error.  My problem was that the index that was auto
generated for my query was still being built.  Check the Datastore
Indexes page in your Dashboard.


On May 5, 12:25 am, JY jy2...@gmail.com wrote:
 I have a very simple java web app, tested on local 127.0.0.1, without
 any problem, but got error on Google.

 The model is plain pojo, and the function is straight forward
 ListMyModel results = new ArrayList();
                 PersistenceManager pm = PersistenceManagerSingeton.instance
 ().getPersistenceManager();
                 int startId = pageNumber*pageSize;
                 int endId = startId+pageSize+1;
                 Query query = pm.newQuery(MyModel.class);
             query.setOrdering(id desc);
             query.setRange(startId, endId);
             try {
                 results = (List MyModel ) query.execute();

             } finally {
                 query.closeAll();
                 pm.close();
             }
 The id is the PK
         @PrimaryKey
     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
         private Long id;

 This works fine on my local testing (Eclipse+App-Engine-Plug-in)

 Today, I got account approval email from Google, and uploaded this app
 to app-engine. However when I was testing it, always got below error:

 com.google.appengine.api.datastore.DatastoreNeedIndexException: no
 matching index found.
         at
 com.google.appengine.api.datastore.DatastoreApiHelper.translateError
 (DatastoreApiHelper.java:34)
         at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
 (DatastoreApiHelper.java:55)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
 $PreparedQueryImpl.runQuery(DatastoreServiceImpl.java:310)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
 $PreparedQueryImpl.access$100(DatastoreServiceImpl.java:240)
         at com.google.appengine.api.datastore.DatastoreServiceImpl
 $PreparedQueryImpl$1.iterator(DatastoreServiceImpl.java:269)
         at
 org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterable.iter­ator
 (RuntimeExceptionWrappingIterable.java:42)
         at org.datanucleus.store.appengine.query.StreamingQueryResult.init
 (StreamingQueryResult.java:72)
         at
 org.datanucleus.store.appengine.query.DatastoreQuery.fulfillEntityQuery
 (DatastoreQuery.java:253)
         at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute
 (DatastoreQuery.java:220)
         at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
 (JDOQLQuery.java:85)
         at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
 (JDOQLQuery.java:31)
         at org.datanucleus.store.query.Query.executeQuery(Query.java:1466)
         at org.datanucleus.store.query.Query.executeWithArray(Query.java:
 1340)
         at org.datanucleus.store.query.Query.execute(Query.java:1313)
         at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:218)

 My understanding is that query as simple as above, should not need
 manual index.
 I noticed there was nothing the generated datastore-indexes-auto.xml,
 just datastore-indexes/. It makes sense since all my operations are
 save, delete and select-all-type of query

 I even tried creating manually the datastore-index.xml with below:
 ?xml version=1.0 encoding=utf-8?
 datastore-indexes
   xmlns=http://appengine.google.com/ns/datastore-indexes/1.0;
   autoGenerate=true
     datastore-index kind=WordeePuzzle ancestor=false
         property name=id direction=desc /
     /datastore-index

 /datastore-indexes

 Tested on Google, and got same error.

 Please help

 Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---