10 Replies Latest reply on May 26, 2008 4:00 PM by thierry accart

    s:convertEntity doesn't work when entities are in separated jar

    davide ficano Newbie

      I've a jar containing all entity classes, this jar is deployed inside application ear and is declared inside application.xml as ejb module.


      The web app works fine when uses entities in both facelets and action.
      When I need to populate a combobox I use s:convertEntity.
      The combo is populated correctly but when I submit the request I received the error shown below.
      The problem seems related to separated jar, the entities are not found from s:convertEntity.
      If I unzip jar and put classes inside the main jar directory (the jar created by seam-gen and build) the s:convertEntity works.
      How can I use a separated jar and have s:convertEntity work properly?


      The code filling the combo



      <h:selectOneMenu id="nazioni"
          value="#{ricercaLuogoNascita.nazione}">
          <s:selectItems
              var="i"
              value="#{ricercaLuogoNascita.listNazioni}"
              label="#{i.descrizione}"
              noSelectionLabel=""/>
          <s:convertEntity />
      </h:selectOneMenu>
      <h:commandButton
          styleClass="searchButton"
          type="submit"
          id="btn1"
          value="Cerca"
          action="#{ricercaLuogoNascita.findCitta}" />
      



      The entity declaration



      @Entity
      @Name("nazione")
      @Table(name = "TB_NAZIONI")
      public class Nazione implements Serializable {
          @Id
          @Column(name = "COD_NAZIONE", length = 6)
          private String codiceNazione;
          
          @Column(name = "DESCRIZIONE", nullable = false, length = 50)
          private String descrizione;
      
          ...    
      }
      



      The stacktrace



      2008-02-25 16:38:01,203 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
      2008-02-25 16:38:01,203 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
      2008-02-25 16:38:01,203 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
      2008-02-25 16:38:01,203 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
      2008-02-25 16:38:01,203 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postSetVariable.org.jboss.seam.component
      2008-02-25 16:38:01,203 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2008-02-25 16:38:01,203 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2008-02-25 16:38:01,203 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2008-02-25 16:38:01,203 WARN  [javax.enterprise.resource.webcontainer.jsf.lifecycle] Unknown entity: it.unipa.cuc.domain.localita.Nazione
      java.lang.IllegalArgumentException: Unknown entity: it.unipa.cuc.domain.localita.Nazione
           at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:185)
           at org.jboss.seam.persistence.EntityManagerProxy.find(EntityManagerProxy.java:85)
           at org.jboss.seam.framework.EntityIdentifier.find(EntityIdentifier.java:32)
           at org.jboss.seam.ui.converter.EntityConverterStore.get(EntityConverterStore.java:43)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:49)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:40)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
           at org.jboss.seam.ui.converter.EntityConverterStore_$$_javassist_3.get(EntityConverterStore_$$_javassist_3.java)
           at org.jboss.seam.ui.converter.EntityConverter.getAsObject(EntityConverter.java:79)
           at org.jboss.seam.ui.converter.PrioritizableConverter.getAsObject(PrioritizableConverter.java:61)
           at org.jboss.seam.ui.converter.ConverterChain.getAsObject(ConverterChain.java:107)
           at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:152)
           at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectOneValue(MenuRenderer.java:197)
           at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(MenuRenderer.java:359)
           at javax.faces.component.UIInput.getConvertedValue(UIInput.java:934)
           at javax.faces.component.UIInput.validate(UIInput.java:860)
           at javax.faces.component.UIInput.executeValidate(UIInput.java:1065)
           at javax.faces.component.UIInput.processValidators(UIInput.java:666)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
           at javax.faces.component.UIForm.processValidators(UIForm.java:229)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
           at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:662)
           at org.ajax4jsf.component.AjaxViewRoot.access$201(AjaxViewRoot.java:57)
           at org.ajax4jsf.component.AjaxViewRoot$3.invokeRoot(AjaxViewRoot.java:319)
           at org.ajax4jsf.context.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:56)
           at org.ajax4jsf.context.AjaxContextImpl.invokeOnRegionOrRoot(AjaxContextImpl.java:173)
           at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:333)
           at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Unknown Source)
      Caused by: org.hibernate.MappingException: Unknown entity: it.unipa.cuc.domain.localita.Nazione
           at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
           at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:68)
           at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
           at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
           at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
           at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:174)
           ... 85 more
      2008-02-25 16:38:01,203 WARN  [javax.enterprise.resource.webcontainer.jsf.lifecycle] executePhase(PROCESS_VALIDATIONS 3,com.sun.faces.context.FacesContextImpl@503636) threw exception
      javax.faces.FacesException: Unknown entity: it.unipa.cuc.domain.localita.Nazione
           at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:108)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.IllegalArgumentException: Unknown entity: it.unipa.cuc.domain.localita.Nazione
           at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:185)
           at org.jboss.seam.persistence.EntityManagerProxy.find(EntityManagerProxy.java:85)
           at org.jboss.seam.framework.EntityIdentifier.find(EntityIdentifier.java:32)
           at org.jboss.seam.ui.converter.EntityConverterStore.get(EntityConverterStore.java:43)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:49)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:40)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
           at org.jboss.seam.ui.converter.EntityConverterStore_$$_javassist_3.get(EntityConverterStore_$$_javassist_3.java)
           at org.jboss.seam.ui.converter.EntityConverter.getAsObject(EntityConverter.java:79)
           at org.jboss.seam.ui.converter.PrioritizableConverter.getAsObject(PrioritizableConverter.java:61)
           at org.jboss.seam.ui.converter.ConverterChain.getAsObject(ConverterChain.java:107)
           at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:152)
           at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectOneValue(MenuRenderer.java:197)
           at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(MenuRenderer.java:359)
           at javax.faces.component.UIInput.getConvertedValue(UIInput.java:934)
           at javax.faces.component.UIInput.validate(UIInput.java:860)
           at javax.faces.component.UIInput.executeValidate(UIInput.java:1065)
           at javax.faces.component.UIInput.processValidators(UIInput.java:666)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
           at javax.faces.component.UIForm.processValidators(UIForm.java:229)
           at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1033)
           at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:662)
           at org.ajax4jsf.component.AjaxViewRoot.access$201(AjaxViewRoot.java:57)
           at org.ajax4jsf.component.AjaxViewRoot$3.invokeRoot(AjaxViewRoot.java:319)
           at org.ajax4jsf.context.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:56)
           at org.ajax4jsf.context.AjaxContextImpl.invokeOnRegionOrRoot(AjaxContextImpl.java:173)
           at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:333)
           at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
           ... 40 more
      Caused by: org.hibernate.MappingException: Unknown entity: it.unipa.cuc.domain.localita.Nazione
           at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
           at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:68)
           at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
           at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
           at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
           at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:174)
           ... 85 more
      2008-02-25 16:38:01,234 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
      2008-02-25 16:38:01,234 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
      2008-02-25 16:38:01,234 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
      2008-02-25 16:38:01,234 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.afterPhase
      
      


        • 1. Re: s:convertEntity doesn't work when entities are in separated jar
          Nicklas Karlsson Master

          I don't know if it's helpful but there are some classloading articles on the JBoss Wiki. I must confess that most of the classloading is a black box for me, should read up on it.

          • 4. Re: s:convertEntity doesn't work when entities are in separated jar
            Keith Naas Novice

            We use ears exclusively, so lets see what I can do to help.


            If you have any jars deployed in the WAR's WEB-INF/lib, they will likely not be allowed to load classes from a jar that is in the EAR.  Do you have libraries in the WAR's WEB-INF/lib?


            If you don't, the next thing is to make sure that the WAR is allowed to access classes in the EAR's other jars.  Do you have a MANIFEST.MF in your WAR's META-INF folder?  If so, does it have Class-Path entries? 


            For instance, here is an example of a WAR MANIFEST.MF from Seam 1.2.1.GA


            Manifest-Version: 1.0
            Class-Path: antlr-3.0ea8.jar
            commons-jci-core-1.0-406301.jar
            commons-jci-janino-2.4.3.jar
            drools-compiler-3.0.5.jar
            drools-core-3.0.5.jar
            itext-2.0.1.jar
            janino-2.4.3.jar
            jboss-cache-jdk50.jar
            jboss-seam-debug.jar
            jboss-seam-ioc.jar
            jboss-seam-mail.jar
            jboss-seam-pdf.jar
            jboss-seam-remoting.jar
            jboss-seam-ui.jar
            jboss-seam.jar
            jsf-api.jar
            jsf-facelets.jar
            jsf-impl.jar
            stringtemplate-2.3b6.jar
            thirdparty-all.jar
            commons-collections.jar
            commons-io-1.2.jar
            commons-lang.jar
            barbecue-1.5-alpha3.jar
            boa-service.jar
            jboss-el.jar
            boa-action.jar
            el-api.jar
            el-ri.jar
            ajax4jsf.jar
            richfaces.jar
            commons-dbutils-1.1.jar


            • 5. Re: s:convertEntity doesn't work when entities are in separated jar
              davide ficano Newbie

              If you don't, the next thing is to make sure that the WAR is allowed to access classes in the EAR's other jars.  Do you have a MANIFEST.MF in your WAR's META-INF folder?  If so, does it have Class-Path entries? 


              Hi,


              I have META-INF/MANIFEST.MF into WAR it contains only the classpath to the entity.jar but error isn't changed.


              My ear directory structure


              app.ear
               - app.jar
               - entity.jar (contains classes not found from s:convertEntity)
               - META-INF (application.xml with entity.jar declared as ejb module)
               - app.war
                 + META-INF
                     + MANIFEST.MF (contains classpath to entity.jar)


              • 6. Re: s:convertEntity doesn't work when entities are in separated jar
                Nicklas Karlsson Master

                Do you have app.jar in the war manifest classpath?

                • 7. Re: s:convertEntity doesn't work when entities are in separated jar
                  davide ficano Newbie

                  Nicklas Karlsson wrote on Feb 27, 2008 08:31 AM:


                  Do you have app.jar in the war manifest classpath?

                  If I add app.jar in classpath the error changes (below the stacktrace Could not enlist in transaction on entering meta-aware object! org.hibernate.exception.GenericJDBCException: Cannot open connection


                  the complete error stacktrace is shown below, it's so long that I've cutted it but the error is clear from first lines


                      select
                          nazione0_.COD_NAZIONE as COD1_4_0_,
                          nazione0_.DESCRIZIONE as DESCRIZI2_4_0_,
                          nazione0_.CITTADINANZA as CITTADIN3_4_0_,
                          nazione0_.SIGLA as SIGLA4_0_,
                          nazione0_.COMUNITARIO as COMUNITA5_4_0_,
                          nazione0_.SVILUPPO as SVILUPPO4_0_,
                          nazione0_.COD_MINISTER as COD7_4_0_,
                          nazione0_.UTENTE as UTENTE4_0_,
                          nazione0_.MODULO as MODULO4_0_,
                          nazione0_.TERMINALE as TERMINALE4_0_,
                          nazione0_.DATA_ORA as DATA11_4_0_ 
                      from
                          TB_NAZIONI nazione0_ 
                      where
                          nazione0_.COD_NAZIONE=?
                  10:55:04,187 WARN  [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@a1d7d9
                  10:55:04,203 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
                  10:55:04,203 ERROR [JDBCExceptionReporter] Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -6c5cfe15:567:47c5333d:41 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -6c5cfe15:567:47c5333d:41 status: ActionStatus.ABORT_ONLY >))
                  10:55:04,203 FATAL [application] javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
                  javax.faces.el.EvaluationException: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
                          at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
                          at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                          at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                          at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
                          at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
                          at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
                          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                          at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                          at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
                          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                          at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                          at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                          at java.lang.Thread.run(Unknown Source)
                  Caused by: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
                          at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
                          at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
                          at org.jboss.aspects.tx.TxInterceptor$Supports.invoke(TxInterceptor.java:148)
                          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.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
                          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.stateless.StatelessContainer.localInvoke(StatelessContainer.java:240)
                          at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:210)
                          at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:84)
                          at $Proxy106.popolaComboProvincia(Unknown Source)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                          at java.lang.reflect.Method.invoke(Unknown Source)
                          at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                          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.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
                          at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                          at org.javassist.tmp.java.lang.Object_$$_javassist_2.popolaComboProvincia(Object_$$_javassist_2.java)
                          at it.unipa.cuc.registration.action.RicercaLuogo.findProvince(RicercaLuogo.java:81)
                          at it.unipa.cuc.registration.action.RicercaLuogo.findCitta(RicercaLuogo.java:73)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                          at java.lang.reflect.Method.invoke(Unknown Source)
                          at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                          at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                          at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:48)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:49)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                          at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
                          at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
                          at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
                          at it.unipa.cuc.registration.action.RicercaLuogoNascita_$$_javassist_4.findCitta(RicercaLuogoNascita_$$_javassist_4.java)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                          at java.lang.reflect.Method.invoke(Unknown Source)
                          at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
                          at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341)
                          at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                          at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                          at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                          at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                          at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
                          ... 46 more
                  Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
                          at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
                          at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73)
                          at it.unipa.cuc.service.impl.LocalitaManagerImpl.popolaComboProvincia(LocalitaManagerImpl.java:30)
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                          at java.lang.reflect.Method.invoke(Unknown Source)
                          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)
                  

                  • 8. Re: s:convertEntity doesn't work when entities are in separated jar
                    Keith Naas Novice

                    You appear to be using an XA data source.  Can you try without an XA data source to eliminate XA as a possible problem?

                    • 9. Re: s:convertEntity doesn't work when entities are in separated jar
                      davide ficano Newbie

                      Continue to generate error.


                      I've remove convertEntity usage from my application, the next expensive step consists to remove seam...

                      • 10. Re: s:convertEntity doesn't work when entities are in separated jar
                        thierry accart Newbie

                        Seam builds a default project assuming that all your EJBs are in a single jar.



                        You can add secondary ejb jars in persistence.xml file :


                        <persistence-unit name="XXprojmanager">
                        <provider>org.hibernate.ejb.HibernatePersistence</provider>
                        <jta-data-source>java:/jdbc/xxdbname</jta-data-source>
                          <*jar-file*>../yyproj-ejb.jar</
                        jar-file>
                          <jar-file>../zzproj-ejb.jar</jar-file>