-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Mass Initial indexing issue : Class with many associations
PostPosted: Mon Dec 29, 2008 4:18 pm 
Newbie

Joined: Tue Dec 23, 2008 10:42 am
Posts: 7
Hi guys,

I'm using hibernate search 3.0.1.GA (shipped with seam 2.1.1.GA).

I'm having a situation trying to index my database for the first time.

The Class I'm trying to index has many associations. It works if I include only one association but when I try in index 2+ associations together with my class, I have this issue :



Code:
Caused by: javax.ejb.EJBException: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
   at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
   at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
   at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
   at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
   at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
   at $Proxy201.index(Unknown Source)
   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.jboss.seam.util.Reflections.invoke(Reflections.java:22)
   at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
   at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
   at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
   at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
   at org.javassist.tmp.java.lang.Object_$$_javassist_0.index(Object_$$_javassist_0.java)
   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.jboss.seam.util.Reflections.invoke(Reflections.java:22)
   at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
   at org.jboss.seam.Component.callComponentMethod(Component.java:2210)
   at org.jboss.seam.Component.callCreateMethod(Component.java:2133)
   at org.jboss.seam.Component.newInstance(Component.java:2093)
   ... 141 more
Caused by: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
   at org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:66)
   at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:81)
   at org.hibernate.impl.SessionImpl.scroll(SessionImpl.java:1523)
   at org.hibernate.impl.CriteriaImpl.scroll(CriteriaImpl.java:297)
   at com.easycity.ejb.util.IndexerBean.indexPOI(IndexerBean.java:192)
   at com.easycity.ejb.util.IndexerBean.index(IndexerBean.java:63)
   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.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
   at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
   at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
   at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:31)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
   at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
   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.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
   at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:71)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
   ... 179 more


Here is my code :

Code:
   @SuppressWarnings("unchecked")
   private void indexPOI() {
      FullTextSession fullTextSession = getFullTextSession();
      
      /*
      fullTextSession.setFlushMode(org.hibernate.FlushMode.MANUAL);
      fullTextSession.setCacheMode(CacheMode.IGNORE);
      */
      
      org.hibernate.Transaction transaction = fullTextSession
            .beginTransaction();
      // Scrollable results will avoid loading too many objects in memory

       org.hibernate.Criteria query = fullTextSession
            .createCriteria(POI.class)
            .setFetchMode("detailsSet", org.hibernate.FetchMode.JOIN)
            .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
            .setCacheMode(CacheMode.IGNORE)
            .setFetchSize(FETCH_SIZE)
            .setFlushMode(org.hibernate.FlushMode.MANUAL);
      
       query.setFetchMode("reviewSet", org.hibernate.FetchMode.JOIN)
            .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
            .setCacheMode(CacheMode.IGNORE)
            .setFetchSize(FETCH_SIZE)
            .setFlushMode(org.hibernate.FlushMode.MANUAL);
      
       /*
       query.setFetchMode("mainCategory", org.hibernate.FetchMode.JOIN)
         .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
         .setCacheMode(CacheMode.IGNORE)
         .setFetchSize(FETCH_SIZE)
         .setFlushMode(org.hibernate.FlushMode.MANUAL);
       */
      
       /*
       query.setFetchMode("mainCategory.detailsSet", org.hibernate.FetchMode.JOIN)
         .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
         .setCacheMode(CacheMode.IGNORE)
         .setFetchSize(FETCH_SIZE)
         .setFlushMode(org.hibernate.FlushMode.MANUAL);
      */
      
       org.hibernate.ScrollableResults results = query.scroll(ScrollMode.FORWARD_ONLY);
      
      int index = 0;
      while (results.next()) {
         index++;
         fullTextSession.index(results.get(0)); // index each element
         if (index % BATCH_SIZE == 0) {
            System.out.println("...indexing POI : " + index);
            fullTextSession.clear(); // clear every batchSize since the
            // queue is processed
         }
      }
      transaction.commit();

      try {
         if (results != null) {
            results.close();
         }
      } catch (Exception ex) {
         ex.printStackTrace();
      }
   }


My entities :

POIDetails -- * -------- 1 -- POI --1---------*-- Review

Code:
@Entity
@Indexed
@FullTextFilterDefs( {
    @FullTextFilterDef(name = "activePOI", impl = ActivePOIFilter.class, cache=false)
})
@Table(name = "POI")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "POI_TYPE", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("POI")
@SequenceGenerator(name = "POI_SEQUENCE", sequenceName = "POI_POI_ID_SEQ")
public class POI implements java.io.Serializable, Cloneable {

