Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7634895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:18:00+00:00 2026-05-31T07:18:00+00:00

first post here, hoping someone could perhaps shed some light on an issue I’ve

  • 0

first post here, hoping someone could perhaps shed some light on an issue I’ve been trying to juggle…

As a part of a school project we’re attempting to build a interface to display points on a map and paths on a map.

For our first sprint I managed to work out storing/retrieving items using Objectify – it went great!

Now we’re trying to extend the functionality for our next spring. Having problems now trying to store an object of type MapPath (note MapPath and MapData, our two data types, both extend class Data). Brief code snippets as follows :

    @Entity
    public class Data extends JavaScriptObject
    {
        @Id
        Long id;
        private String name;
        private String dataSet;

     ...getters and setters
    }

    @Subclass
    public class MapData extends Data implements Serializable{
    {
        private String name;
        private String address;
        private String dataSet;
        @Embedded
        private Coordinate location;

            ....constructors, getters/setters
    }

    @Subclass
    public class PathData extends Data implements Serializable{

        private String name;
        private String address;
        private String dataSet;
        @Embedded
        private Coordinate[] path;

            ...etc
    }

Now hopefully I haven’t lost you yet. I have a DataService class that basically handles all transactions. I have the following unit test :

    @Test
    public void storeOnePath(){
        PathData pd = new PathData();
        pd.setName("hi");
        DataService.storeSingleton(pd);

        Data d = DataService.getSingleton("hi");

        assertEquals(pd,d);
    }    

The implementation of getSingleton is as follows :

    public static void storeSingleton(Data d){
        Objectify obj = ObjectifyService.begin();
        obj.put(d);
}

JUnit complains:

java.lang.ExceptionInInitializerError
    at com.teamrawket.tests.DataTest.storeOnePath(DataTest.java:59)
        ...<taken out>
Caused by: java.lang.IllegalStateException: Attempting to create multiple associations on class com.teamrawket.server.MapData for name
    at com.googlecode.objectify.impl.Transmog$Visitor.addRootSetter(Transmog.java:298)
    at com.googlecode.objectify.impl.Transmog$Visitor.visitField(Transmog.java:231)
    at com.googlecode.objectify.impl.Transmog$Visitor.visitClass(Transmog.java:134)
    at com.googlecode.objectify.impl.Transmog.<init>(Transmog.java:319)
    at com.googlecode.objectify.impl.ConcreteEntityMetadata.<init>(ConcreteEntityMetadata.java:75)
    at com.googlecode.objectify.impl.Registrar.registerPolymorphicHierarchy(Registrar.java:128)
    at com.googlecode.objectify.impl.Registrar.register(Registrar.java:62)
    at com.googlecode.objectify.ObjectifyFactory.register(ObjectifyFactory.java:209)
    at com.googlecode.objectify.ObjectifyService.register(ObjectifyService.java:38)
    at com.teamrawket.server.DataService.<clinit>(DataService.java:20)
    ... 27 more

What exactly does “attempting to create multiple associations on class … for name” imply?

Sorry for the long post and any formatting issues that may arise.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:18:02+00:00Added an answer on May 31, 2026 at 7:18 am

    You have repeated field names in your subclasses. You should not declare ‘name’ and ‘dataSet’ in both superclasses and subclasses; remove these fields from MapData and PathData and you should be fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first post here on stack overflow, hoping to get some advice on how to
Frequent visitor but first post here on StackOverflow, I'm hoping that you guys might
My first post here – hoping you can help me with designing an algorithm
First post here so sorry if I seem like a newb, I am trying
I was hoping not to have to post on here but I've been Googling
this is my first post here , I am trying to achive something in
first post here so sorry for the length of it. I've been lurking and
First post here... I normally develop using PHP and Symfony with Propel and ActionScript
first post here, and probably an easy one. I've got the code from Processing's
first post here, I come in peace :) I've searched but can't quite find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.