SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Multiple Ids, Exception: Cannot marshall ids, not supported id object type

This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 35 - Pages: 3 [ 1 2 3 | Next ] - Last Post: Dec 3, 2011 4:37 AM Last Post By: longchamp
mutable

Posts: 19
Registered: 1/7/08
Multiple Ids, Exception: Cannot marshall ids, not supported id object type
Posted: Feb 24, 2008 2:11 AM
 
  Click to reply to this thread Reply
Hello.
I'm trying to use new @SearchableIdComponent annotation.
I have following classes which represents one file version.

public class BaseEnity {
@SearchableId
Long id;
}

@Searchable(root = false)
public class Document extends BaseEntity {
@SearchableProperty
String comment;
List<DocumentAttachement> attachements;
}

@Searchable
public class DocumentAttachement extends BaseEntity {
@SearchableComponent
Document document;
@SearchableIdComponent
FileInfo fileInfo;
}

@Searchable(root = false)
public class FileInfo extends BaseEntity {
@SearchableId
String fileId;
@SearchableProperty
String name;
}

Then (after these objects are wired), I save the non-root class (this also saves others) to database:

FileInfo fileInfo;
DocumentAttachement documentAttachement;
Document document;
{ ... wiring them together ... }
dao.save(document);

And it throws ConversionException:

.... Cannot marshall ids, not supported id object type [java.lang.Long] and value [123], or you have not defined ids in the mapping files

There is some problem with Ids, I looked at ClassMappingConverter, but I can't still figure out what is the problem.
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Multiple Ids, Exception: Cannot marshall ids, not supported id object t
Posted: Feb 24, 2008 5:46 PM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
I am not sure if this is the problem, but you are trying to save a Document with root="false"... . You can only save root documents (or non root ones with cascading). Though still, I would have expected a different exception, so your case might be different.

Is there a chance that you can create a simple test case similar to what Compass has in its test package? Have a look at: org.compass.annotations.test.idcomponent.
mutable

Posts: 19
Registered: 1/7/08
Re: Multiple Ids, Exception: Cannot marshall ids, not supported id object t
Posted: Feb 27, 2008 4:17 PM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Hello.
So I looked at your tests and also added @SearchableParent annotation. Results was same. So I decided to simplify it. Now I have just one root searchable class FileInfo:

public abstract class BaseEntity {
@Id
@SearchableId
private Long id;
[ ... ]
}

@Searchable
public class FileInfo extends BaseEntity {
@SearchableId
private String fileId; // This is not Hibernate ID
[ ... ]
}

Now, when I try to save object (which holds particular FileInfo instance) through Hibernate it throws:

org.compass.gps.device.hibernate.HibernateGpsDeviceException: {hibernateDevice}: Failed while creating [cz.lofas.docm.model.FileInfo@7b603f4e]; nested exception is org.compass.core.converter.ConversionException: Cannot marshall ids, not supported id object type [java.lang.Long] and value [6], or you have not defined ids in the mapping files
mutable

Posts: 19
Registered: 1/7/08
Re: Multiple Ids, Exception: Cannot marshall ids, not supported id object t
Posted: Feb 27, 2008 8:36 PM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
The exception is thrown from org.compass.core.converter.mapping.osem.ClassMappingConverter#unmarshallIds

stack trace:
org.compass.gps.device.hibernate.HibernateGpsDeviceException: {hibernateDevice}: Failed while creating [cz.lofas.docm.model.FileInfo@7b603f41]; nested exception is org.compass.core.converter.ConversionException: Cannot marshall ids, not supported id object type [java.lang.Long] and value [9], or you have not defined ids in the mapping files
org.compass.core.converter.ConversionException: Cannot marshall ids, not supported id object type [java.lang.Long] and value [9], or you have not defined ids in the mapping files
at org.compass.core.converter.mapping.osem.ClassMappingConverter.unmarshallIds(ClassMappingConverter.java:405)
at org.compass.core.marshall.DefaultMarshallingStrategy.unmarshallIds(DefaultMarshallingStrategy.java:128)
at org.compass.core.marshall.DefaultMarshallingStrategy.marshallIds(DefaultMarshallingStrategy.java:95)
at org.compass.gps.device.hibernate.lifecycle.HibernateEventListener$1.doInCompassWithoutResult(HibernateEventListener.java:79)
at org.compass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29)
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:132)
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:114)
at org.compass.gps.impl.SingleCompassGps.executeForMirror(SingleCompassGps.java:165)
at org.compass.gps.device.hibernate.lifecycle.HibernateEventListener.onPostInsert(HibernateEventListener.java:77)
at org.hibernate.action.EntityIdentityInsertAction.postInsert(EntityIdentityInsertAction.java:90)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:66)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:186)
...

