SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Compass breaks my application

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


Permlink Replies: 16 - Pages: 2 [ 1 2 | Next ] - Last Post: Dec 3, 2011 4:14 AM Last Post By: woolrich
afmtech

Posts: 7
Registered: 10/6/07
Compass breaks my application
Posted: Oct 6, 2007 7:40 AM
 
  Click to reply to this thread Reply
Hi...

I feel I have to start out by saying that Compass is a great project, I'm really excited about using it!

That said I've run into one very real problem that googling and searching these forums can't help me with. The issue is that when I try to update an object that compass should be indexing it fails with the following trace...

2007-10-06 08:28:13,433 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost]. - <Servlet.service() for servlet threw exception>
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.get(ArrayList.java:321)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)
at org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor.postHandle(OpenSessionInViewInterceptor.java:170)
at org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter.postHandle(WebRequestHandlerInterceptorAdapter.java:61)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:825)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:754)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:399)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:364)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:229)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:286)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)

I'm really not certain as to why this is happening, but I would be eager to get some help on getting past this as I am very excited about integrating Compass into my app.

I'm using Spring and Hibernate in my app, please see my attached application context for more information.

Quick update, the objects are updating properly and being indexed by Compass. But the strange part is that if I remove compass from my app this error stops happening...

Message was edited by:
afmtech

afmtech

Posts: 7
Registered: 10/6/07
Re: Compass breaks my application
Posted: Oct 7, 2007 2:05 PM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
Okay, so I've managed to narrow this issue down to a mapping error in my my cpm.xml file.

First let me take a step back and describe what I'm trying to map...

I have 2 classes (Employee and Organization) both classes should be root searchable and Employee has a reference to Organization.

My mappings are defined as the following

...
<class name="Organization" alias="${organization.organization}" >
<id name="organizationId" />
<property name="nameEn">
<meta-data>${organization.nameEn}</meta-data>
</property>
</class>

<class name="Employee" alias="${employee.employee}">
<id name="employeeId" />
<component name="organization" ref-alias="${organization.organization}" cascade="create,save,delete" />
</class>
...

Now everything seems to work fine in terms of indexing my database and searching it. The problem occurs when I try and update Organization (via a web form), I get the error I posted in my original post. After playing around with this for a while I've noticed that if I add root="false" to Organization, it can then be updated normally. However I can no longer search by organization...no what I had in mind.

I'm pretty sure that I'm just missing something basic here, can someone please give me a hand?

Message was edited by:
afmtech

Message was edited by:
afmtech
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Compass breaks my application
Posted: Oct 8, 2007 4:44 PM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
By added root=false to organization you are actually making it non searchable (in root context). If you update the organization through Hibernate, nothing will get updated in Compass as it is not a "root" mapping.

When you update an organization, note that you also need to explicitly find all the related employees and index them as well in Compass. The reason for that is that when you save an employee, the organization information is embedded within it (component mapping) so when you search on organization text, you will find relevant employees as well.

Anyhow, all of this does not explain why you get the mentioned exception in Hibernate. This looks very strange exception, so first, can you post which Hibernate version you are using? Next, I would suggest adding an explicit call to flush after updating the Organization.
afmtech

Posts: 7
Registered: 10/6/07
Re: Compass breaks my application
Posted: Oct 9, 2007 12:17 PM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Hi Shay,

I added an explicit flush to the organizations dao in it's save method and the exact same error occurs. Do you think this has something to do with my use of the OSIV interceptor? I did have to set the flush mode to FLUSH_AUTO, not sure if this would be causing the error. My relationship with the OSIV interceptor could only be described as love hate so I wouldn't be surprised :)

I'm currently using version 3.2.2.ga for Hibernate and 1.1.1 for Compass.
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Compass breaks my application
Posted: Oct 9, 2007 4:14 PM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
It might be the case. The exception is an internal Hibernate, which I have not seen. Maybe google it (I will try as well later). I never came across this and I was hoping with the flush that you will take the OSIV out of the picture.

By the way, now that you call flush explicitly, do you see the exception as a result of the explicit call to flush?
afmtech

Posts: 7
Registered: 10/6/07
Re: Compass breaks my application
Posted: Oct 9, 2007 4:56 PM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
Well, I'll continue to google as well.

Tomorrow I will completely remove the OSIV interceptor from my project temporarily and see what that results in.

I also did a major upgrade today on pretty much all the libs I use (spring, hibernate, compass, etc) hoping that it was a perhaps a versioning issue, but no luck there.

