users@glassfish.java.net

Glassfish V2, deploying EJB module

From: <glassfish_at_javadesktop.org>
Date: Wed, 06 May 2009 03:04:26 PDT

Hi all,

I am posting here because I think it is a problem/feature related to Glassfish.

I am using:
 Glassfish V2
 Netbeans 6.5

I am going to deploy an EJB module on Glassfish using Netbeans. The EJB module consists of an entity class whose code has been generated by Netbeans automatically

@Entity
public class User implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    private String name;
    private String surname;

   + appropriate get/set methods
...



I can't deploy the EJB module. The errors are:

1)
moduleID=EJBModulePersistence
Deploying application in domain failed; Unrecognized module type for /frey0/ssi/work/sample-code/EJBModulePersistence/build/jar; the archive may be incorrectly constructed, non-existent, or inaccessible from the server.
For example, an application client jar should include the proper manifest file entry, and an ejb jar should contain at least one EJB.

2) from Glassfish
com.sun.enterprise.admin.common.exception.DeploymentException: Unrecognized module type for /ssi/work/sample-code/EJBModulePersistence/build/jar; the archive may be incorrectly constructed, non-existent, or inaccessible from the server.
For example, an application client jar should include the proper manifest file entry, and an ejb jar should contain at least one EJB.
        at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.getTypeFromFile(DeploymentServiceUtils.java:1273)
        at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:752)
        at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
        at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:225)
Caused by: java.io.IOException: Cannot determine the Java EE module type for /frey0/ssi/work/sample-code/EJBModulePersistence/build/jar
        at com.sun.enterprise.deployment.archivist.PluggableArchivistsHelper.getArchivistForArchive(PluggableArchivistsHelper.java:140)
        at com.sun.enterprise.deployment.archivist.PluggableArchivistsHelper.getArchivistForArchive(PluggableArchivistsHelper.java:98)
        at com.sun.enterprise.deployment.archivist.ArchivistFactory.getArchivistForArchive(ArchivistFactory.java:104)
        at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.getTypeFromFile(DeploymentServiceUtils.java:1268)
        ... 3 more


Everything works fine if I generate a session bean from the entity class. Does the application server use session beans to deploy the entity classes? It sounds weird... JBoss does not require the definition of a session bean for every entity bean.

Thanks in advance for your attention and sorry if this question turns out to be silly.
Marco
[Message sent by forum member 'mstn' (mstn)]

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