I'm absolutely confused from this method. It should throw exception everytime because I have String and Long ids which aren't instance of Resouce, class containing these ids isn't assignable from them, id parameter (which I found when I was exploring stack is supplied by Hibernate) is not Array and id count is greater than 1. However your id test (with MultipleId) passed...
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Multiple Ids, Exception: Cannot marshall ids, not supported id object t
Posted: Feb 29, 2008 5:30 AM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
Thanks to the full stack trace I understand now what happens. Compass actually easily supports such mappings, but with the Hibernate integration, what happens is that the Hibernate listener takes the id from Hibernate and marshalls that into the object using Compass mappings. I had to do this due to the fact that Hibernate was not initializing the ids of the object during that stage in the event listener.

Now, things fails since there is a difference between the id mappings in Compass and in Hibernate.

As far as I remember, I believe Hibernate fixed this in recent versions. I will add a flag that will allow to disable this behavior in Hibernate, and I even consider defaulting this to not perform this id operations. Check this issues for progress: CMP-557.
louisvuittonbox

Posts: 411
Registered: 8/23/11
Re: Multiple Ids, Exception: Cannot marshall ids, not supported id object type
Posted: Aug 23, 2011 10:08 PM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
Sports brand Nike (Nike) has announced the new 2010 summer footwear, including the nike air max, Tennis Classic, and Air Max 90 Current Torch three groups. nike shox which are yellow, orange, and blue color, with some bright colors there is a refreshing feeling. Tennis Classic with a white and green color, low-cut shoes suitable for summer wear. And with the nike air jordan of the latest technology Torch nike shoes uk Current Torch shoes are hit with the classic black and white color with the toe position with the Torch materials, mining forefoot nike air max 2011 Free technology coupled with the classic appearance , reflecting the retro and technology integration.
hmq123

Posts: 449
Registered: 8/22/11
christian louboutin
Posted: Aug 24, 2011 10:52 PM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
How christian louboutin should I heard cheap louboutin shoes that, about your right discount christian louboutin shoes and wrong? How Christian Louboutin Pumps should I heard, was able to Christian Louboutin Ankle Boots smile? How should I heard, you good, for her not to let the http://www.louboutinsshoes2u.com/ tears?
hmq123

Posts: 449
Registered: 8/22/11
Louboutins Shoes Sale
Posted: Aug 24, 2011 10:53 PM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
Fresh Louboutins Shoes Sale sweet smile like the Christian Louboutin Shoes wine you drink, the more Cheap Christian Louboutin mellow Christian Louboutin Glitter Pumps life, elegant lingering smile Cheap Louboutin Booties like read the poem, the more http://www.louboutinsshoes4sale.com/ romantic life.
hmq123

Posts: 449
Registered: 8/22/11
Discount Christian Louboutin Shoes
Posted: Aug 24, 2011 10:54 PM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
A smile Discount Christian Louboutin Shoes is healthy, the smile Christian Louboutin Shoes is success, but only Christian Louboutin sale smile and life, and life Cheap Wedding Shoes road to the colorful, just Christian Louboutin Ankle Boots won't give his life with http://www.cheap-christianlouboutinpumps.com/ regrets.
hmq123

Posts: 449
Registered: 8/22/11
Cheap Louboutins
Posted: Aug 24, 2011 10:56 PM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
A smile is the most Cheap Louboutins moving people expression, Christian Louboutin Shoes life is good and silent Christian Louboutin Discount language, only smile Christian Louboutin Wedding life, the Louboutin Open-toe Booties mood will be relaxed and http://www.cheaplouboutins-shop.com/ cheerful.
hmq123

