Hi
I can write a ejb like this...
-----------------------------------------------------------------------------------------------------
@Stateless
public class AnotherBean {
@PersistenceContext(unitName = "VoidJPA-ejbPU")
private EntityManager em;
public void newTest() {
System.out.println("Testing");
}
}
-----------------------------------------------------------------------------------------------------
And call it using this from a servlet
----------------------------------------------------------------------------------------------------
@EJB
private AnotherBean nsb;
...
...
nsb.newTest();
----------------------------------------------------------------------------------------------------
But whenever i put a variable into newTest() i cannot access it
----------------------------------------------------------------------------------------------------
public void newTest(String i)
----------------------------------------------------------------------------------------------------
The servlet and EJB are both deployed but still the server gives the error
-----------------------------------------------------------------------------------------------------
WARNING: StandardWrapperValve[HelloEjb]: PWC1406: Servlet.service() for servlet
HelloEjb threw exception
java.lang.NoSuchMethodError: enew.AnotherBean.newTest(Ljava/lang/String;)V
at jpa.HelloEjb.processRequest(HelloEjb.java:44)
at jpa.HelloEjb.doGet(HelloEjb.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
.....
........
......
----------------------------------------------------------------------------------------------------
Any Help
Thanks
Pradyut
India
[Message sent by forum member 'pradyut']
http://forums.java.net/jive/thread.jspa?messageID=481191