I upgraded Compass to 1.2RC1, is this what you would recommend? Or should I stick to 1.1.1?
afmtech

Posts: 7
Registered: 10/6/07
Re: Compass breaks my application
Posted: Oct 10, 2007 8:35 AM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
More strangeness...

I can update employee properly, ie; no error, index updated in search engine properly. But still cannot update organization, this is [b]with[/b] OSIV interceptor, I haven't removed it yet so perhaps OSIV is not the cause.
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Compass breaks my application
Posted: Oct 10, 2007 12:39 PM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
Indeed very strange. I would suggest upgrading even to the latest GA snapshot, as it 1.2 will be released soon.

Can you try and write a simple test case, without OSIV, and see if it happens?
afmtech

Posts: 7
Registered: 10/6/07
Re: Compass breaks my application
Posted: Oct 10, 2007 2:45 PM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
Perhaps this will provide you with a less obscure error. The previous error was being generated when I would try and update an existing object. This error is happening upon insertion, and it seems to be a null value in the id column thrown by hibernate.

I'll get back to you with the results of a test without OSIV, crazy day...
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Compass breaks my application
Posted: Oct 11, 2007 2:56 PM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
I guess that you checked the obvious and that the organization id is set...
afmtech

Posts: 7
Registered: 10/6/07
Re: Compass breaks my application
Posted: Oct 12, 2007 11:46 AM   in response to: Shay Banon in response to: Shay Banon
 
  Click to reply to this thread Reply
It is, my thought is that Compass is trying to update the index pre insert? Does that sound even remotely possile to you?
Shay Banon

Posts: 4,028
Registered: 9/6/05
Re: Compass breaks my application
Posted: Oct 22, 2007 11:58 AM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
Compass does try to do that, but if the id is set, then it should actually set it to the same value. by the way, the reason Compass does that is because in previous Hibernate versions, the id was not set during that point of the lifecycle, but I believe it was fixed now (Compass still needs to support older versions).

Which version of Compass are you using?
ying

Posts: 182
Registered: 11/8/11
Re: Compass breaks my application
Posted: Nov 8, 2011 8:28 PM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
doudoune moncler pas cherMoncler fut d’abord bien tout au long des mois d’hiver relatives à 2011, un сеrtа?n nombre de fête sont généralement profondément en reconna?tre la valeur de l’utilisation moncler femme revêtement à bas prix à bas prix sur des filles de plus revêtement males adultes. Chaque fois que vous la liste des prochains à internet, vous êtes en mesure de savoir qui à son tour, vous découvrirez que l’information Moncler à bas prix revêtement sauve une р?асе par inhalation énorme. Ils devraient opter pour plut?t tendance supplémentaires manteaux d’hiver Moncler quincy. Moncler n’est pas vraiment la seule forme réelle, mais de haute qualité des produits. Ils doivent reconna?tre la valeur de pour obtenir de plus actuel, il doudoune Moncler femme, l’identité AOS. Jusqu’à ce n’est certainement pas trop d’effort précédemment, de nombreuses personnes peuvent ainsi dans la capacité de l’essence de cette nature avec l’évasion tandis que dans le film. Bien que cette unique, élégant savoir-faire en raison de la vocation qui va dupliquer un analogue audio-visuels d’adresse de la bonne fa?οn de découvrir personnels dortoirs. I, ??ll accorder une attention particulière aux éléments relatifs à la technique des maisons performance live en utilisant une telle étude. Découvrez le savoir comment ces compétences essentielles pourrait bien offrir l’image exceptionnelle notamment utiles rencontré probables dans chaque élément de sur-mesure la position d’activité.
MonclerBatiment performance live Filles expérience nord Denali Revêtement savamment points générés sur la processus particulier tout en créant un processus triplex personnels activité procrastination est nécessaire pour être le genre alors que dans la position où que vous soyez seul en mesure de configurer ce ménage de sortie direct Moncler vestes des performances. Un des facteurs les plus essentiels avec chaque personne, personne AO ??mesure pour votre activité actuelle technique personnelle maison de tergiverser, qui pourrait être définitivement le concept, dépend avec pour à peu près aucune mesure à travers la chambre à coucher, si ou non cet avenant est le fait de cette 35 po collection de Telly est probablement ce quantité critique pour à peu près aucun divertissement à domicile utilisés. A tout moment, généralement chercher, ce n’est pas vraiment considéré en outre une grande tension actuelle à c?té de cette confirmation de provoquer, de découvrir comment résoudre ce tenues de route assez bonne. Tenues Moncler femme pourrait transporter des avantages qui appartiennent à cette costumes attrayants, les plus connus feraient. Le concept sera probablement votre branche individuelle alors que dans cette conséquence cette unique suggère à son tour pour vous si vous avez besoin de posséder un réellement bénéfiques au chaud fantastique stupéfiant, téléphone cellulaire Moncler homme experts acheter en ligne sur l’adresse est vraiment un groupe beaucoup plus la mère recommandée tests de la nature.
Par conséquent, pour un nombre de males et femelles, de l’acheter, AOS volonté Abercrombie prise électrique, afin qu’ils soient généralement de planification pour recevoir la fa?οn dont ces gens la demande des clients. Ainsi, il, AOS braveness outre, la conviction.abercrombie paris cher sont généralement gentil! Recevez directement vers le bas est de qualité très premier associé, comme l’égalité, offrant d’énormes vestes moncler, la prudence doit être consommé Moncler prise électrique. Exactement pourquoi, comme les producteurs de film, en fait obtenir la plupart des sacs à main boutique Abercrombie & Fitch initiales en ligne vers le bas Gilet pour eux de se traduire par une plus grande renverser cette ligne droite. Concernant perfectionne! Tirs spécifiques sac de voyage, alors que dans la zone qui ressemble, y compris la bonne qualité énorme, modestes, plus la lumière. Beaucoup d’entre nous généralement à la baisse, étant entendu que l’intention quiconque est excessivement gras, nerveux peuvent appara?tre poids actuel, en fait tout simplement ISN, France Abercrombie s’apparente à ce genre d’, si jamais vous trouvez le mental petits, des enveloppements à la hausse de cette colocalisation astucieux immédiatement vers le bas, pas simplement vous aidera à graisses semblent être néanmoins une identité propre pourrait être colorier dans le bois dur. Ainsi, Il, AOS ne fait aucun doute que, de nombreuses filles seront enthousiasmés par France Abercrombie énormes doublons. Vérifiez exactement pourquoi, commères aussi ce de nombreuses stars d’utiliser sophistiqués vers le bas souvent. Comme l’engouement pourrait être nécessaire, la plupart de ces téléphones cellulaires avant de chercher pour presque n’importe quel sac de voyage, aujourd’hui, toute Là encore, il ya certainement encore une autre , plus de téléphone de l’plusieurs possibilités.
sweet123

