[jboss-user] [EJB 3.0] - Re: inject @EJB dosn't work with 4.0.5
cjc
do-not-reply at jboss.com
Mon Nov 6 19:14:41 EST 2006
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
More information about the jboss-user
mailing list