2010-07-13 24 views
2

Je tente de déployer une application qui utilise EJB sur weblogic 10.3. J'utilise la couture de cadre 2.2.0weblogic ejb ComplianceException

J'ai créé un projet EJB et un projet EAR avec atelier.

Quand je compilez le projet, je reçois cette erreur:

weblogic.ejb.container.compliance.ComplianceException: No business interface, component interface or web service endpoint interface found for Session Bean Authenticator 

Voici le code de haricot:

import javax.ejb.Local; 
import javax.ejb.Stateless; 
import javax.persistence.EntityManager; 
import org.jboss.seam.annotations.In; 
import org.jboss.seam.annotations.Logger; 
import org.jboss.seam.annotations.Name; 
import org.jboss.seam.contexts.SessionContext; 
import org.jboss.seam.faces.FacesMessages; 
import org.jboss.seam.faces.Redirect; 
import org.jboss.seam.log.Log; 
import org.jboss.seam.security.Credentials; 
import org.jboss.seam.security.Identity; 
import org.jboss.seam.security.crypto.BinTools; 
import org.jboss.seam.security.management.IdentityManager; 
import org.jboss.seam.security.management.JpaIdentityStore; 

@Stateless 
@Local 
@Name("authenticator") 
public class Authenticator { 
} 

Et voici l'exception:

weblogic.ejb.container.compliance.ComplianceException: No business interface, component interface or web service endpoint interface found for Session Bean Authenticator 
    at weblogic.ejb.container.compliance.SessionBeanClassChecker.checkInterfacesExist(SessionBeanClassChecker.java:177) 
    at weblogic.ejb.container.compliance.Ejb30SessionBeanClassChecker.checkInterfacesExist(Ejb30SessionBeanClassChecker.java:27) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at weblogic.ejb.container.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:337) 
    at weblogic.ejb.container.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:286) 
    at weblogic.ejb.container.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:952) 
    at weblogic.ejb.container.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:920) 
    at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:246) 
    at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:552) 
    at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:519) 
    at weblogic.ejb.container.deployer.EJBDeployer.runEJBC(EJBDeployer.java:393) 
    at weblogic.ejb.container.deployer.EJBDeployer.compileJar(EJBDeployer.java:715) 
    at weblogic.ejb.container.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:618) 
    at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1154) 
    at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:425) 
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) 
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387) 
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) 
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58) 
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42) 
    at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615) 
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) 
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191) 
    at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16) 
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155) 
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248) 
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45) 
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516) 
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) 
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) 


    at weblogic.ejb.container.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:327) 
    at weblogic.ejb.container.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:286) 
    at weblogic.ejb.container.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:952) 
    at weblogic.ejb.container.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:920) 
    at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:246) 
    at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:552) 
    at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:519) 
    at weblogic.ejb.container.deployer.EJBDeployer.runEJBC(EJBDeployer.java:393) 
    at weblogic.ejb.container.deployer.EJBDeployer.compileJar(EJBDeployer.java:715) 
    at weblogic.ejb.container.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:618) 
    at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1154) 
    at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:425) 
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) 
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387) 
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) 
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58) 
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42) 
    at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615) 
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37) 
    at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191) 
    at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16) 
    at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155) 
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248) 
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45) 
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516) 
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) 
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) 
> 

Voici mon ejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" 
     version="3.0">  
    <interceptors> 
     <interceptor> 
     <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class> 
     </interceptor> 
    </interceptors> 

    <assembly-descriptor> 
     <interceptor-binding> 
     <ejb-name>Authentificator<ejb-name> 
     <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class> 
     </interceptor-binding> 
    </assembly-descriptor> 
</ejb-jar> 

Je ne comprends pas mon erreur.

Merci pour votre aide.

Répondre

10

Cela se produit car Weblogic recherche une interface implémentée par Authenticator.

Modification:

@Stateless 
@Name("authenticator") 
public class Authenticator implements AuthenticatorLocal { 

    @Override 
    public void oneMethod() 
    { 
     //enter code here 
    } 
} 

@Local 
public interface AuthenticatorLocal { 
    void oneMethod(); 
} 

Note: l'interface doit avoir au moins une méthode surchargée, sinon vous aurez à nouveau la même erreur.

0

se produit parce que weblogic recherchera une interface pour EJB Service sur place:

@Stateless 
@Local 
@Name("authenticator") 
public class Authenticator { 
} 

si vous implémenter une interface, et de fournir à EJB ce problème est résolu. Comme ceci:

@Stateless 
@Local(IAuthenticator.class) 
@Name("authenticator") 
public class Authenticator implements IAuthenticator{ 
//your business logic 
} 

public interface IAuthenticator { 
    // interface 
}