   // Attributes
   @DocumentId
   private Long id;
   
   [...]
   
   @Field(index=Index.TOKENIZED, store=Store.NO)
   private String nameBase;
   
   // Associations
   @CollectionOfElements
   @IndexedEmbedded(depth = 1)
   private Collection<POIDetails> detailsSet = new ArrayList<POIDetails>();
   
   @IndexedEmbedded(depth = 1)
   private LocalBusinessOwner businessOwner;


   @OneToMany(mappedBy = "poi")
   public Collection<POIDetails> getDetailsSet() {
      return detailsSet;
   }
   
   @ManyToOne
   @JoinColumn(name = "LBO_ID", referencedColumnName = "LBO_ID")
   public LocalBusinessOwner getBusinessOwner() {
      return businessOwner;
   }
}



@Entity
@Indexed
@Table(name = "POI_DETAILS")
@SequenceGenerator(name = "POI_DET_SEQ", sequenceName = "POI_DETAILS_POI_DET_ID_SEQ")
public class POIDetails implements Cloneable, Serializable {
   // Attributes
   @DocumentId
   private Long id;
   
   @Field(index=Index.TOKENIZED, store=Store.NO)
   private String name;

   @Field(index=Index.TOKENIZED, store=Store.NO)
   private String desc;
   
   [...]
   
   // Associations
   @ContainedIn
   private POI poi;

   [...]

   @ManyToOne
   @JoinColumn(name = "POI_ID")
   public POI getPoi() {
      return poi;
   }
}

@Entity
@Indexed
@DiscriminatorValue("APP_POI")
public class AppPOI extends POI implements Cloneable, Serializable {

   @Field(index=Index.TOKENIZED, store=Store.NO)
   private String webSite;
   
   @Field(index=Index.UN_TOKENIZED) // Fields used for sorting must not be tokenized
   private long nbBookmark;
   @Field(index=Index.UN_TOKENIZED) // Fields used for sorting must not be tokenized
   private long nbReview;
   @Field(index=Index.TOKENIZED, store=Store.NO)
   private RevisionState revisionState;
   
   // Associations

   @CollectionOfElements
   @IndexedEmbedded(depth = 1)
   private Collection<Review> reviewSet = new ArrayList<Review>();
   
   @IndexedEmbedded(depth = 2)
   private Category mainCategory;
   
   @OneToMany(mappedBy = "poi")
   public Collection<Review> getReviewSet() {
      return reviewSet;
   }

   @OneToMany(mappedBy = "poi")
   public Collection<GrpPOI> getGrpPoiSet() {
      return grpPoiSet;
   }

   @ManyToOne
   @JoinColumn(name="poi_ctg_main_id")
   public Category getMainCategory() {
      return mainCategory;
   }

}


@Entity
@Indexed
@Table(name = "REVIEW")
@SequenceGenerator(name = "REVIEW_SEQ", sequenceName = "REVIEW_RW_ID_SEQ")
public class Review  implements Serializable{
   @DocumentId
   private long id;
   @Field(index=Index.UN_TOKENIZED, store = Store.YES) // Fields used for sorting must not be tokenized
   private short rating;
   @Field(index=Index.TOKENIZED, store=Store.NO)
   private String summary;
   @Field(index=Index.TOKENIZED, store=Store.NO)
   private String description;
   
   // Associations
   @ContainedIn
   private AppPOI poi;
   
   
   @ManyToOne
   @JoinColumn(name="POI_ID")
   public AppPOI getPoi() {
      return poi;
   }
}





Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2008 6:14 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
the entity shouldn't have multiple "Collection" attributes: specify them as LAZY or change them to a Set or a List using @IndexColum.

This is not really a Search problem but a rule for all entities:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=82946

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2008 6:50 am 
Newbie

Joined: Tue Dec 23, 2008 10:42 am
Posts: 7
Thanks for your help !

I changed the collection to List and i'm using @IndexColumn but I still have the same issue.

