I have a simple 3 class example:

@PersistenceCapable
public class MyUser {
  @Persistent
  @Embedded
  private ContactDetails contactInfo;
...
}

@PersistenceCapable
@EmbeddedOnly
public class ContactDetails {
  @Persistent
  @Embedded
  private MyPostalAddress address
...
}

@PersistenceCapable
@EmbeddedOnly
public class MyPostalAddress {
  @Persistent
  private String postalAddress;
...
}

My main class
{
...
MyPostalAddress addr = new MyPostalAddress();
addr.setPostalAddress("123 Main St.");

ContactDetails cd = new ContactDetails();
cd.setAddress(addr);

MyUser user = new MyUser();
user.setContactInfo(cd).

pm.makePersistent(newUser);
tx.commit();
}


>>>>>>>>>>>>>>>>>>>
Once the makePersistent() call is invoked I receive the following
stacktrace.  If I don't have a nested embedded class and simply move
the MyPostalAddress out of ContactDetails and instead embed it into
MyUser everything works.  So I have 2 questions:

(1) The DataNucleus documentation (http://www.datanucleus.org/products/
accessplatform/jdo/orm/embedded.html#NestedPC) explicitly says the
nested embedded classes work with JDO but GAE documentation (http://
code.google.com/appengine/docs/java/datastore/
dataclasses.html#Embedded_Classes) doesn't mention that it does or
doesn't.  GAE only has a single example of an Embedded Class and that
is an inner class on top.  I have tried different paths but they all
point to GAE not supporting nested (more than 1 level deep) Embedded
Classes. Can anyone confirm or refute my conclusion?

(2)  Furthermore,  in my nested embedded class I also tried to have a
property that was a full entity onto itself (requires its own space)
and that was rejected.  I actually tried this model first and once
that didn't work I tried the simple example I gave above. My
stacktrace was different for this.  It was along the lines of index: 5
is out of bounds type message.  I didn't reproduce this since I
modified my code but it's all the same. So if somehow (show me please)
nested embedded classes work do they support non-simple properties
that are actually fully persistable entities themselves?

Thanks in advance.

STACKTRACE>>>>>>>>>>>>>>>>>>>>>>>


HTTP ERROR 500

Problem accessing /register.action. Reason:

    Specified class class java.lang.String is not persistable

Caused by:

javax.jdo.JDOFatalUserException: Specified class class
java.lang.String is not persistable
        at
org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:
354)
        at
org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:
674)
        at
org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:
694)
        at
com.camelspeed.core.service.authentication.DefaultUserRegistrationServiceImpl.register(DefaultUserRegistrationServiceImpl.java:
56)
        at
com.camelspeed.web.action.RegisterActionBean.register(RegisterActionBean.java:
48)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:
100)
        at net.sourceforge.stripes.controller.DispatcherHelper
$6.intercept(DispatcherHelper.java:467)
        at
net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:
158)
        at
net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:
113)
        at
net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:
155)
        at
net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:
74)
        at
net.sourceforge.stripes.controller.DispatcherHelper.invokeEventHandler(DispatcherHelper.java:
465)
        at
net.sourceforge.stripes.controller.DispatcherServlet.invokeEventHandler(DispatcherServlet.java:
278)
        at
net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:
160)
        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
net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:
247)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
        at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
        at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:
109)
        at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:
83)
        at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
        at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:
97)
        at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
        at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:
100)
        at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:355)

-- 
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