[JBoss Seam] - CommandLink in DataTable: Session vs Conversation scope
by thatrichard
Here is a bean and jsf form that implement a simple search. The emboldened commandLink ought to be invoking the bean's "select" method, which it does.
However, this only works when I include the emboldened Scope annotation. Without it, the scope will be Conversation and the conversation will be promoted to a long-running conversation by the "find" method.
I'm stumped as to why this won't work in conversation mode. More perplexingly (or perhaps reveallingly) the commandButton at the bottom of the form works even though it has the same action. The only difference that I can see is that it is outside of the dataTable.
I have come posts such as this one:
http://forum.java.sun.com/thread.jspa?threadID=549675&start=0 , which suggests that others have encountered this behaviour.
Clearly there is something about conversations that I don't understand.
Can anyone help?
Thanks
Richard
| @Name("partyFinder")
| @Stateful
| @Scope(ScopeType.SESSION)
| public class PartyFinderBean implements PartyFinder {
|
| @DataModel
| private List<Party> matchingParties;
|
| @DataModelSelection
| private Party selectedParty;
|
| @In
| private Session session;
|
| @Begin(flushMode=FlushModeType.MANUAL, join=true)
| public String find() {
| Party example = new Person();
| //do the search
| matchingParties = ...
| return null;
|
| }
|
| public String select() {
| log.info("SELECT INVOKED");
| return "/forms/party/person/identity";
| }
|
| @Remove @Destroy
| public void destroy() { }
|
| }
|
|
| <h:form>
| <h:dataTable value="#{matchingParties}" var="selectedParty">
| <h:column>
| <f:facet name="header">
| <h:outputText value="Last Name"/>
| </f:facet>
| <h:commandLink value="#{selectedParty.lastName}" action="#{partyFinder.select}"/>
| </h:column>
| </h:dataTable>
| <div class="action-bar">
| <h:commandButton id="newperson" value="Create New Person" action="#{personEditor.enterIdentity}" />
| <h:commandButton id="test" value="Test Select" action="#{partyFinder.select}" />
| </div>
| </h:form>
| [/url]
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058077#4058077
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058077
18Â years, 10Â months
[JBoss Messaging] - 1.3.0 messaging client
by aslak
There seem to be a dependency issue with the jboss messaging client lib in 1.3.0.
Running a JMS client with the following dependencies:
/opt/jboss-4.2.0.GA/client/javassist.jar
/opt/jboss-4.2.0.GA/client/jbossall-client.jar
/opt/jboss-4.2.0.GA/client/log4j.jar
/opt/jboss-4.2.0.GA/client/trove.jar
/opt/jboss-4.2.0.GA/client/jboss-messaging-client.jar
results in:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/aop/pointcut/PointcutStats
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.(ClientConnectionFactoryDelegate.java)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
at java.lang.reflect.Field.getLong(Field.java:528)
at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1614)
at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:425)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.(ObjectStreamClass.java:413)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:547)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
Adding this to the classpath and it all works:
/opt/jboss-4.2.0.GA/server/messaging/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar
The client lib shouldn't have to depend directly on a server deployed lib..
-aslak-
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058076#4058076
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058076
18Â years, 10Â months