[JBoss Seam] - Extended EL support (with parameters) -> MethodNotFoundExcep
by rizzojo
Hi, I'm a Seam newbie trying to learn it.
I've an issue with the use of extended EL in datatables to pass parameters.
I can make the booking example (tutorial) work and it uses that feature.
But I cannot make it work for my project.
(fragment of) The xhtml code of the table:
| <h:dataTable var="usr" value="#{userList}" rendered="#{userList.rowCount>0}">
| <h:column>
| <f:facet name="header">
| <h:outputText value="User Name"/>
| </f:facet>
| #{usr.userName}
| </h:column>
| <h:column>
| <f:facet name="header">
| <h:outputText value="User ID"/>
| </f:facet>
| <s:link value="#{usr.id}" action="#{userEdit.selectUser(usr)}"/>
| <s:link value="#{usr.id}" action="#{userEdit.selectTest}"/> User(usr)
| </h:column>
|
| </h:dataTable>
|
This table contains 2 columns with:
- #{usr.userName}
- links with #{usr.id}
In the second column, the first link has a parameter
<s:link value="#{usr.id}" action="#{userEdit.selectUser(usr)}"/>
and the other link has no parameter (other method)
<s:link value="#{usr.id}" action="#{userEdit.selectTest}"/>
Here is the Java code of the "userEdit" seam bean, which is a SFSB.
| @Stateful
| @Scope(EVENT)
| @Name("userEdit")
| public class UserEditAction implements UserEdit {
| ....
| public void selectUser(UserProfile selectedUser) {
| System.out.println("EDITINGUSER Selected: "+ editingUser);
| }
|
| public void selectTest(){
| System.out.println("LINK WORKS");
| }
| }
|
The Problem:
The first link (with the parameter, extended EL) does not work, while the second link (no parameter, standard EL) works well.
In the browser, here are the urls of each links:
1ST:
http://localhost:8080/TestWeb/userlist.seam?dataModelSelection=usr%3Auser...
2ND:
http://localhost:8080/TestWeb/userlist.seam?dataModelSelection=usr%3Auser...
On the JBoss console, seam produces a stack trace when clicking the first link.
| 15:30:54,735 ERROR [SeamPhaseListener] uncaught exception
| javax.el.MethodNotFoundException: Method not found: UserEditAction:a2s3g6b-z96rab-fb0tnazx-1-fb0treof-s.selectUser(be.post.jr.domain.UserProfile)
| at org.jboss.el.util.ReflectionUtil.findMethod(ReflectionUtil.java:215)
| at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:273)
| at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
| at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
| at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
| at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
| at org.jboss.seam.navigation.Pages.callAction(Pages.java:634)
|
Note in the stack trace, that some strange string has been added to the name of the method:
UserEditAction:a2s3g6b-z96rab-fb0tnazx-1-fb0treof-s.selectUser(be.post.jr.domain.UserProfile)
I must admit that I cannot find the cause by myself, even with comparing with the book (Yuan) and the examples.
Does anybody have an idea for me ?
Many thanks.
John Rizzo.
Environment:
Facelets
Seam 2.0.1.CR1.
JBoss-4.2.2.GA
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117076#4117076
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117076
18 years, 3 months
[JBoss Portal] - Using a commandLink with tomahawk tree2
by alex.alvarez
Hello,
I am using myfaces1.1.5 with tomahawk1.1.6, using facelets and JBoss Portal 2.6.3
I have a t:tree2 component where each node has an embedded commandLink. Here is the code:
<t:tree2 id="serverTree" value="#{editUser.treeData}" var="node" varNodeToggler="t" clientSideToggle="false" showNav="true" imageLocation="/images">
...
<f:facet name="dynamic-folder">
<h:panelGroup>
<h:commandLink immediate="true" action="#{t.toggleExpanded}" actionListener="#{editUser.expandDynamicFolder}">
<t:graphicImage value="/images/folder-open.png" rendered="#{t.nodeExpanded}" />
<t:graphicImage value="/images/folder.png" rendered="#{!t.nodeExpanded}" />
<h:outputText value="#{node.description}" styleClass="nodeFolder"/>
</h:commandLink>
</h:panelGroup>
</f:facet>
I was able to click in the nodes and launch the commandLink action before i switched to Facelets. Now it doesn't work or it works on the first or second request and then nothing... If I look at the request parameters I see that the selected Node is there but the component doesn't seem to be able to decode it....
Parameters[docNum=1 | org.apache.myfaces.portlet.MyFacesGenericPortlet.VIEW_ID=/WEB-INF/jsf/userAdmin.xhtml | _id15jbpns_2fSmartPortal_2fdefault_2f35snpbj_SUBMIT=1 | _id15jbpns_2fSmartPortal_2fdefault_2f35snpbj:_link_hidden_= | _id15jbpns_2fSmartPortal_2fdefault_2f35snpbj:_idcl=_id15jbpns_2fSmartPortal_2fdefault_2f35snpbj:
serverTree:0:1:0:0:_id129jbpns_2fSmartPortal_2fdefault_2f35snpbj]
Any ideas?
regards,
Alex
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117075#4117075
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117075
18 years, 3 months
[JBossCache] - Re: Buddyrep issue
by FredrikJ
We do apply session affinity.
Look at this way:
1. Cache A starts
2. Cache A adds 10 nodes to the cache
3. Cache B starts
4. Cache B 'gets' the 10 nodes thus causing a gravitation
After #4 in the sequence we end up with the weird buddy rep settings as discussed above. This is exactly what we are doing in the test provided. We only go through the sequence once, we do not keep modifying/adding etc to the cache. (There is also a 5 second sleep between 3 and 4).
Just to clarify:
We do not add data to the cache while trying to read it.
We do not modify data to the cache while trying to read it.
In fact there is no concurrent access at all in the test provided.
The issue is clearly related to data gravitation, in the logs we see that the buddy backup is correctly setup before gravitation occurs (i.e. after #3 in the sequence above), but has changed to include itself after data gravitation has occurred (after #4 in the sequence).
I'll try and make a comparison run with 2.0.0 GA and post the logs, if behavior is unchanged then we should get the same buddy backup result.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117065#4117065
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117065
18 years, 3 months
[JNDI/Naming/Network] - javax.naming.NoInitialContextException: Can't find property:
by joepareti
I am developing a demo based on JBOSS 4.2.0.CR2 on Linux RHEL 3/x86.
The demo includes an EJB (stateless session bean), and a client app that requests services from the bean.
I invariably get the following rt error when launching the client as
# ant runClientApp
[java] javax.naming.NoInitialContextException: Can't find property: java.naming.factory.initial
[java] at javax.naming.spi.NamingManager.getInitialContext(j ava.util.Hashtable) (/lib/ssa/libgcj.so.4.0.0)
[java] at javax.naming.InitialContext.getDefaultInitCtx() (/lib/ssa/libgcj.so.4.0.0)
[java] at javax.naming.InitialContext.getURLOrDefaultInitCtx (java.lang.String) (/lib/ssa/libgcj.so.4.0.0)
[java] at javax.naming.InitialContext.lookup(java.lang.Strin g) (/lib/ssa/libgcj.so.4.0.0)
[java] at za.co.solms.finance.calculators.LoanCalculatorPane l.connect() (Unknown Source)
[java] at za.co.solms.finance.calculators.LoanCalculatorPane l.init() (Unknown Source)
[java] at za.co.solms.finance.calculators.LoanCalculatorPane l.LoanCalculatorPanel() (Unknown Source)
[java] at za.co.solms.finance.calculators.LoanCalculatorClie nt.LoanCalculatorClient() (Unknown Source)
[java] at za.co.solms.finance.calculators.LoanCalculatorClie nt.main(java.lang.String[]) (Unknown Source)
my jndi.properties, available in classpath and also under $JAVA_HOME, is as follows:
(I also saw jndi.properties is included in the client jar file, so I assume it is taken into account):
java.naming.factory.initial=org.jnp.interfaces.Nam ingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.namingrg. jnp.interfaces
jnp.socketFactory=org.jnp.interfaces.TimedSocketFactory
#Connection timeout (0 == blocking)
jnp.timeout=0
#Read timeout (0 == blocking)
jnp.sotimeout=0
Finally, I started playing around with the client code by e.g. changing the name of the bean in the lookup function ...
Object beanHomeRef
= jndiContext.lookup(jndiName);
into
Object beanHomeRef
= jndiContext.lookup("local/ejb/LoanCalculator");
but without any results
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117059#4117059
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117059
18 years, 3 months