This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I started learning ejb3 on JBOSS 4.22. I am new to JBOSS. I wrote one session bean and created JAR. I deployed that JAR in JBOSS. But while running client, I got into many ClassNotFoundErrors. I tried to resolve them by finding required JAR and adding it to classpath.
In my following code, I am getting following error.
method sayHello(String name) must override superclass method.
Did you try to remove the @Override? As far as I can see, it does not override a method but implements an interface ...
Joined: May 02, 2008
I tried both with or without @Override
The code gets compiled without any error. But when I run, I get following error which is strange
D:\TestEJB3\src>java com.test.Test Exception in thread "main" javax.ejb.EJBException: java.lang.RuntimeException: j ava.lang.Error: Unresolved compilation problem: The method sayHello(String) of type SayHelloBean must override a superclass method
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63) at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83) at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java :191) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation. java:101) at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
Joined: May 02, 2008
I did silly mistake, my earlier deployment jar had compilation error. After resolving it, I forgot to create new jar and redeploy.