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 50007 - blank sun-application.xml editor
Summary: blank sun-application.xml editor
Status: CLOSED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Nam Nguyen
URL:
Keywords:
Depends on:
Blocks: 50133
  Show dependency tree
 
Reported: 2004-10-06 12:42 UTC by Jan Horvath
Modified: 2006-03-24 10:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack traces. (9.46 KB, text/plain)
2004-10-07 01:33 UTC, _ pcw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Horvath 2004-10-06 12:42:45 UTC
build 041006

1. create J2EE app
2. create Web app
3. add WebApp to J2EE app
4. open sun-application.xml
   -visual editor is blank despite before adding
WebApp works fine
Comment 1 Vince Kraemer 2004-10-07 01:13:38 UTC
I did a quick look at this.

Here is what I see (when the page opens blank [due to an NPE at 
org.netbeans.modules.j2ee.deployment.config.ConfigurationStorage.java
(line 132)...

Line 132 is a trivial NPE due to not checking for null.

Line 131 is where things are interesting:

        ModuleDeploymentSupport mds = (ModuleDeploymentSupport)
moduleMap.get(module.getUrl());


module is an instance of ProjectWebModule.
getUrl() returns "".
This return value is hard-coded last I checked.

Looks like Nam,Pavel and (maybe) I need to dig into this.

I tested an app with an ejb module (and saw the same issue/result).
Comment 2 _ pcw 2004-10-07 01:32:30 UTC
See attached traces for more information.

If the steps above are followed verbatim, there is a NPE in the log in
ConfigBeanStorage during creation of the config editor (see Vince's
comment above.)

If the projects are closed and then reopened (possibly requiring a new
IDE session), and the user attempts to merely open sun-application.xml
directly, the NPE above is gone and either an ArrayStoreException or
an IllegalStateException are thrown during node manipulation while
creating the config editor.
Comment 3 _ pcw 2004-10-07 01:33:17 UTC
Created attachment 18110 [details]
stack traces.
Comment 4 Nam Nguyen 2004-10-07 01:38:58 UTC
This is a bug in configBeanTopComponent.  I will fix it.  The arguemnt
to getNodes should be changed to the url where the j2eemodulecontainer
know the right value.
Comment 5 Nam Nguyen 2004-10-07 03:34:50 UTC
We are back to the confusion of J2eeModule.get/setUrl().  The javadoc
of setUrl(String) says the value should be "/" for stand-alone module
and "/moduleArchiveName" for child module.  So the API seems to
dictate that of a module should be either stand-alone or part of a
j2eeapp, not both nor reused in different j2ee app with different url
value.  I think that this restriction is not reasonable and not necessary.

However, due to time contraint, as part of resolution last time, we
agree that setUrl() would be ignored and getUrl should return a
non-null value of the default url value that the j2eemodule project
would use when building the archive.  The value will be ignored when
the module is stand-alone.

Based on this resolution, this bug should be fixed by web and ejb
project implemementation of J2eeModule.getUrl().  I will update the
API javadoc, fix getUrl in ProjectWebModule (Pavel, you are wellcomed
to volunteer).  Maybe Chris or Rajeshwar will do it in ejb project.
Comment 6 Petr Jiricka 2004-10-07 08:45:05 UTC
We've had many issues in this area, so please be extra careful!

The Servlet 2.4 specification clearly states in section SRV.4.4, in
the paragraph about Context Path, that:

"If this context is the "default" context rooted at the base of
the Web server's URL name space, this path will be an empty string.
Otherwise, if the context is not rooted at the root of the server's
name space, the path starts with a '/' character but does not end with
a '/' character."

This is the only correct behavior; any other semantics will lead to
problems in other parts of the IDE.
Comment 7 Nam Nguyen 2004-10-07 09:10:04 UTC
The cause are:
1. NPE due to EarProject has not implemented addModuleListener(): I have
implement the check for null in getNodes and do the addModule to add
the mds to
the moduleMap.  This improve tolerance, but EarProject still need to
make sure
events would be fired on module added/removed.  Implemantation of
J2eeModuleContainer.getModules() need to add module listener.  (Vince,
please
take care of this).

2. Other times, there are a ArrayStoreException in
ConfigBeanTopCOmponent.  I will fix the ArrayStoreException and make
sure ProjectWebModule.getUrl and EjbJarProvider.getUrl return the
expected url value: /<archive.name>
Comment 8 Chris Webster 2004-10-07 18:47:56 UTC
I guess for the development modules we are going to assume the url
relative to the root of the ear is going to the ModuleName.jar.
Otherwise, the application or caller of the J2eeModule provider would
need to use setURL. I am also not clear on how a module would know
whether it should return "/" as part of standalone deployment or
"/ModuleName.extension" if it part of the ear file. Seems like the
module implementation would just always return the name of the
distribution and j2ee server would handle the standalone deployment
scenario.
Comment 9 Nam Nguyen 2004-10-07 18:55:04 UTC
Petr,
Just clarification to address your concern.  J2eeModule.getUrl is
purely used for J2eeApp packaging and not related to a webapp context
path.
Comment 10 Petr Jiricka 2004-10-07 18:57:39 UTC
Ok, thanks!
Comment 11 Nam Nguyen 2004-10-07 22:27:04 UTC
Fixed in=38927.
Open separate issue 50133 to track j2eeapp complete implementation of
J2eeModuleContainer.getModules() and ModuleListener support.
Comment 12 Jan Horvath 2004-11-25 13:40:18 UTC
v.