2 Replies Latest reply on Nov 12, 2008 1:18 PM by kristjan slomsek

    entityConverter in 2.1.GA problem

    kristjan slomsek Newbie

      Hi,


      I have a problem on migrating to 2.1.GA from 2.0.2SP1. I have changed entity converters in components.xml as documentation proposes (comented part at the end is as previous was working in 2.0):



      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
                  xmlns:core="http://jboss.com/products/seam/core"
                  xmlns:persistence="http://jboss.com/products/seam/persistence"
                  xmlns:drools="http://jboss.com/products/seam/drools"
                  xmlns:bpm="http://jboss.com/products/seam/bpm"
                  xmlns:theme="http://jboss.com/products/seam/theme"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:web="http://jboss.com/products/seam/web"
                  xmlns:transaction="http://jboss.com/products/seam/transaction"
                  xmlns:ui="http://jboss.com/products/seam/ui"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd 
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd 
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                       http://jboss.com/products/seam/theme   http://jboss.com/products/seam/theme-2.1.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd
                       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                       http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd
                       ">
      
      
      
         <core:init debug="false" jndi-pattern="userportal/#{ejbName}/local" />
         
         <core:manager concurrent-request-timeout="500" 
                       conversation-timeout="120000" 
                       conversation-id-parameter="cid"
                       parent-conversation-id-parameter="pid"/>
                       
         
         <persistence:managed-persistence-context name="beDatabase" auto-create="true" entity-manager-factory="#{beEmf}"/>
         <persistence:entity-manager-factory name="beEmf" persistence-unit-name="beDB" auto-create="true" startup="true"/>
                            
         
         <persistence:managed-persistence-context name="localDatabase" auto-create="true" entity-manager-factory="#{locEmf}" />
         <persistence:entity-manager-factory name="locEmf" persistence-unit-name="localDB" auto-create="true" startup="true"/>
         
         
         <ui:entity-converter name="beEntityConverter" scope="CONVERSATION" precedence="20" entity-loader="#{entityLoader1}"/>
         <ui:jpa-entity-loader name="entityLoader1" entity-manager="#{beDatabase}"/>
      
         <ui:entity-converter name="localEntityConverter" scope="CONVERSATION" precedence="20" entity-loader="#{entityLoader2}"/>
         <ui:jpa-entity-loader name="entityLoader2" entity-manager="#{localDatabase}"/>
         
         
         <!--
         <component name="beEntityConverter" scope="CONVERSATION" precedence="20"
                     class="org.jboss.seam.ui.converter.EntityConverter">
              <property name="entityManager">#{beDatabase}</property>
         </component>
         
         <component name="localEntityConverter" scope="CONVERSATION" precedence="20"
                     class="org.jboss.seam.ui.converter.EntityConverter">
              <property name="entityManager">#{localDatabase}</property>
         </component>
          -->
         


      but have a problem getting entity manager than:


      10:29:20,664 ERROR [Initializer] Error while trying to initialize the local directories of files: java.lang.RuntimeException: java.lang.RuntimeException: exception invoking: getEntityManager
      java.lang.RuntimeException: java.lang.RuntimeException: exception invoking: getEntityManager
              at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:113)
              at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:616)
              at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:131)
              at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:61)
              at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
              ...
      Caused by: java.lang.RuntimeException: exception invoking: getEntityManager
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:148)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2171)
              at org.jboss.seam.Component.unwrap(Component.java:2197)
              at org.jboss.seam.Component.getInstance(Component.java:1964)
              at org.jboss.seam.Component.getInstance(Component.java:1910)
              at org.jboss.seam.Component.getInstance(Component.java:1904)
              at org.jboss.seam.Component.getInstance(Component.java:1899)
              at com.util.Configuration.<init>(Configuration.java:80)
              at com.util.Configuration.getInstance(Configuration.java:39)
              at app.init.UtilServiceBean.initialize(UtilServiceBean.java:74)
              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.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:159)
              at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              at org.jboss.seam.intercept.Interceptor.postConstruct(Interceptor.java:193)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:74)
              at org.jboss.seam.intercept.Interceptor.postConstruct(Interceptor.java:193)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:74)
              ... 184 more
      Caused by: java.lang.reflect.InvocationTargetException
              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:22)
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138)
              ... 229 more
      Caused by: java.lang.NoClassDefFoundError: org/jboss/el/lang/ExtendedFunctionMapper
              at java.lang.ClassLoader.defineClass1(Native Method)
              at java.lang.ClassLoader.defineClass(Unknown Source)
              at java.security.SecureClassLoader.defineClass(Unknown Source)
              at java.net.URLClassLoader.defineClass(Unknown Source)
              at java.net.URLClassLoader.access$100(Unknown Source)
              at java.net.URLClassLoader$1.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(Unknown Source)
              at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:675)
              at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:655)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:193)
              at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
              at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
              at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:520)
              at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClassInternal(Unknown Source)
              at org.jboss.seam.core.Expressions.getExpressionFactory(Expressions.java:40)
              at org.jboss.seam.core.Expressions$1.createExpression(Expressions.java:107)
              at org.jboss.seam.core.Expressions$1.toUnifiedValueExpression(Expressions.java:91)
              at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
              at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:220)
              at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:78)
              at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:107)
              ... 235 more
      10:29:20,680 INFO  [Contexts] starting up: locEmf



      Am I doing anything wrong?
      tnx and brg,
      K