Code:
   @SuppressWarnings("unchecked")
   private void indexPOI() {
      FullTextSession fullTextSession = getFullTextSession();
      
      /*
      fullTextSession.setFlushMode(org.hibernate.FlushMode.MANUAL);
      fullTextSession.setCacheMode(CacheMode.IGNORE);
      */
      
      org.hibernate.Transaction transaction = fullTextSession
            .beginTransaction();
      // Scrollable results will avoid loading too many objects in memory

       org.hibernate.Criteria query = fullTextSession
            .createCriteria(POI.class)
            .setFetchMode("detailsSet", org.hibernate.FetchMode.JOIN)
            .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
            .setCacheMode(CacheMode.IGNORE)
            .setFetchSize(FETCH_SIZE)
            .setFlushMode(org.hibernate.FlushMode.MANUAL);
      
       query.setFetchMode("reviewSet", org.hibernate.FetchMode.JOIN)
            .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
            .setCacheMode(CacheMode.IGNORE)
            .setFetchSize(FETCH_SIZE)
            .setFlushMode(org.hibernate.FlushMode.MANUAL);
      
       /*
       query.setFetchMode("mainCategory", org.hibernate.FetchMode.JOIN)
         .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
         .setCacheMode(CacheMode.IGNORE)
         .setFetchSize(FETCH_SIZE)
         .setFlushMode(org.hibernate.FlushMode.MANUAL);
      
       query.setFetchMode("mainCategory.detailsSet", org.hibernate.FetchMode.JOIN)
         .setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY)
         .setCacheMode(CacheMode.IGNORE)
         .setFetchSize(FETCH_SIZE)
         .setFlushMode(org.hibernate.FlushMode.MANUAL);
      */
      
       org.hibernate.ScrollableResults results = query.scroll(ScrollMode.FORWARD_ONLY);
      
      int index = 0;
      while (results.next()) {
         index++;
         fullTextSession.index(results.get(0)); // index each element
         if (index % BATCH_SIZE == 0) {
            System.out.println("...indexing POI : " + index);
            fullTextSession.clear(); // clear every batchSize since the
            // queue is processed
         }
      }
      transaction.commit();

      try {
         if (results != null) {
            results.close();
         }
      } catch (Exception ex) {
         ex.printStackTrace();
      }
   }


Code:
org.jboss.seam.InstantiationException: Could not instantiate Seam component: indexer
   at org.jboss.seam.Component.newInstance(Component.java:2105)
   at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
   at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
   at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:112)
   at org.jboss.seam.init.Initialization.init(Initialization.java:734)
   at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
   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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
   at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
   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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
   at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
   at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
   at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
   at org.jboss.web.WebModule.startModule(WebModule.java:83)
   at org.jboss.web.WebModule.startService(WebModule.java:61)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
   at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
   at $Proxy0.start(Unknown Source)
   at org.jboss.system.ServiceController.start(ServiceController.java:417)
   at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy44.start(Unknown Source)
   at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
   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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
   at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
   at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
   at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
   at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
   at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy45.start(Unknown Source)
   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
   at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy9.deploy(Unknown Source)
   at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
   at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
   at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
   at $Proxy0.start(Unknown Source)
   at org.jboss.system.ServiceController.start(ServiceController.java:417)
   at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy4.start(Unknown Source)
   at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
   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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy5.deploy(Unknown Source)
   at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
   at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
   at org.jboss.Main.boot(Main.java:200)
   at org.jboss.Main$1.run(Main.java:508)
   at java.lang.Thread.run(Thread.java:595)
Caused by: javax.ejb.EJBException: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
   at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
   at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
   at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
   at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
   at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
   at $Proxy202.index(Unknown Source)
   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.jboss.seam.util.Reflections.invoke(Reflections.java:22)
   at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
   at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
   at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
   at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
   at org.javassist.tmp.java.lang.Object_$$_javassist_0.index(Object_$$_javassist_0.java)
   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.jboss.seam.util.Reflections.invoke(Reflections.java:22)
   at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
   at org.jboss.seam.Component.callComponentMethod(Component.java:2210)
   at org.jboss.seam.Component.callCreateMethod(Component.java:2133)
   at org.jboss.seam.Component.newInstance(Component.java:2093)
   ... 141 more
Caused by: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
   at org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:66)
   at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:81)
   at org.hibernate.impl.SessionImpl.scroll(SessionImpl.java:1523)
   at org.hibernate.impl.CriteriaImpl.scroll(CriteriaImpl.java:297)
   at com.easycity.ejb.util.IndexerBean.indexPOI(IndexerBean.java:192)
   at com.easycity.ejb.util.IndexerBean.index(IndexerBean.java:63)
   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.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
   at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
   at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
   at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:31)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
   at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
   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.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
   at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:71)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
   ... 179 more
2008-12-30 11:49:29,634 ERROR [org.apache.catalina.core.StandardContext] Error listenerStart


Wired isn't it ?

_________________
Romain


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2008 9:53 am 
Newbie

Joined: Tue Dec 23, 2008 10:42 am
Posts: 7
OK, It finally works.

Changing Collection or List to Set (and HashSet) will do the trick.

Thank you for your time Sanne.

Best,

Romain

_________________
Romain


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2008 2:52 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
thanks, you're welcome.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.