Ola pessoal, alguem poderia me dar uma ajuda com isso, estou usando o
application deployment tool para criar o .jar e esta ocorrendo o
seguinte erro:
For Home Interface [ ejb.demo.DemoHome ] method [ create ]
Error: A create method was found, but the return type [
ejb.demo.DemoHome ] was not the Remote interface [ Demo ]
Os .java sao:
package ejb.demo;
import java.rmi.RemoteException;
import java.rmi.Remote;
import javax.ejb.*;
public interface Demo extends EJBObject, Remote {
// NB this simple example does not even do a
// lookup in the database
public String demoSelect() throws RemoteException;
}
package ejb.demo;
import javax.ejb.*;
import java.io.Serializable;
import java.util.*;
import java.rmi.*;
public class DemoBean implements SessionBean {
static final boolean verbose = true;
private transient SessionContext ctx;
private transient Properties props;
// Implement the methods in the SessionBean
// interface
public void ejbActivate() {
if (verbose)
System.out.println("ejbActivate called");
}
public void ejbRemove() {
if (verbose)
System.out.println("ejbRemove called");
}
public void ejbPassivate() {
if (verbose)
System.out.println("ejbPassivate called");
}
/**
* Sets the session context.
*
* @param SessionContext
*/
public void setSessionContext(SessionContext ctx) {
if (verbose)
System.out.println("setSessionContext called");
this.ctx = ctx;
props = ctx.getEnvironment();
}
/**
* This method corresponds to the create method in
* the home interface DemoHome.java.
* The parameter sets of the two methods are
* identical. When the client calls
* DemoHome.create(), the container allocates an
* instance of the EJBean and calls ejbCreate().
*/
public void ejbCreate () {
if (verbose)
System.out.println("ejbCreate called");
}
/**
* **** HERE IS THE BUSINESS LOGIC *****
* Do the demoSelect() but don't even go to
* the database in this eg but instead just
* return a String.
* The really BIG thing to notice here is that
* this is the only code we have invented at all
* the rest of the code has been declarations
* or simply implementing methods which are
* part of the EJB interfaces and in this example
* are not even used.
*/
public String demoSelect()
throws RemoteException
{
return("hello world");
}
}package ejb.demo;
import javax.ejb.*;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.*;
/**
* This interface is extremely simple it declares only
* one create method.
*/
public interface DemoHome extends EJBHome {
public Demo create() throws CreateException, RemoteException;
}
Do You Yahoo!?
Send your FREE holiday greetings online at Yahoo! Greetings.
