This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When creating an EJB3 webservice EJB and using within it an object defined in an external project (while choosing that the project be packaged in the EJB or the EAR) the external JAR gets packaged as a JAR and is thus not found during deployment causing deployment to fail. So far I couldn't even get an "ant" related workaround to work since the ant targets I tried to override just aren't getting called... Will need to look deeper into that when I get a chance. Copying the object used works perfectly. Steps to reproduce on Netbeans 5.5 with Sun One Application server 9 (the default that ships with NB): Create a shared library project, within it create a simple bean with one field. Create an EAR project which includes an EJB module but doesn't include a WAR. Add the shared library project to the EJB project as a required library that is packaged during build. In the EJB module create a new web service, add an operation that makes use of the simple bean within the shared object. Deployment will fail. To verify remove the shared library from the EAR then copy the simple bean into the EJB project. Deployment should succeed.
Tested on GlassFish V2 and got this error : mbean.deploy_failed com.sun.enterprise.admin.common.exception.DeploymentException: Error attempting to determine the Java EE module type for /space/home/mkuchtiak/glassfish_v2/domains/domain1/config/EJBModule2.jar; the archive may be incorrectly constructed, non-existent, or inaccessible from the server at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.getTypeFromFile(DeploymentServiceUtils.java:1187) at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:707) at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174) at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210) Caused by: java.io.IOException: Cannot determine the Java EE module type for /space/home/mkuchtiak/glassfish_v2/domains/domain1/config/EJBModule2.jar at com.sun.enterprise.deployment.archivist.PluggableArchivistsHelper.getArchivistForArchive(PluggableArchivistsHelper.java:124) at com.sun.enterprise.deployment.archivist.PluggableArchivistsHelper.getArchivistForArchive(PluggableArchivistsHelper.java:85) at com.sun.enterprise.deployment.archivist.ArchivistFactory.getArchivistForArchive(ArchivistFactory.java:93) at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.getTypeFromFile(DeploymentServiceUtils.java:1182) ... 3 more
I reported a GlassFish issue for this : https://glassfish.dev.java.net/issues/show_bug.cgi?id=2511
I reopened again the GlassFish bug.
According to the response from GlassFish people there is no standard way to package jar files to standalone EJB module. Use Enterprise Appplication project for that. However, we should probably inform user about this behaviour when libraries are being added to standalone EJB project.
This is not a defect, the behavior is according to the Java EE spec. When the EJB module is deployed as part of an enterprise application, everything works as expected. Closing as invalid.