Announcement Announcement Module
Collapse
No announcement yet.
Spring 2.0 and Gwt Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 2.0 and Gwt

    Hello,

    I'm trying to use Spring 2.0 session scoped beans for an web application using Gwt.And I cannot configure it correctly.

    In web.xml, I have :
    Code:
    <listener>
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    </listener>
    <listener> <listener-class>org.springframework.web.context.request.Requ estContextListener</listener-class>
    </listener>

    I define my beans in a file named beans.xml like that :

    Code:
    <bean id="PlayerBean"
    class="com.cadextan.server.toscane.objects.beans.P layerBean"
    scope="session">
    <property name="playerId" >
    <value>0</value>
    </property>
    <property name="ptf" ><ref bean="PortfolioBean"/></property>
    <property name="orders" >
    <list></list>
    </property>
    </bean>
    In a GWt service I try to call the "getBean()" method concerning the bean PlayerBean, like that :

    Code:
    ApplicationContext context = new
    ClassPathXmlApplicationContext(
    new String[] {"beans.xml"});
    BeanFactory factory = (BeanFactory) context;
    //ApplicationContext contextAppli = new
    XmlWebApplicationContext() ;
    if(factory.containsBean("GameBean")){
    //System.out.println("ok");
    GameBean gameBean = (GameBean)
    factory.getBean("GameBean") ;
    //return gameBean.toString() ;
    return "titi" ;
    }
    else
    return "toto" ;

    and when I try to load it with Tomcat I received the following error :

    java.lang.IllegalStateException: No Scope registered for scope 'session' at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:281)

    So if someone could help me, I wonder if :
    1- Gwt works with Spring 2.0 (RPC and Http Session are they compatible?).
    2- How can I correct my Mistake.For example how can I declare a sessionScope to avoid the problem declared in the error message.

    I thank you in advance and please don't be angry of my mistakes I am not a native english speaker.

    SpringGirl

  • #2
    This forum is probably not the right place to ask this. Instead, try the Web forum.

    Comment


    • #3
      Thanks for your piece of advice

      Regards,
      springGirl

      Comment


      • #4
        Re-posted here.
        http://forum.springframework.org/sho...034#post110034

        Comment

        Working...
        X