Posts: 449
Registered: 8/22/11
New Moncler Jackets
Posted: Aug 24, 2011 10:57 PM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
Self-confidence New Moncler Jackets is not conceit, it is not proud, New Moncler Coats is important, Moncler Online Store is the spiritual pillar of the Cheap Moncler Men Jackets behavior of the Moncler Jackets Women self, self motivation is the incentive to overcome difficulties reach the goal of http://www.moncler-officialwebsite.com/ energy.
hmq123

Posts: 449
Registered: 8/22/11
christian louboutin sale
Posted: Aug 24, 2011 10:58 PM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
In middle christian louboutin sale age, experience christian louboutin shoes rains and winds, have discount louboutin sale seen the rainbow. Through Christian Louboutin Peep Toe Pumps pain, also get the Christian Louboutin Sandal Booties joy. Experienced setbacks, and bear witness to the http://www.discountlouboutins-sale.com/ success.
pylxwzhj

Posts: 719
Registered: 10/15/11
Re: Multiple Ids, Exception: Cannot marshall ids, not supported id object type
Posted: Oct 16, 2011 3:05 AM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
All of

LV Bags

the proposed

Louis Vuitton Handbags

sanctions carry

Coach Outlet Store

with them

Chanel Purses

considerable political

Coach Factory Store

and economic

Coach Factory Outlet

risks. While

Chanel Bag

Yukiya Amano, the

Coach Factory Outlet

cautious director general

Chanel Purses

of the atomic

Coach Factory Store

energy agency

Coach Factory

, talked publicly

Chanel Bags

in September

Chanel Handbags

about publishing

Moncler Jackets

some of the

Louis Vuitton Handbags

most delicate

Coach Outlet

data suggesting

Chanel Bags

Iran worked on

Moncler Shop

nuclear triggers

Coach Outlet Online

and warheads, officials who have spoken with him say he is concerned that his inspectors could be ejected from Iran, shutting

Moncler Shop Online

the best, though narrow, window into its nuclear activities.Similarly, China and Russia, among other major Iranian trading partners, have resisted further oil and financial sanctions, saying the goal of isolating Iran is a poor strategy.
sweet123

Posts: 211
Registered: 10/31/11
Re: Multiple Ids, Exception: Cannot marshall ids, not supported id object type
Posted: Oct 31, 2011 3:21 AM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
As one of the most famous brands Coach Factory Outlet and the representatives of fashion, Coach Outlet Store Online always goes in the top of fashion, never fall behind Coach Outlet Online Store. Look into the fashion world, you will find Coach Outlet Factory that there are so many newest products pushed out by Coach Handbags Outlet. Coach Store, the most support of Coach Factory Outlet Online once appeared had earned a lot of women's heart, even the famous actresses. All of these, they are our Prada Store, and I will cherish them in lifetime. Perhaps you don't know, in my heart, Air Yeezy Shoes are my sisters, in the daily life, I call Gucci Bags sisters, that is because Coach Oulet USA really are my sisters, when I have trouble, Coach Outlet Store Online always help me to deal with it, when I am wronged, Louis Vuitton Outlet Factory will more angry than me to condemn others, Yes, Louis Vuitton Outlet Store Online are my sisters, we are envy Coach Handbags.Because I have Nike Dunk Shoes, my dear sisters!
sweet123

Posts: 211
Registered: 10/31/11
Re: Multiple Ids, Exception: Cannot marshall ids, not supported id object type
Posted: Oct 31, 2011 3:26 AM   in response to: mutable in response to: mutable
 
  Click to reply to this thread Reply
As one of the most famous brands Coach Factory Outlet and the representatives of fashion, Coach Outlet Store Online always goes in the top of fashion, never fall behind Coach Outlet Online Store. Look into the fashion world, you will find Coach Outlet Factory that there are so many newest products pushed out by Coach Handbags Outlet. Coach Store, the most support of Coach Factory Outlet Online once appeared had earned a lot of women's heart, even the famous actresses. All of these, they are our Prada Store, and I will cherish them in lifetime. Perhaps you don't know, in my heart, Air Yeezy Shoes are my sisters, in the daily life, I call Gucci Bags sisters, that is because Coach Oulet USA really are my sisters, when I have trouble, Coach Outlet Store Online always help me to deal with it, when I am wronged, Louis Vuitton Outlet Factory will more angry than me to condemn others, Yes, Louis Vuitton Outlet Store Online are my sisters, we are envy Coach Handbags.Because I have Nike Dunk Shoes, my dear sisters!
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums