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.
Build: NB 5.5 beta 3rd July 06 daily, pack 9th May 06 I am using the @EJB annotation to allow one session EJB to inject a reference to another: @Stateful public class PurchaseBean implements PurchaseRemote { ... @EJB(name="ejb/processPayment", beanInterface=ProcessPaymentLocal.class, beanName="ProcessPaymentBean") private ProcessPaymentLocal payment; ... } The expectation was that the @EJB sets up the ENC entry "java:comp/env/ejb/processPayment" and that the actual JNDI deployment name would be specified in sun-ejb-jar.xml First of all netbeans seems to generate: <ejb> <ejb-name>PurchaseBean</ejb-name> <ejb-ref> <ejb-ref-name>payment</ejb-ref-name> <jndi-name>ejb/payment</jndi-name> </ejb-ref> </ejb> no matter what arguments I pass to @EJB. So I changed the file manually to look like this: <ejb> <ejb-name>PurchaseBean</ejb-name> <ejb-ref> <ejb-ref-name>ejb/processPayment</ejb-ref-name> <jndi-name>uk.ac.aber.dcs.bookshop.model.ProcessPaymentLocal</jndi-name> </ejb-ref> </ejb> This deployed fine and worked. However, if I exit Netbeans and start it again, my sun-ejb-jar.xml settings are overwritten and set back to the first example shown above! If I just use @EJB without any arguments and delete the sun-ejb-jar.xml file then during deployment I receive the error: Deploying application in domain failed; Error loading deployment descriptors for module [BookshopWithJSPandEJB] -- This application client has no ejb refernce by the name payment and the file is re-created with the default contents on stop exiting and starting NB anyway. Is there some way of telling NB 5.5 not to re-create the sun-ejb-jar.xml file but leave it alone? Shouldn't NB 5.5 derive information from the name parameter of the @EJB annotation and use that in the xml file? There is also a mappedName para that it could use. Regards Chris Loftus
Could you provide specific steps to reproduce your projects (or attach an example)? Questions I have include: Is this just in one EJB module or two? Are you using remote or local interfaces to call the EJB? It appears to be a naming bug inside NetBeans, but I have been unable to reproduce this scenario to confirm.
Reporter says works in beta 2 and I can't reproduce either in current dev builds. Closing as WORKSFORME.