Runtime Exception during deployment with Embedded EJB3
pkraemer Jun 3, 2007 11:11 AMHello,
during deployment of my stateless Session Bean I get a RuntimeException:
java.lang.RuntimeException: bean class has no local, webservice, or remote interfaces defined and does not implement at least one business interface at org.jboss.ejb3.ProxyFactoryHelper.getLocalInterfaces(ProxyFactoryHelper.java:107) at org.jboss.ejb3.ProxyDeployer.initializeLocalBindingMetadata(ProxyDeployer.java:115) at org.jboss.ejb3.SessionContainer.instantiated(SessionContainer.java:110) at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:415) at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:397) at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:378) at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:350) at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:305) at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.create(EJB3StandaloneDeployer.java:440)
I wrote a class for Deployment, a ManagedBean (called from a JSF Page) and a Stateless SessionBean implementing a local Interface.
@Local
public interface SecurityLocal {
public void doSomethingElse();
}
@Stateless
public class SecuritySBean implements SecurityLocal{
@PersistenceContext(unitName="EnterpriseSaturn")
EntityManager em;
public void doSomethingElse(){
System.out.println("Hallo");
}
}
//ManagedBean
public class LoginBean {
private SecurityLocal securityLoc;
public String doLogin(){
String rolePage=null;
try{
if(securityLoc==null){
deployment.getDeploymentUtil().createDeployer();
securityLoc=(SecurityLocal)
deployment.getDeploymentUtil().startDeployment("/SecuritySBean/local");
}
securityLoc.doSomethingElse();
}
catch(Exception e){
e.printStackTrace();
}
System.out.println("LOOKUP Ergebnis: "+rolePage);
return rolePage;
}
}
public class DeploymentUtil {
private static DeploymentUtil deployment;
public EJB3StandaloneDeployer deployer;
private DeploymentUtil(){
}
public static DeploymentUtil getDeploymentUtil(){
if(deployment==null){
deployment=new DeploymentUtil();
}
return deployment;
}
public void createDeployer(){
if(deployer==null){
System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
System.out.println("DEPLOYEMENT GESTARTET");
EJB3StandaloneBootstrap.boot(null);
deployer = EJB3StandaloneBootstrap.createDeployer();
deployer.getArchivesByResource().add("META-INF/persistence.xml");
deployer.setJndiProperties(getInitialContextProperties());
try {
deployer.create();
deployer.start();
} catch (Exception e) {
e.printStackTrace();
}
}
System.out.println("DEPLOYMENT ERFOLGREICH");
}
public Object startDeployment(String interfURL){
System.out.println("LOOKUP for: "+interfURL);
try {
InitialContext ctx = getInitialContext();
return ctx.lookup(interfURL);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
What's going wrong? Can anybody help me please?
Thx