SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: support-Unmarshall=false for Component

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


Permlink Replies: 20 - Pages: 2 [ 1 2 | Next ] - Last Post: Dec 3, 2011 4:49 AM Last Post By: longchamp
nina256

Posts: 52
Registered: 11/22/06
support-Unmarshall=false for Component
Posted: Jul 14, 2008 6:10 AM
 
  Click to reply to this thread Reply
Hello,

I have two interfaces A and B, A has property B.

B has some properties which shall be found but not be unmarshalled. So when I am searching vor A I don't need B in the result object A.
It is even not possible to store it because compass always saves the wrong Implementation-Class which is for B a HibernateProxy.

I map the B in A as component:

<component name="B" ref-alias="BMapping"/>

The mapping of B looks like that:

<class name="InterfaceOfB" alias="BMapping" poly="true" root="false" support-unmarshall="false" >

<property name="key" >
<meta-data>key</meta-data>
</property>

</class>

When I'm indexing an object ob type A and try to search for it I get the following exception:

Exception in thread "main" org.compass.core.accessor.PropertyAccessException: NullPointerException occurred while calling; nested exception is java.lang.NullPointerException: null setter of [name of interface].key
java.lang.NullPointerException
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:585)
at org.compass.core.accessor.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:59)
at org.compass.core.converter.mapping.osem.ClassMappingConverter.unmarshall(ClassMappingConverter.java:247)
at org.compass.core.converter.mapping.osem.ComponentMappingConverter.doUnmarshall(ComponentMappingConverter.java:37)
at org.compass.core.converter.mapping.osem.AbstractRefAliasMappingConverter.unmarshall(AbstractRefAliasMappingConverter.java:103)
at org.compass.core.converter.mapping.osem.ClassMappingConverter.unmarshall(ClassMappingConverter.java:243)
at org.compass.core.marshall.DefaultMarshallingStrategy.unmarshall(DefaultMarshallingStrategy.java:163)
at org.compass.core.marshall.DefaultMarshallingStrategy.unmarshall(DefaultMarshallingStrategy.java:155)
at org.compass.core.impl.DefaultCompassSession.getByResource(DefaultCompassSession.java:218)
at org.compass.core.impl.DefaultCompassSession.getByResource(DefaultCompassSession.java:207)

It seems to me that the ComponentMappingConverter tries to unmarshall allthough I have set support-unmarshall = false.

What can I do in this case? I had a look at the componentMappingConverter in fisheye. As far as i understood support-unmarshall is ignored.

I am using Compass 1.2.

Thanks in advance,
Nina

Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: support-Unmarshall=false for Component
Posted: Jul 15, 2008 10:59 AM   in response to: nina256 in response to: nina256
 
  Click to reply to this thread Reply
If you set support unmarshall, then it should not even get to the component mapping, and only unmarshall the ids of A, and then exit. Can you set the logging to DEBUG and see if the Resource saved has extra Compass specific properties?
nina256

Posts: 52
Registered: 11/22/06
Re: support-Unmarshall=false for Component
Posted: Jul 15, 2008 11:29 AM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
I can not find any compass specific properties other than "alias" (which is A), id and class of A.
Which property are you thinking of?
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: support-Unmarshall=false for Component
Posted: Jul 16, 2008 2:38 PM   in response to: nina256 in response to: nina256
 
  Click to reply to this thread Reply
That make sense, I was trying to see if the supportUnmarshall was actually taken into account. So now, I don't understand why the component converter would kick in, only the ids of the class should be unmarshalled. In any case, 1.2 applications should slowly migrate to 2.0, is there a chance that you can do it?
nina256

Posts: 52
Registered: 11/22/06
Re: support-Unmarshall=false for Component
Posted: Jul 23, 2008 4:52 AM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Unfortunately I can not do it now. It will take some time, because I have some special implementations which depend on version 1.2.
So I will try later.
nina256

