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 20050329] Steps: 1) create J2EE application 2) add servlet in web module 3) invoke Enterprise resource - Use database lookup method is generated, but resource-ref element in sun-ejb-jar.xml is missing.
Just tried with my latest build and I cannot reproduce this.... Please, confirm you can reproduce this. If ys, attach the ide log to chekc the environment... My sun-web.xml contains: <resource-ref> <res-ref-name>jdbc/myDatabaseludo</res-ref-name> <jndi-name>jdbc/myDatabaseludo</jndi-name> </resource-ref> and web.xml contains: <resource-ref> <description>jdbc:pointbase://localhost:9092/sample [pbpublic on PBPUBLIC]</description> <res-ref-name>jdbc/myDatabaseludo</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref>
seems to be a j2eeserver bug not calling our impl for ensureResourceDefined() sometimes... Not sure why, but not a plugin bug for sure...
Created attachment 21243 [details] log
scenario: for now: start with fresh user dir and register the AS 8.1 then 1/ start IDE 2/ create Web App - our trace shows 2 dconfigeans for name=org.netbeans.modules.j2ee.sun.share.configBean.WebAppRoot 3/ add a servlet -our trace shows name=org.netbeans.modules.j2ee.sun.share.configBean.ServletRef 4/ in the servlet file, call the "Use Database" popup menu, pick a pointbase db and returns - at that time, our trace is no called - at that time, if OUTSIDE the IDE, you look at web.xml, it is saved and contains the correct resource-ref entry, but sun-web.xml file does not contain it. 5/ in the project explorer, navigate to web.xml node, right click and select "Edit" menu to open the xml editor - at that time, our trace displays "in ensureConfigurationReady" 2 times, then our DConfigBeans is created (see our trace name=org.netbeans.modules.j2ee.sun.share.configBean.ResourceRef So 5 is done way too late, it should be done immediately after 4, not after 5... See the attachment.
On #2, after reviewing j2eeserver config code, I am no longer concern about 2 WebApp instances. These 2 are from 2 different calls to getDConfigBeanRoot on 2 instances of DeploymentConfiguration. Only one of them get hold on to in config cache in ModuleDeploymentSupport. Plugin might just cache and return the same instance of DeploymentConfiguration for performance improvement. On #4,5: UseDatabaseAction add the ResourceRef snipplet and save the graph to xml. I am not familiar with technique use there, so cannot comment why BEAN_ADDED event is not generated there immediately. And why the graph merge would only happen when we open web.xml. Maybe Chris, Milan, Peter W or s/o with extensive knowledge on schema2beans graph could look into this behavior. This seems to be a recent behavior not seen before. I don't think this is j2eeserver issue at this time. I am reassign this back to Ludo.
J2eeserver is not getting dd change events. It is most likely caused by a ClonnableEditorSupport issue. Reassinging to Milan.
This also depends on issue 57104.
We'll need to verify this also for ejb jar projects...not only web.xml
This is working in EJB project. I tested in daily build 20050330.
57104 fix helped. I've changed the way how deployment descriptor changes are implemented. See : http://web.netbeans.org/source/browse/web/project/src/org/netbeans/modules/web/project/WebContainerImpl.java?r1=1.11&r2=1.12
[build 20051103]