[jboss-user] [JBoss Seam] - seam, spring activemq
do-not-reply at jboss.com
Tue Mar 13 12:31:14 EDT 2007
I'm attempting to use seam for a webapp, the implementation of which is fine.
However, there can be a back end feed that comes in via jms and its kinda been mandated that I use activemq for this.
So I've configured the various activemq bits and bobs via spring. However... I need to persist some of the data that comes in, into the db. So I did this:
| <!-- Use this to wire into the active mq beans -->
| <bean id="springHook" class="org.banana.utils.SpringHook">
| <property name="session"><ref local="hibernateSession"/></property>
| <seam:instance name="svDatabase" id="hibernateSession" proxy="true"/>
to get hold of the seam managed hibernate session.
However... when I put that spring hook bean into a message listener and have it attempt to log out the hibernate session I get:
| svi ERROR [Thread-5] UpdateListener.onMessage(74) | jms exception=No application
| context active
| java.lang.IllegalStateException: No application context active
| at org.jboss.seam.Component.forName(Component.java:1545)
| at org.jboss.seam.Component.getInstance(Component.java:1595)
| at org.jboss.seam.Component.getInstance(Component.java:1578)
| at org.jboss.seam.Component.getInstance(Component.java:1572)
but when I nav to the first page of the app and have a test just to log out the session... it works. It appears that referencing a seam managed hibernate session isn't working for me.
Although this might be the way its supposed to work... i was wondering if there were another way of getting hold of a hibernate session from seam?
Hope you can help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027601#4027601
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027601
More information about the jboss-user