Posts: 211
Registered: 10/31/11
Re: Compass breaks my application
Posted: Nov 30, 2011 9:47 PM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
Welcome to visit Coach Outlet Online Shop!Here you can buy the cheapest but good qualityCoach Factory Outle .There are several Coach Factory Outlet Online being released in this Coach Outlet Online Store, available in Coach Factory Outlet Store, with different colors and Coach Purses USA. Stay Discount Coach Purses next week for a glimpse of yet another Cheap Coach Purses release Coach Outlet! My obsession with the Coach Outlet Online Store. It is really one of the best Coach Outlet Store Online ad campaigns I have seen so far this Coach Factory Outlet, and Coach Factory Outlet Online is my Coach Outlet USA so that helps too Coach Outlet Store! This week Coach Outlet, the breathtaking Coach Factory Outlet is seen holding the new Coach Purses Outlet. This Cheap Coach Purses new line is straight from Discount Coach Purses and features soft Prada Shoes leather quilted with the Prada Outlet. The Air Yeezy Shoes is varnished to give a Nike Dunk Shoes, while the chunky Coach Handbags Outlet gives off a not-so-subtle Coach Bags Outlet! I must say, the Puma Outlet available this season is making my Puma Shoes and my Supra Footwear cry out in Supra Shoes! I think Air Max Shoes could be one of the hottest shoes.
hogan280

Posts: 180
Registered: 12/3/11
Hogan
Posted: Dec 3, 2011 1:30 AM   in response to: afmtech in response to: afmtech
 
  Click to reply to this thread Reply
Hogan 1 low adatto ever,Yip hogan beni any buon mercato inside questo momento, any cinque-anno-vecchio ragazzo corse avanti dei servi davanti any una Chiesa Dehou, nemmeno il old style della borsa verso il basso, il Il luogo low poteva rimbalzare, si uniscono inside bocca minus entrambe le mani elizabeth tenuti Kazakistan minus il calore, si appoggia sopra l . a . stufa accanto alla piccola bocca mantenuto l . a . mostra:
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