cancel
Showing results for 
Search instead for 
Did you mean: 

Spring framework - Error with session scoped Beans

Former Member
0 Kudos

Hello guys,

I'm trying execute my Java Application inside Netweaver Application Server, but I'm having problems with serviceBeans with scope session. Anyone have already used Spring with session scope?

Thanks,

Cleiton.

Accepted Solutions (1)

Accepted Solutions (1)

ravindra_bollapalli2
Active Contributor
0 Kudos
Former Member
0 Kudos

I have already check these first two papers and nothing about beans with scope as session. I'm afraid that this functionality is not compatible with SAP WEB AS.

If you want to check what I'm explaining, please acess [http://static.springframework.org/spring/docs/2.0.x/reference/beans.html#beans-factory-scopes-global-session].

The third paper isn't directly related with this post, but this can be a alternative for another problems that I also have with Spring AOP.

Answers (2)

Answers (2)

Former Member
0 Kudos

For this project we give up to user java netweaver 7.1 Web AS, maybe these problems will the fixed in 7.2

Former Member
0 Kudos

Hi Cleiton,

Go through the link, hope u get the proper info.

https://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/6000c426-008a-2a10-aeac-9a66ae62edcf&prtm... [original link is broken]

Regards,

Srikanth Reddy.T

Former Member
0 Kudos

I didn't found any content about spring beans with session scope.

I'm thinking about rewrite the application in order to change the "spring beans" scoped as session and singleton by, respectivally, statefull and stateless session beans. However I didn't like to do that, it's more weight. Besides, this version of the application is robust and don't need an application server, it can run perfectly in just a tomcat server.

Anyone use Spring Container with SAP Netweaver?

Former Member
0 Kudos

After many attempt, when I declared the bean with <aop:scoped-proxy /> it works, however it could cause performance problem. I don't need refer this bean by another singleton bean, i did a wrong configuration in order to make a work a round...

When I run my application on tomcat server, the DWR starts perfectly the "session scope bean form IOC container", but in the WEBAS maybe it's running in other thread. Is it possible?

Anyone had a problem like this?

I got a detailed error with log4j,

-


ERROR Application [1] org.directwebremoting.impl.DefaultCreatorManager - Error loading class for creator 'SpringCreator[CounterSpringFacade]'.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterSpringFacade': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:312)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)

at org.directwebremoting.spring.SpringCreator.getInstance(SpringCreator.java:145)

at org.directwebremoting.spring.SpringCreator.getType(SpringCreator.java:107)

Edited by: Cleiton dos Santos Garcia on Jan 7, 2009 5:02 PM