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.

Bug 76055 - sun-ejb-jar.xml not updated when new ejb (session or entity) created
Summary: sun-ejb-jar.xml not updated when new ejb (session or entity) created
Status: RESOLVED WORKSFORME
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ pcw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-07 18:20 UTC by hanasaki
Modified: 2006-06-04 23:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hanasaki 2006-05-07 18:20:23 UTC
netbeans-5_5-daily-bin-200605050500-5_May_2006_0500.zip

Just downloaded and installed the daily buidl (above) and made a new J2EE5
project.  Created stateless and stateful sesion beans.  sun-ejb-jar.xml was not
updated to include them.  deploy failed because 

com.sun.enterprise.deployment.backend.IASDeploymentException: Error loading
deployment descriptors for module [GeneralServer] -- Invalid ejb jar
GeneralServer-ejb.jar: it contains zero ejb. A valid ejb jar requires at least one
session/entity/message driven bean.
        at
com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:362)
        at
com.sun.enterprise.deployment.backend.AppDeployerBase.loadDescriptors(AppDeployerBase.java:327)
        at
com.sun.enterprise.deployment.backend.AppDeployer.explodeArchive(AppDeployer.java:332)
        at
com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:182)
        at
com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:129)
        at
com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169)
        at
com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
        at
com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)
        at
com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
        at
com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739)
        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.lang.IllegalArgumentException: Invalid ejb jar
GeneralServer-ejb.jar: it contains zero ejb. A valid ejb jar requires at least
one session/entity/message driven bean.
        at
com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:81)
        at
com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:69)
        at
com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:669)
        at com.sun.enterprise.deployment.Application.visit(Application.java:1734)
        at
com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:457)
        at
com.sun.enterprise.deployment.backend.Deployer.loadDescriptors(Deployer.java:342)
        ... 11 more
|#]


maybe related to issue 57684 ?
Comment 1 hanasaki 2006-05-08 01:47:49 UTC
just made a new MsgDrivenBean... looks like the sun-ejb-jar.xml was totally
overwritten with an empty descriptor, killing the manual edits that had been made.
Comment 2 _ pcw 2006-05-08 19:08:38 UTC
If you have an EJB module that has no EJB's, changing the contents of
sun-ejb-jar.xml directly will not impact this and in fact, it is possible that
such manual edits to this file to change properties of a non-existent EJB will
disappear due to our JSR-88 implementation.

The correct way to solve the problem is to make sure that you have at least one
EJB and that it is properly annotated or otherwise specified in the standard
deployment descriptor.
Comment 3 hanasaki 2006-05-08 19:18:58 UTC
I think you are saying... 
1. do not manually edit the sun-ejb-jar.xml
2. make new EJB's with the Netbeans wizard and it will take care of editing the
descriptor for me and/or the descriptor need not be udpated because the EJB3
annotations on session/entity/mdb have everything that is needed?  Please
elaborate...

I had manually edited the sun-ejb-jar.xml becuase 1. it was not updated by
netbeans 2. I had made a Stateless session bean and MDB with the Netbeans
wizards and deployed to glassfish as installed by
glassfish-installer-v2-b01-nightly-06_may_2006.jar
and glassfish (also jboss 4.04RC) complained there were no beans (as below)
Comment 4 _ pcw 2006-05-08 19:27:48 UTC
Re 1.  Not exactly.  Most manual edits are fine and in fact if the system
thought you had a session bean of a specific name and you added via the XML
editor a correct entry into sun-ejb-jar.xml for that session bean, your edits
would not have been removed.  But if there is a bean entry in sun-ejb-jar.xml
and no corresponding bean in ejb-jar.xml or annotations is found, the edits in
sun-ejb-jar.xml can in fact be deleted.  It's a side effect of the _real_
problem here.

Re 2.  If you make beans via the wizards they are supposed to be properly
annotated.  If they are not, it's a bug (and please file if you see this). 
However you should also be able to manually annotate beans and if you can't or
by doing so you get into invalid or non-operational states when your code is
correct, this is also a bug and should be filed.

The situation you are describing here sounds like a bug and I'll check into it
later today when I'm at the office.  I wanted to clarify that the comment on
sun-ejb-jar.xml is very possibly a red herring.
Comment 5 Erno Mononen 2006-05-18 08:57:18 UTC
Reassigning, please evaluate.
Comment 6 _ pcw 2006-05-18 23:26:37 UTC
I am not able to reproduce this problem with current daily builds.  Closing as
"works for me".

Feel free to reopen if you upgrade to latest build and are still having
difficulties.