[JBoss Seam] - Re: Questions on Seam's PAGE scope
by gus888
Hi Petemuir,
Thank you for your reply. I have a categories list in jsf page. @DataModel List categoryList, @DataModelSelection Category selectedCategory. When click one category, the page will list subcategory list, then click a subcategory, it will display sub-subcategory list .... Currently, I use SESSION Scope SFSB. I have a problem with the browser BACK. That is, when I click a category on supcategory list, the page displays its subcategory list. However, when I click browser BACK, the page was back to supcategory list. When I try to click another category on the supcategory list, the page will not display the subcategory list which I just clicked, but it went to the subcategory list which I previously clicked, I don't what is wrong with my SESSION Scope SFSB. Thank you for your help in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971306#3971306
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971306
19 years, 7 months
[Messaging, JMS & JBossMQ] - XA trasactions over a remote MQ queue Jboss 3.2.6
by tnine
I?m having some issue reading transitionally from a remote JBoss MQ Queue. I have configured the remote queue with the configuration defined here.
http://wiki.jboss.org/wiki/Wiki.jsp?page=HowDoIConfigureTheJMSResourceAda...
With the exception of the following change in our ?ds.xml file
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.mq:service=JMSProviderLoader,name=RemoteJMSProvider,server=sun9.ata...">
| <attribute name="ProviderName">ATADevJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
| <!-- The queue connection factory -->
| <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
| <!-- The topic factory -->
| <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
| <!-- Uncomment to use HAJNDI to access JMS -->
| <attribute name="Properties">
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=jnp://sun9:7045
| </attribute>
| </mbean>
|
We have the following code in our MDB
| public void onMessage(Message message) {
| // MessageDrivenContext
|
| try {
| getDelegator().delegate(message);
| } catch (MessageDelegationException e) {
| LOGGER.fatal(e);
| // roll back the transaction
| if (!this.getMessageDrivenContext().getRollbackOnly()) {
| this.getMessageDrivenContext().setRollbackOnly();
| }
| }
|
| }
|
And this ejb-jar.xml
| <message-driven>
| <description>
| Bean to access messages from cats queues
| </description>
| <display-name>CATSMessageAccess</display-name>
|
| <ejb-name>ejb/CATSMessageAccess</ejb-name>
|
| <ejb-class>
| com.ata.utilities.mdd.MessageAccessBean
| </ejb-class>
|
| <transaction-type>Container</transaction-type>
| <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
|
| <message-driven-destination>
| <destination-type>javax.jms.Queue</destination-type>
| </message-driven-destination>
|
| </message-driven>
|
|
If the POJO code fails by throwing an exception and the message tries to roll back the transaction, I get this exception and the message is removed from the queue on the remote server.
| 21:10:02,765 INFO [STDOUT] 21:10:02,765 INFO [SessionFactoryImpl] closing
| 21:10:02,765 ERROR [LogInterceptor] RuntimeException in method: public abstract void javax.jms.Messa
| geListener.onMessage(javax.jms.Message)
| java.lang.IllegalStateException: getRollbackOnly must only be called in the context of a transaction
| (EJB 2.0 - 15.5.1)
| at org.jboss.ejb.MessageDrivenEnterpriseContext$MessageDrivenContextImpl.getRollbackOnly(MessageDri
| venEnterpriseContext.java:192)
| at com.ata.utilities.mdd.MessageAccessBean.onMessage(MessageAccessBean.java:78)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:324)
| at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:458
| )
|
|
I thought I should be running in an XA container transaction, so when I roll back on my MDB, my local JDBC transactions do not commit (that works), and the read from the remote queue should roll back. Why am I not running in a transaction, and why does my remote queue lose the message? I?m assuming once I fix the local transaction problem, that the reading from the queue will succeed. Any help would be greatly apprecaited. I can't seem to find anything in the doc that would explain something I've missed. Reading from the queue works perfectly, it just doesn't happen in a transaction as expected.
Thanks,
Todd
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971304#3971304
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971304
19 years, 7 months
[JBoss Seam] - Seam remoting on portal, session scope problem
by mauro.lopez
I've a component with session scope, i.e.:
@Scope(ScopeType.SESSION)
| @Name("myComponent")
| public class MyComponent {
| ...
| }
|
An this other component, with a remote method and a dependency to the above component:
@Name("someAction")
| public class MyAction {
|
|
| @WebRemote
| public void doSomethingWithMyComponent() {
| ...
| myComponent.doSomething();
| ..
| }
|
| @In(required = false)
| MyComponent myComponent;
|
| ...
| }
|
|
The above is used as follows (remember I'm developing a portlet):
1. At some point in the application flow, "myComponent" is instantiated (and put in session context).
2. Some page does an ajax request to MyAction.doSomethingWithMyComponent() through seam remoting.
3. well.... doesn't matter.
The fail comes at step 2, there a NPE is thrown, and the cause is myComponent is not injected! Well, really it is injected, but there happens to be no "myComponent" in session scope, so the component created in step 1 is not the one injected (I get a null due to @In(required = false)).
I've found that web remote seam components are invoked through the same url used for static resources (in JSR-168 perspective), which is correct, because neither a render url nor an action url would work alright since the portlet response (ajax requests's xml response) would be composed with other portlets' markup.
(now I think, the encodeUrl method shouldn't be used to build the ajax request url?)
The problem, I think, is that resource URLs are outside the portlet context, therefore the Portlet Session context is not available. Instead, what we've got is the HttpSession.
The component named "myComponent" can not be found in the HttpSession.
As JSR-168 states (PLT.15.4), the Portlet Session stores attributes in the HttpSession, but prefixed, that's why seam can't find it.
are there any plans to provide better support for remoting in a portal?
There seems to be two possibilities:
1. Wait for jboss portal ajax requests support, and integrate seam with it. See http://www.jboss.com/index.html?module=bb&op=viewtopic&t=90035&postdays=0...
2. Manage to recover the components when stored in prefixed HttpSession attributes. (through PortletSessionUtil). In this case, something should tell seam that the component was stored in X Portlet Session.
Thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971299#3971299
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971299
19 years, 7 months
[EJB 3.0] - Problem with NamedNativeQuery
by gmichalk
Hi,
JBoss 4.0.4, Linux
| @NamedNativeQuery(name="nbQuestionnairesParEndroitEtDate",
| query="SELECT COUNT(*) AS nb, endroit AS e, MONTH(dateeven) AS m, YEAR(dateeven) AS y from questionnaires group by m,y, e order by e,y,m",
| resultSetMapping="NbQuestionnairesParEndroitEtDateMapping")
|
| @SqlResultSetMapping(name="NbQuestionnairesParEndroitEtDateMapping",
| columns={
| @ColumnResult(name="n"),
| @ColumnResult(name="y"),
| @ColumnResult(name="m"),
| @ColumnResult(name="e")
| })
This query is called with em.createNamedQuery("nbQuestionnairesParEndroitEtDate").getResultList();
What I do not know is what bean to write ?
Would somebody have a working example ? The examples I found only do rely on an existing entity bean, but not on report
Thanks in advance,
Gerd
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971297#3971297
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971297
19 years, 7 months