Results 1 to 5 of 5

Thread: Is this a Spring IDE issue or I'm I wrong? (Spring-flex/wtp/Gilead)

  1. #1
    Join Date
    Apr 2010
    Location
    Tours, France
    Posts
    8

    Default Is this a Spring IDE issue or I'm I wrong? (Spring-flex/wtp/Gilead)

    Hi,

    I got a stackOverFlow exception while mixing eclipse/spring IDE/M2Eclipse (works good out of the box).

    My flex-appContext:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:flex="http://www.springframework.org/schema/flex"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans 
                               http://www.springframework.org/schema/beans/spring-beans.xsd
                               http://www.springframework.org/schema/context 
                               http://www.springframework.org/schema/context/spring-context.xsd
                               http://www.springframework.org/schema/flex
                               http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">
    
    	<!-- exception translator -->
    	<!-- <bean id="javaToFlexExceptionTranslator" class="general.util.JavaToFlexExceptionTranslator" 
    		/> -->
    	<!-- The amf message broker -->
    	<flex:message-broker services-config-path="WEB-INF/flex/services-config.xml">
    		<!-- <flex:exception-translator ref="javaToFlexExceptionTranslator" /> -->
    		<flex:remoting-service default-adapter-id="hibernate-object"
    			default-channels="myProj-flex_webApp-amf" />
    	</flex:message-broker>
    	<!-- Gilead libraries (opensession in view pattern) -->
    	<bean class="net.sf.gilead.core.hibernate.spring.HibernateSpringUtil"
    		factory-method="getInstance">
    		<property name="sessionFactory" ref="sessionFactory" />
    	</bean>
    	<bean id="hibernate-object"
    		class="org.springframework.flex.core.ManageableComponentFactoryBean"
    		depends-on="sessionFactory">
    		<constructor-arg value="net.sf.gilead.blazeds.adapter.PersistentAdapter" />
    		<property name="properties">
    			<value> {"persistence-factory":
    				{"class":"net.sf.gilead.core.hibernate.spring.HibernateSpringUtil",
    				"singleton" :"true", "method":"getSessionFactory" },
    				"stateless":"true" } 
    		</value>
    		</property>
    	</bean>
    
    
    
    
    </beans>
    The exception while I'm persisting a flex object:

    Code:
    [BlazeDS]Error deserializing client message.
    java.lang.StackOverflowError
    	at java.lang.reflect.Field.copy(Field.java:127)
    	at java.lang.reflect.ReflectAccess.copyField(ReflectAccess.java:122)
    	at sun.reflect.ReflectionFactory.copyField(ReflectionFactory.java:289)
    	at java.lang.Class.copyFields(Class.java:2739)
    	at java.lang.Class.getDeclaredFields(Class.java:1743)
    	at org.springframework.util.ReflectionUtils.findField(ReflectionUtils.java:69)
    	at org.springframework.util.ReflectionUtils.findField(ReflectionUtils.java:52)
    	at org.springframework.core.convert.support.PropertyTypeDescriptor.getAnnotations(PropertyTypeDescriptor.java:82)
    	at org.springframework.core.convert.TypeDescriptor.toString(TypeDescriptor.java:466)
    	at java.lang.String.valueOf(String.java:2826)
    	at java.lang.StringBuilder.append(StringBuilder.java:115)
    	at org.springframework.core.convert.TypeDescriptor.toString(TypeDescriptor.java:472)
    	at java.lang.String.valueOf(String.java:2826)
    at java.lang.StringBuilder.append(StringBuilder.java:115)
    ... (the three last lines about a thousand times)
    Do you have any solution?

    Thank you in advance, Tcharl

  2. #2
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hi Tchar!

    Do you see this exception when running your app? Then I think this is not related to Spring IDE or the tooling in general and I would move this question to the Spring flex forum.

    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

  3. #3
    Join Date
    Apr 2010
    Location
    Tours, France
    Posts
    8

    Default

    Hi Martin, thank you for your sollicitude!


    The strange thing is that the project works well out of the box (running with cargo-tomcat).
    It just fails with wtp/m2Eclipse and spring ide.

    As I said before, the issue appears when I persist an objet (From flex to java). It works well in the other way.

    I'm ok to duplicate the post in flex forum, but I still suspect a Spring ide Issue.

    Here's my service-config.xml file if you see something strange:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
    
        <services>
            <!-- <service-include file-path="remoting-config.xml" /> -->
            <!-- le canal amf par défaut -->
             <default-channels>
               <channel ref="myProj-flex_webApp-amf" />
            </default-channels> 
        </services>
    
        <channels>
            <!-- définition des canaux amf, ici un canal standard (non sécurisé, non crypté) -->
            <channel-definition id="myProj-flex_webApp-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
                          class="flex.messaging.endpoints.AMFEndpoint"/>
            </channel-definition>
      
        </channels>
    
    
        <!-- Pour logger les messages AMF qui passent, indiquer level="Debug" -->
        <logging>   
            <target class="flex.messaging.log.ConsoleTarget" level="Error">
                <properties>
                    <prefix>[BlazeDS] </prefix>
                    <includeDate>false</includeDate>
                    <includeTime>false</includeTime>
                    <includeLevel>false</includeLevel>
                    <includeCategory>false</includeCategory>
                </properties>
                <filters>
                    <pattern>Endpoint.*</pattern>
                    <pattern>Service.*</pattern>
                    <pattern>Configuration</pattern>
                </filters>
            </target>
        </logging>
    
        <system>
            <redeploy>
                <enabled>false</enabled>
            </redeploy>
        </system>
    
    </services-config>

  4. #4
    Join Date
    Apr 2010
    Location
    Tours, France
    Posts
    8

    Default

    I think that this is because my flex and webapp maven modules are pointing to the same service-config file (located un webapp/web-inf/flex webapp module) Spring ide must not interpret it well when a flex object is sent ti The server and fall into infinite loop. Any workaround? Patch? Suggestion?
    Last edited by Tcharl; May 7th, 2011 at 12:06 PM.

  5. #5
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,637

    Default

    Hey Tchar!

    Can you attach a small sample project that demonstrates the problem? That would be great!

    Cheers,
    -Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •