users@glassfish.java.net

glassfish EJB problem

From: <glassfish_at_javadesktop.org>
Date: Sat, 13 Sep 2008 11:17:35 PDT

Here is the complete log MSG:
Invalid ejb jar [/opt/cisco/glassfish/domains/domain1/applications/j2ee-modules/ldap-1.0.1-SNAPSHOT]: it contains zero ejb. [b]Note: 1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message driven bean. 2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar. 3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven), [/b]please check server.log to see whether the annotations were processed properly. com.sun.enterprise.deployment.backend.IASDeploymentException: Error loading deployment descriptors for module [ldap-1.0.1-SNAPSHOT] -- Invalid ejb jar [/opt/cisco/glassfish/domains/domain1/applications/j2ee-modules/ldap-1.0.1-SNAPSHOT]: it contains zero ejb. Note: 1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message driven bean. 2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar. 3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven), please check server.log to see whether the annotations were processed properly. at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:390) at com.sun.enterprise.deployment.backend.ModuleDeployer.loadDescriptors(ModuleDeployer.java:423) at com.sun.enterprise.deployment.backend.EjbModuleDeployer.deploy(EjbModuleDeployer.java:140) at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:179) at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:191) at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108) at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:279) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:788) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:223) Caused by: java.lang.IllegalArgumentException: Invalid ejb jar [/opt/cisco/glassfish/domains/domain1/applications/j2ee-modules/ldap-1.0.1-SNAPSHOT]: it contains zero ejb. Note: 1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message driven bean. 2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar. 3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven), please check server.log to see whether the annotations were processed properly. at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:95) at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:729) at com.sun.enterprise.deployment.archivist.EjbArchivist.validate(EjbArchivist.java:190) at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:790) at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openArchive(ApplicationArchivist.java:744) at com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:349)

My project is very simple. Basically I am calling another successful deployed EJB project my on glassfish container to extract an object "user".

I have

import com.user;

@Remote
[b]public interface ldapbeanremote[/b] {
    User getUser(String uid);
}

and

@Stateless
[b]public class ldapbean implements ldapbeanremote[/b] {

    @PersistenceContext(name = "My JNDI Here")
    private EntityManager em;

    @Override
    public User getUser(String uid) {

        try {
            return (User) em.createNamedQuery("User.findByUid").setParameter("uid", uid).getSingleResult();
        } catch (Exception ex) {
            //exception stuff here....
        }
    }
}

My EJB Maven builds successfully, however, when I deploy it on glassfish, it returned the MSG above. Particularly it says, that my project doesn't have any ejb component. Please help me!!!! I am really stock and you guys are my last hope. Thanks.
[Message sent by forum member 'samsina' (samsina)]

http://forums.java.net/jive/thread.jspa?messageID=299224