One possibility I can think of: if you have an @Embedded raw Collection
or Collection<Object> that is declared polymorphic=false then Twig will
try to create Objects to put in it when it reads instances back again.
I would clean the local datastore and run tests to see when the Objects
appear in the datastore. You could also set a conditional break point
in BaseObjectDatastore.servicePut() to see when an Entity with that kind
name is put in the datastore.
This could be a bug related to entering a null value into a Collection
of references. Add a check that you are not storing null when you add a
reference to an Item. null is not a valid referenced item, but none of
the tests cover trying to add null.
Make sure you have the latest source
http://code.google.com/p/twig-persist/wiki/Integration2_0 and with your
null check in place you should be able to remove the references to
Object with the datastore viewer and delete the Entities with kind
java_lang_Object.
Well this only happened in the deployed version. I do have an idea of what it is since on of my pages bombed due to a casting error from Object to Item. Here is my model: public class Registry implements Serializable { List<Item> items; } An Item entity got created as an object but added to the the items list.. Any idea why this sporadically happened? See 48002L. items value: [datastore_types.Key.from_path(u'Item', 33002L, _app=u's~g'), datastore_types.Key.from_path(u'Item', 41001L, _app=u's~g'), datastore_types.Key.from_path(u'Item', 44002L, _app=u's~g'), datastore_types.Key.from_path(u'Item', 44004L, _app=u's~g'), datastore_types.Key.from_path(u'Item', 47005L, _app=u's~g'), datastore_types.Key.from_path(u'java_lang_Object', 48002L, _app=u's~g'), datastore_types.Key.from_path(u'Item', 40011L, _app=u's~g')]
No, if you include the source in your project you don't need any twig
jars. Thats what makes it such an easy way to deploy. Everything gets
put into your WEB-INF/classes folder by Eclipse
i was able to build the jar with the link you provided. but now have to change all my imports to com.vercer and some of my methods are missing. Is this right behavior? Like the returnUnique and the DefaultConfiguration.registerTypeName methods... what can i replace these with?
What exactly are you doing and what exactly is the stack trace?
OK, you're original code is correct. The second form you showed above
is the v1.0 API which you mistakenly built. Forget that.
The error you are getting is due to a missing Guava jar. Follow the
directions in the link I sent earlier which explain where to get it and
where to put it.
Definitely look like you are missing the guava jar from WEB-INF/lib or
it could be corrupt. Try replacing it.
If you get this error:
java.lang.NoSuchMethodError:
com.google.common.collect.Maps.newConcurrentMap()Ljava/util/concurrent/
ConcurrentMap;
then the guava jar is not being found. The method is there:
twig built successfully against its own version of it.
The only possibility I can think of is that you have an older version of guava or google collections in your lib directory.
Yes I mean do not add any null values to the collection of references
items.
I have just been looking through the code in
StandardMultipleStoreCommand that is used to store the referenced
items. I can see a check that I added for instances that were already
stored to filter out any null values. This could happen if an
collection of instances are stored and one of them (ItemA) references
another one (ItemB) in the collection. Then Twig would store the ItemB
as it stored itemA because it follows references. Then when tries to
store ItemB again but finds that it is already stored.
In other words I think there was a bug that has been fixed that could
have allowed a NULL_VALUE to be stored.
I'm not sure that this is what you are coming across but it could be
>
> Here is the stacktrace that i got before.
> java.lang.UnsupportedOperationException: Not yet implemented
> at
That is from v1.0 which you built by mistake.
Yes I mean do not add any null values to the collection of references items.
I have just been looking through the code in
StandardMultipleStoreCommand that is used to store the referenced items.
I can see a check that I added for instances that were already stored
to filter out any null values. This could happen if an collection of
instances are stored and one of them (ItemA) references another one
(ItemB) in the collection. Then Twig would store the ItemB as it stored
itemA because it follows references. Then when tries to store ItemB
again but finds that it is already stored and returns null.
In other words I think there was a bug that has been fixed that could
have allowed a NULL_VALUE to be stored.
I'm not sure that this is what you are coming across but it could be if
Item references other Items
>
> Here is the stacktrace that i got before.
> java.lang.UnsupportedOperationException: Not yet implemented
> at
That is from v1.0 which you built by mistake.