[JBoss Seam] - Showing nested objects in nested tables
by forumer
I have following objects:
AllManagers.java
ArrayList managers;
Manager.java
String name;
Arraylist employees;
Employee.java
String name;
int yearsOfService;
I'd like to be able to show one table, AllManagers, each row of which contains information about each manager - name and in the next cell a list of all his employees.
So I started with
| <h:dataTable value=#{allManagers} var="manager">
|
Then nested inside it
| <h:dataTable value="#{manager.employees}" var="employee">
| <h:column>
| <h:selectOneMenu readonly="true">
| <f:selectItems value="#{employee.name}" />
| </h:selectOneMenu>
| </h:column>
|
for allManagers. The name shows up as expected. But the employees are not showing up!
Is this the right way to handle such a situation? I'd appreciate any references or tips.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983608#3983608
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983608
19Â years, 6Â months
[EJB 3.0] - Re: inject @EJB dosn't work with 4.0.5
by cjc
Thx allot ALRubinger,
this solve the NullpointerException!! I forgot to add the new Jars to my Eclipse Project *ups* i use this library's from jboss 4.0.5 now:
*jboss-ejb3x.jar
*hibernate-client.jar
*ejb3-persistence.jar
But yet i get this crazy error!
Work right!!
WM_MailManager mm =(WM_MailManager) new InitialContext().lookup("WM_MailManagerBean/local");
| mm.deleteAllMailsInFolder(folder,userId,leaveHashes);
Create the following error!
@EJB
| WM_MailManager mailManager;
| ....
|
| mailManager.deleteAllMailsInFolder(folder,userId,leaveHashes);
anonymous wrote : 00:55:33,281 ERROR [STDERR] javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalArgumentException: Wrong target. class wm2.ejb.session.WM_MailManagerBean for public void wm2.ejb.session.WM_MailManagerBean.deleteAllMailsInFolder(wm2.ejb.entity.WM_Folder,java.lang.Integer,boolean) throws wm2.exception.WM_PermissionDenied
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:93)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:201)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:131)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:58)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
| 00:55:33,281 ERROR [STDERR] at $Proxy687.deleteAllMailsInFolder(Unknown Source)
| 00:55:33,281 ERROR [STDERR] at wm2.ejb.session.WM_FolderManagerBean.recrusiveDeleteFolderAndContent(WM_FolderManagerBean.java:264)
| 00:55:33,281 ERROR [STDERR] at wm2.ejb.session.WM_FolderManagerBean.deleteFolderAndContentRecrusive(WM_FolderManagerBean.java:242)
| 00:55:33,281 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 00:55:33,281 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 00:55:33,281 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 00:55:33,281 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:131)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| 00:55:33,281 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
| 00:55:33,281 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
| 00:55:33,281 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
| 00:55:33,281 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412)
| 00:55:33,281 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
| 00:55:33,281 ERROR [STDERR] Caused by: java.lang.IllegalArgumentException: Wrong target. class wm2.ejb.session.WM_MailManagerBean for public void wm2.ejb.session.WM_MailManagerBean.deleteAllMailsInFolder(wm2.ejb.entity.WM_Folder,java.lang.Integer,boolean) throws wm2.exception.WM_PermissionDenied
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.handleErrors(MethodInvocation.java:141)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:116)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 00:55:33,281 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
| 00:55:33,281 ERROR [STDERR] ... 54 more
|
WM_Folder:
package wm2.ejb.entity;
|
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.GeneratedValue;
| import javax.persistence.GenerationType;
| import javax.persistence.Id;
| import javax.persistence.NamedQueries;
| import javax.persistence.NamedQuery;
| import javax.persistence.OneToMany;
| import javax.persistence.Table;
|
| @SuppressWarnings("serial")
| @Entity
| @Table(name="folder")
| @NamedQueries({
| ....
| })
|
| public class WM_Folder implements Serializable{
| ....
| }
thx 4 help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983606#3983606
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983606
19Â years, 6Â months
[JBoss Seam] - JBoss Seam and ConcurrentAccessException with Stateful Sessi
by ejb3workshop
I would like to use a stateful session bean to maintain state within the business tier. I tried putting a reference to the SFSB onto the HTTP session, yet this lead to ConcurrentAccessException during double clicks, HTML frames etc. I understand from several posts I found online that there are a number of options.
1.) Handle the exception on the presentation / web tier
This option would make the presentation tier more complex
2.) Move the state to the presentation / web tier
This polutes the responsibilities of each tier and will have impact on performance as the state has to be passed between the two tiers
3.) Synchronize around SFSB invocation
This will work, but somehow does not feel right. It would be nice if there was a client side interception layer which could do this for me though.
4.) Use Stateless beans and store the state in a cache
This introduces the complexity of managing the cache on the business tier and the burden of passing the key to the cache between the two tiers.
I have also come across the Conversation Session Scope which is used in several examples. I am wondering if this offers a solution, or if it simply changes the granularity of the problem.
Several posts seem to allude to an elegant solution, jet don't provide the details. Please could somebody direct me to a nice elegant solution to this problem.
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983604#3983604
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3983604
19Â years, 6Â months