Posts: 52
Registered: 11/22/06
Re: support-Unmarshall=false for Component
Posted: Jul 29, 2008 8:58 AM   in response to: nina256 in response to: nina256
 
  Click to reply to this thread Reply
Now I migrated to 2.0.1.
Same problem.

I try to create a testcase.
nina256

Posts: 52
Registered: 11/22/06
Re: support-Unmarshall=false for Component
Posted: Jul 29, 2008 9:57 AM   in response to: nina256 in response to: nina256
 
  Click to reply to this thread Reply
Hey, Shay,

I created a testcase for this problem. Please have a look at it. It's very important to us.

Thank you in advance!

Nina



The exception that I get from it is:

Exception in thread "main" org.compass.core.accessor.PropertyAccessException: NullPointerException occurred while calling; nested exception is java.lang.NullPointerException: null setter of compasstest.vo.Master.masterProperty
java.lang.NullPointerException
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:585)
at org.compass.core.accessor.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:60)
at org.compass.core.converter.mapping.osem.ClassMappingConverter.unmarshall(ClassMappingConverter.java:275)
at org.compass.core.converter.mapping.osem.ComponentMappingConverter.doUnmarshall(ComponentMappingConverter.java:37)
at org.compass.core.converter.mapping.osem.AbstractRefAliasMappingConverter.unmarshall(AbstractRefAliasMappingConverter.java:103)
at org.compass.core.converter.mapping.osem.ClassMappingConverter.unmarshall(ClassMappingConverter.java:271)
at org.compass.core.marshall.DefaultMarshallingStrategy.unmarshall(DefaultMarshallingStrategy.java:167)
at org.compass.core.marshall.DefaultMarshallingStrategy.unmarshall(DefaultMarshallingStrategy.java:159)
at org.compass.core.impl.DefaultCompassSession.getByResource(DefaultCompassSession.java:236)
at org.compass.core.impl.DefaultCompassSession.getByResource(DefaultCompassSession.java:224)
at org.compass.core.impl.DefaultCompassDetachedHits.<init>(DefaultCompassDetachedHits.java:82)
at org.compass.core.impl.DefaultCompassHits.detach(DefaultCompassHits.java:108)
at org.compass.core.impl.DefaultCompassHits.detach(DefaultCompassHits.java:104)
at compasstest.dao.CompassDAO$1.doInCompass(CompassDAO.java:38)
at compasstest.dao.CompassDAO$1.doInCompass(CompassDAO.java:1)
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:130)
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:112)
at compasstest.dao.CompassDAO.find(CompassDAO.java:31)
at compasstest.Test.doSearch(Test.java:43)
at compasstest.Test.main(Test.java:59)

Edited by: nina256 on Aug 1, 2008 3:40 AM
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: support-Unmarshall=false for Component
Posted: Aug 3, 2008 12:48 PM   in response to: nina256 in response to: nina256
 
  Click to reply to this thread Reply
