6 Replies Latest reply on Oct 19, 2006 9:27 AM by lucluc

    Remoting and java map to js map error conversion

    lucluc

      Hi,
      I found an error on interface produced by Seam remoting on JAVA MAP which is converted to BAG type.

      Here is an example of what is produced by Seam:
      Seam.Remoting.type.parent.__metadata = [
      {field: "name", type: "str"},
      {field: "children", type: "bag"}];

      Javascript model downloaded from server correctly contains MAP type.
      If I manually change in the interface 'bag' with 'map' all goes well.
      I use the CVS SEAM updated version.

      Anyone noted that?

      thanks

        • 1. Re: Remoting and java map to js map error conversion
          shane.bryzak

          Fixed in CVS, sorry about that.

          • 2. Re: Remoting and java map to js map error conversion
            lucluc

            I thank you very much!

            Now I get an error using the latest cvs version.
            In fact I get a ClassNotFoundException on org.jboss.seam.core.Hibernate.
            Looking for that on Fisheye shows that this class was deleted 3 days ago.
            Could you suggest how to modify my components.xml in order to work with latest cvs version?

            My actually configuration is

            <components>
            
             <component name="org.jboss.seam.core.init">
             <property name="myFacesLifecycleBug">false</property>
             <property name="debug">true</property>
             </component>
            
             <!-- 120 second conversation timeout -->
             <component name="org.jboss.seam.core.manager">
             <property name="conversationTimeout">120000</property>
             </component>
            
             <!-- Bootstrap Hibernate -->
             <component name="cbiFeDatabase"
             class="org.jboss.seam.core.ManagedHibernateSession"/>
             <component class="org.jboss.seam.core.Hibernate" installed="true"/>
             <component class="org.jboss.seam.core.Microcontainer"
             installed="true"/>
            
             <component class="org.jboss.seam.core.Ejb" installed="false"/>
            
            </components>





            the stack trace is

            C:\jetty-6.0.1>java -jar start.jar
            2006-10-18 08:47:53.500::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
            2006-10-18 08:47:53.718::INFO: jetty-6.0.1
            2006-10-18 08:47:54.312::INFO: Extract jar:file:/C:/jetty-6.0.1/webapps/CBI_FE.war!/ to C:\DOCUME~1\CR00570\IMPOST~1\Te
            mp\Jetty_0_0_0_0_8080__CBI_FE_\webapp
            08:48:03,312 INFO [ServletContextListener] Welcome to Seam 1.1.0.BETA
            08:48:03,390 INFO [Initialization] reading components.xml
            2006-10-18 08:48:03.484::WARN: failed ContextHandler@18f1d7e{/CBI_FE,file:/C:/Documents%20and%20Settings/CR00570/Impost
            azioni%20locali/Temp/Jetty_0_0_0_0_8080__CBI_FE_/webapp/}
            2006-10-18 08:48:03.484::WARN: failed ContextHandlerCollection@d9660d
            2006-10-18 08:48:03.531::WARN: failed HandlerCollection@55e55f
            2006-10-18 08:48:04.250::INFO: Started SelectChannelConnector @ 0.0.0.0:8080
            2006-10-18 08:48:04.250::WARN: failed Server@f47396
            2006-10-18 08:48:04.250::WARN: EXCEPTION
            java.lang.RuntimeException: error while reading components.xml
            at org.jboss.seam.init.Initialization.initPropertiesFromXml(Initialization.java:192)
            at org.jboss.seam.init.Initialization.(Initialization.java:126)
            at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:32)
            at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:450)
            at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1129)
            at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:420)
            at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:457)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
            at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:156)
            at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:120)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
            at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:156)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
            at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:119)
            at org.mortbay.jetty.Server.doStart(Server.java:210)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:38)
            at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:905)
            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.mortbay.start.Main.invokeMain(Main.java:183)
            at org.mortbay.start.Main.start(Main.java:497)
            at org.mortbay.start.Main.main(Main.java:115)
            Caused by: java.lang.ClassNotFoundException: org.jboss.seam.core.Hibernate
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:358)
            at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:320)
            at java.lang.ClassLoader.loadClassInternal(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.jboss.seam.util.Reflections.classForName(Reflections.java:141)
            at org.jboss.seam.init.Initialization.installComponent(Initialization.java:217)
            at org.jboss.seam.init.Initialization.initPropertiesFromXml(Initialization.java:164)
            ... 23 more
            2006-10-18 08:50:56.140::INFO: Shutdown hook executing
            2006-10-18 08:50:56.140::INFO: Shutdown hook complete

            • 3. Re: Remoting and java map to js map error conversion
              gavin.king

               

              <component name="sessionFactory" class="org.jboss.seam.core.HibernateSessionFactory"/>


              It is in the docs :-)

              • 4. Re: Remoting and java map to js map error conversion
                lucluc

                Thanks Gavin.

                Sadly I get the following exception on the first call (webapp is deployed without errors):
                org.hibernate.SessionException: Session is closed!

                Code is the same, hibernate.cfg.xml is the same too, components.xml is

                <components>
                
                 <component name="org.jboss.seam.core.init">
                 <property name="myFacesLifecycleBug">false</property>
                 <property name="debug">true</property>
                 </component>
                
                 <!-- 120 second conversation timeout -->
                 <component name="org.jboss.seam.core.manager">
                 <property name="conversationTimeout">120000</property>
                 </component>
                
                 <!-- Bootstrap Hibernate -->
                 <component name="sessionFactory"
                 class="org.jboss.seam.core.HibernateSessionFactory" />
                 <component name="cbiFeDatabase"
                 class="org.jboss.seam.core.ManagedHibernateSession">
                 <property name="sessionFactoryJndiName">java:/cbiFeDatabase</property>
                 </component>
                
                 <component class="org.jboss.seam.core.Microcontainer"
                 installed="true" />
                
                 <component class="org.jboss.seam.core.Ejb" installed="false" />
                
                </components>
                
                


                as suggested by docs.

                Thanks in advance.


                By the way, I'm very impressed by the dynamic generation of docs from xml. It's the first time I've generated the docs and I think it's very powerful.


                Here the full stack trace:

                org.hibernate.SessionException: Session is closed!
                at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49)
                at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:867)
                at org.hibernate.impl.SessionImpl.load(SessionImpl.java:788)
                at org.hibernate.impl.SessionImpl.load(SessionImpl.java:781)
                at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.entityIdsToRefs(ManagedEntityIdentityInterceptor
                .java:161)
                at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.ja
                va:76)
                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.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.seam.util.Reflections.invoke(Reflections.java:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor
                .java:60)
                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessIntercepto
                r.java:50)
                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:26)
                at org.jboss.seam.util.Work.workInTransaction(Work.java:31)
                at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:20)

                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.ConversationalInterceptor.checkConversationForConversationalBean(ConversationalIn
                terceptor.java:81)
                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.EventInterceptor.aroundInvoke(EventInterceptor.java:51)
                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:40)
                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:45)
                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.AsynchronousInterceptor.invokeAsynchronouslyIfNecessary(AsynchronousInterceptor.j
                ava:32)
                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.interceptors.SynchronizationInterceptor.serialize(SynchronizationInterceptor.java:31)
                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:17)
                at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
                at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
                at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:168)
                at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:141)
                at org.jboss.seam.intercept.RootInterceptor.aroundInvoke(RootInterceptor.java:128)
                at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:103)
                at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:69)
                at cbi.bean.config.ConfigBean$$EnhancerByCGLIB$$1db68214.equals()
                at org.mortbay.jetty.servlet.AbstractSessionManager$Session.setAttribute(AbstractSessionManager.java:860)
                at org.jboss.seam.servlet.ServletSessionImpl.setAttribute(ServletSessionImpl.java:46)
                at org.jboss.seam.contexts.WebSessionContext.flush(WebSessionContext.java:97)
                at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:364)
                at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:259)
                at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:100)
                at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
                at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391)
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
                at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1050)
                at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:33)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
                at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
                at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:354)
                at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)
                at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627)
                at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
                at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
                at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
                at org.mortbay.jetty.Server.handle(Server.java:269)
                at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430)
                at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:687)
                at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492)
                at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199)
                at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)
                at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)
                at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)


                • 5. Re: Remoting and java map to js map error conversion
                  gavin.king

                  This seems to be a Jetty-specific problem. Why does Jetty call equals() after a Session.setAttribute() ? Is this how it does dirty checking?

                  Yew!

                  Well, add an issue to JIRA.

                  • 6. Re: Remoting and java map to js map error conversion
                    lucluc

                    Added: JBSEAM-428

                    I reproduced the problem (very tricky) integrating 'Hibernate' example and posted to jira the 6 relative new/updated files.

                    thanks