Hi,

I'm getting the Exception below when trying to mix JDO annotations and
XML Meta data. I was originally only using annotations and that worked
OK until I switched from Scala 2.7.7 to Scala 2.8.0RC3. For the latter
the annotations do not work correct and therefore I had to switch to
also using XML meta data.

The package.jdo file has the following content:
<?xml version="1.0" encoding="UTF-8" ?>
<jdo xmlns="http://java.sun.com/xml/ns/jdo/jdo";
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
     xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdo
        http://java.sun.com/xml/ns/jdo/jdo_2_0.xsd";>

    <package name="net.vermaas.kivanotify.model">
        <class name="TrackerValue">
            <field name="name" primary-key="true" persistence-
modifier="persistent" value-strategy="identity"/>
            <field name="value" persistence-modifier="persistent"/>
        </class>
    </package>
</jdo>

The TrackerValue class is:

package net.vermaas.kivanotify.model
import javax.jdo.annotations.PersistenceCapable;

@PersistenceCapable
class TrackerValue(nm: String, vl: String)  {
  var name: java.lang.String = nm
  var value = vl
}

And when trying to query this table using the following code I get the
stack trace below the code:
    val name = "someName"

    val query = "select from " +
"net.vermaas.kivanotify.model.TrackerValue" + " where name == '" +
name + "'"
    val tvList =
persistenceManager.newQuery(query).execute.asInstanceOf[java.util.List[TrackerValue]]
    if (tvList.size == 0) {   // <<< EXCEPTION Thrown on this line...

The exception thrown is:

org.datanucleus.exceptions.NucleusObjectNotFoundException: No such
object (identity="")
        at
org.datanucleus.state.JDOStateManagerImpl.checkInheritance(JDOStateManagerImpl.java:
682)
        at
org.datanucleus.ObjectManagerImpl.findObjectUsingAID(ObjectManagerImpl.java:
2165)
        at
org.datanucleus.store.appengine.query.DatastoreQuery.entityToPojo(DatastoreQuery.java:
535)
        at
org.datanucleus.store.appengine.query.DatastoreQuery.entityToPojo(DatastoreQuery.java:
500)
        at org.datanucleus.store.appengine.query.DatastoreQuery.access
$300(DatastoreQuery.java:108)
        at org.datanucleus.store.appengine.query.DatastoreQuery
$6.apply(DatastoreQuery.java:618)
        at org.datanucleus.store.appengine.query.DatastoreQuery
$6.apply(DatastoreQuery.java:610)
        at
org.datanucleus.store.appengine.query.LazyResult.resolveNext(LazyResult.java:
94)
        at
org.datanucleus.store.appengine.query.LazyResult.resolveAll(LazyResult.java:
116)
        at
org.datanucleus.store.appengine.query.LazyResult.size(LazyResult.java:
110)
        at
org.datanucleus.store.appengine.query.StreamingQueryResult.size(StreamingQueryResult.java:
124)
        at net.vermaas.kivanotify.TrackerValues.get(TrackerValues.scala:19)
        at net.vermaas.kivanotify.gae.LPTESTServlet.doGet(LPTESTServlet.scala:
19)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
511)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1166)
        at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
51)

IMO there are 2 potential causes:
- Switch from Annotations to XML Meta data
- Upgrade to Scala2.8.0RC3

For both I'm in the dark on why it happens, any suggestions are
welcome.

Thanks,
Gero

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to