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 57188 - resource-ref element for JDBC datasource isn't created in specific DD
Summary: resource-ref element for JDBC datasource isn't created in specific DD
Status: CLOSED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on: 57104
Blocks:
  Show dependency tree
 
Reported: 2005-03-30 13:18 UTC by Petr Blaha
Modified: 2006-03-24 12:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log (39.26 KB, text/plain)
2005-03-31 01:55 UTC, _ ludo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Blaha 2005-03-30 13:18:52 UTC
[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.
Comment 1 _ ludo 2005-03-30 17:09:29 UTC
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>
Comment 2 _ ludo 2005-03-30 19:27:07 UTC
seems to be a j2eeserver bug not calling our impl for ensureResourceDefined()
sometimes... Not sure why, but not a plugin bug for sure...
Comment 3 _ ludo 2005-03-31 01:55:36 UTC
Created attachment 21243 [details]
log
Comment 4 _ ludo 2005-03-31 01:56:24 UTC
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.
Comment 5 Nam Nguyen 2005-03-31 07:24:08 UTC
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.
Comment 6 Sherold Dev 2005-03-31 12:53:46 UTC
J2eeserver is not getting dd change events. It is most likely caused by a
ClonnableEditorSupport issue. Reassinging to Milan.
Comment 7 Milan Kuchtiak 2005-03-31 13:54:34 UTC
This also depends on issue 57104.
Comment 8 _ ludo 2005-03-31 16:55:05 UTC
We'll need to verify this also for ejb jar projects...not only web.xml
Comment 9 Petr Blaha 2005-03-31 16:59:48 UTC
This is working in EJB project. I tested in daily build 20050330.
Comment 10 Milan Kuchtiak 2005-04-02 08:30:47 UTC
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
Comment 11 Petr Blaha 2005-11-04 12:19:49 UTC
[build 20051103]