I think this happens (haven't run the testcase, just looked at the mappings) because you don't define the support-unmarshall flag on the Slave. Can you try and do that?

Also, if you have the time (I am a bit busy, sorry ...), and you still have a problem, can you create a test case similar to the tests Compass has in its test directory? This will speed things up...
nina256

Posts: 52
Registered: 11/22/06
Re: support-Unmarshall=false for Component
Posted: Aug 4, 2008 5:06 AM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Hello, Shay,

defining the support-unmarshall flag in "Slave" makes no difference.

Here is the test case - I hope it is like you meant it to be.

There are two tests:

One with not using interfaces: As you can see "Master" is unmarshalled tthough using support-unmarshall = false

One with using interfaces: Here the problem arises because "Master" is an interface and has no setter (exception comes).

Thank you for your time,
Nina
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: support-Unmarshall=false for Component
Posted: Aug 12, 2008 1:16 PM   in response to: nina256 in response to: nina256
 
  Click to reply to this thread Reply
ok, now I understand what you are trying to do. You want to have the Slave support unamrshalling, but the Master not to support unmarshalling. This was not actually designed to be supported in Compass, but I made it work (see CMP-692).

I have applied it on both 2.0 branch and 2.1. You can try either. I will kick in a nightly build of 2.0 branch (upcoming 2.0.2 version), can you please try it?
nina256

Posts: 52
Registered: 11/22/06
Re: support-Unmarshall=false for Component
Posted: Aug 13, 2008 4:36 AM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Thank you very very much, Shay!!

I'm looking forward to the nightly build and tell you as soon as possible how it works for me.

Have a nice day,
nina
nina256

Posts: 52
Registered: 11/22/06
Re: support-Unmarshall=false for Component
Posted: Sep 1, 2008 5:57 AM   in response to: nina256 in response to: nina256
 
  Click to reply to this thread Reply
Thanks Shay,

works great!!!
louisvuittonbox

Posts: 411
Registered: 8/23/11
Re: support-Unmarshall=false for Component
Posted: Aug 23, 2011 10:05 PM   in response to: nina256 in response to: nina256
 
  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.
factoryoutlet

Posts: 523
Registered: 10/5/11
coach factory outlet
Posted: Oct 5, 2011 9:50 PM   in response to: nina256 in response to: nina256
 
  Click to reply to this thread Reply

coach factory outlet offer excellent, elegant coach products in order to generate room for your new collections.They're purchased more quickly that you may at any time imagine.coach factory store is the greatest destination to buy what type of bags you like. If you need to manage a new Coach carrier and most preferable strategy is to the coach regarding coupon codes.Here's your new way to look sophisticated styles. Carry the hot coach factory outlet store of this summer and be the true trendsetter!in the market you definitely can find various colorways that are designed in as well as the high quality that applied in. For most of you would like to come. So just come to our coach factory outlet online store to choose one.

coach factory outlet is really sizzling kinds of shopping way for you. With the usage of the replica designer coach bags, you can surely be able to change your individual looks in a stunning manner.You know, Coach items are so perfect and fascinating. Now I grow up, and find coach outlet on the Internet offering affordable products with reliable quality.Many fashionable women match with practical Coach Purses which will make the street shopping become relaxed,and make every person can enjoy more diversiform combination in coach factory outlet online.The coach factory outlet store are utilized for formal event in company area that will display your excellent taste.Not only does a briefcase make is easier to carry things.

Almost everyone has identified effectively about this, below, among the best to make sure you will get much more information about coach outlet.In the coach outlet online shop, a collection of high quality and hottest Coach Shoulder Bags is offered to you. They are all at the best prices you will ever find.

You know, Coach items are so perfect and fascinating. Now I grow up, and find coach outlet on the Internet offering affordable products with reliable quality.Once visit, you will be unable to restrain loving it. Warmly welcome all of you to the Summer Sales Promotion on coach factory outlet.coach factory outlet has new coach laptop bags in listing. No matter which style do you want, we can provide it for you.Coach bags enjoy high popularity throughout the world. I would like to share the coach factory outlet online with you. What are you waiting for? Just come to visit.

coach factory outlet supplies the newest and most fashionable brand Coach on sale.The more Coach shoulder bags you order, the more discount you will get.It's wonderful to find out it does not slip in your signature at the bottom of the case and the appearance of brass accents from coach outlet online, Because women who can look stylish this summer.coach outlet has a zippered closure and buckles for extra security. Shiny brass hardware, rounded leather handle, and an interior pocket. It also includes a limited edition Hawaii luggage tag and lock.You can find all kinds of coach bags whatever you chose which one in coach factory outlet online will never be out of fashion. Not only they have many nice and design styles, but also made from the finest leather and fabric.

With the great diversity of styles, patterns and sizes available nowadays, finding the right pieces to highlight your personality is quite important. coach outlet offers exactly what you want.coach factory outlet supplies the newest and most fashionable brand Coach on sale.The more Coach shoulder bags you order, the more discount you will get.Look at this golden Coach bag in the? coach factory outlet online.Those new bags with classic and fashionable design are more and more popular now!After graduating from university, my cousin came back to my hometown from USA last month. She told me that coach outlet store is very popular among her classmate.

coach outlet online own a couple of line, color, or the selected theme, it should be a good choice. It may be the place where offer the bag ladies handbag, you will be able to follow a course of education or training receives for the slim project chest strap wallet.coach outlet will send you a coupon in the post to use in their upon only after you type a achieve. The Coach bags are customarily somewhat many than the ones in the stores.In particular, products from coach factory outlet with leather design are fashionable, handmade,leading the wave of American pop.It with simple,durable and unique style to win consumers.coach factory not only supply with the highest quality crystal at reasonable price but also provide good after-sales service. Companies operating purposes: science and technology in order to survive, credibility and development, strict quality control.

coach outlet handbags's special design and fashion is certainly and so eye-catching, I hope you are able to get much more attention towards the Cheap Coach Crossbody.As long as you open our coach factory outlet webpage, you will view various Coach New Arrivals which are the most popular also the most fashionable in this year.Are you anxious to choose some of the brand bags? Are you searching for reliable sellers? When you come to the coach factory outlet online, these are not problems.

At the coach outlet online you have the largest selection of the day. If you touch the item and like it, keep it in your possession until you make your final decision.Over the years, coach factory online has added a multitude of new handbag shapes, styles and materials to their collection. However, the highest care is taken that every Coach handbags is both aesthetically beautiful and functional.Are you searching for a cool and stylish coach bag? The coach factory outlet online Online is your first priority.

factoryoutlet

Posts: 523
Registered: 10/5/11
louis vuitton outlet
Posted: Oct 5, 2011 9:56 PM   in response to: nina256 in response to: nina256
 
  Click to reply to this thread Reply

louis vuitton outlet leads you to bags collection of wide, such as LV bags and LV handbag etc. They are main name in luxury and style. It is excellent quality, fine Italian technology and extraordinary beauty.LV is universally renowned as a luxury brand. louis vuitton online store offers customers the newest fashion collections which can make you different.

In the past, Louis Vuitton only emphasis on classic, but in recent year, Louis Vuitton change its strategy and style to acquire new breakthrough. Especially louis vuitton bags like Louis Vuitton Vernis Wallet.Want to become more charming and faddish? Go to visit louis vuitton outlet webpage and select the most suitable products for yourself.

Want to become more charming and faddish? Go to visit louis vuitton outlet webpage and select the most suitable products for yourself.louis vuitton outlet online may often be the consideration alternative inside of your event to get these kinds of bags.Is without a doubt louis vuitton online seriously is present? Is it possible to offer an outlet designed for Louis Vuitton merchandise speaks out?

The choices are likely to be basically countless seeing that louis vuitton outlet occurs with the help of completely new and also incredible concepts once in a while.Mainly because mentioned before, you could buy in the louis vuitton online, via the producer's the web outlet. Owning worn it in past times. They can supply a appropriate evaluate for the property's simplicity as well as client service description.louis vuitton outlet online is the method to show the confidence of our handbags. The person who show himself in front of other people is a confident one.

LV bags in the louis vuitton outlet are a feminine update on an urban classic. With plenty of room for all of your essentials this covetable carryall will take you through the weekend in style.LV is universally renowned as a luxury brand. louis vuitton online store offers customers the newest fashion collections which can make you different.

This collection focus more on color selection compared with other LV handbags. Cute and sunshine design style increases its charm. louis vuitton outlet online provides you the very famous luxury worldwide brand.We are glad you come to join in our louis vuitton outlet online store, because the winter is upcoming now, Louis Vuitton released many new handbags to feedback our customers.Just come to visit once the louis vuitton online, you will fall in love with its fancy bags, purses, sunglasses, shoes and so on.

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