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 123383 - Installed Glassfish domain is not used
Summary: Installed Glassfish domain is not used
Status: RESOLVED WONTFIX
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 6.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Vince Kraemer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-04 18:03 UTC by esmithbss
Modified: 2009-11-02 11:14 UTC (History)
1 user (show)

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 esmithbss 2007-12-04 18:03:07 UTC
When installing NB6 with Glassfish, a domain (domain1) is created during the installation which uses the default ports;
however, when launching NetBeans the first time, a personal domain is created with different port numbers.

If Glassfish is installed locally and a domain is created, NetBeans should use the created domain (domain1) from the
installation and not create a second domain.
Comment 1 esmithbss 2007-12-04 18:07:05 UTC
This is particularly troublesome when developing web services since the WSDL being generated contains a hard-coded URL
based on the port number of the server.  If the service is created against a Glassfish domain on port 10047 instead of
port 8080 then upod deployment, the WSDL appears to automatically refer to the wrong location. (I just spent an hour
searching for the web services I just deployed before I realized it was on a different port).
Comment 2 Vince Kraemer 2007-12-06 01:31:36 UTC
When the IDE or GF is installed by root, the default domains end up belonging to root.

We create a personal domain for users in that case, so they have the ability to control the domain without being root.

There are a couple work-arounds that you could probably apply for your situation:

1. register the default domain as a remote domain.

OR

2. create a personal domain that uses the default ports, via the registration wizard.

This may lead to the question: why doesn't the IDE use work-around 2 by default? the answer is pretty simple. the guy
that wrote the plugin cannot tell whether you have installed NetBeans onto a laptop or a server capable of hosting 100's
of IDE users.  He cannot write code that will be able to make the correct guess on this question either.

Do you have any other suggested strategies for this?
Comment 3 Vince Kraemer 2008-03-02 21:42:06 UTC
it sounds like this is really a web service development and deployment issue... not a server plugin issue.  The server
plugin doesn't create the wsdl does it?  

The user can create a custom domain that uses the "default" ports safely via the create presonal domain option if they
need/want to resolve this issue safely.
Comment 4 Vince Kraemer 2008-03-02 21:43:33 UTC
reassigned to wrong component... try again
Comment 5 Milan Kuchtiak 2008-03-03 10:52:30 UTC
In WS development there are 2 cases :

1. WS is created from Java Code
GlassFish generates WSDL during the deployment.
WSDL: wsdlPort -> address is generated based on the port GlassFish is running on, e.g. :

  <wsdl:service name="CalculatorService">
    <wsdl:port name="Calculator" binding="tns:CalculatorSoapBinding">
      <soap:address location="http://localhost:8080/WebApplication1/CalculatorService"/>
    </wsdl:port>
  </wsdl:service>

2. WS is generated from WSDL file.
GlassFish takes the existing wsdl file but replaces the wsdlPort -> address with new address, based on the port 
wsdl is running on :

Example :
Original WSDL :
  
  <wsdl:service name="CalculatorService">
    <wsdl:port name="Calculator" binding="tns:CalculatorSoapBinding">
      <soap:address location="whatever"/>
    </wsdl:port>
  </wsdl:service>

Modified WSDL (by GlassFish) :

  <wsdl:service name="CalculatorService">
    <wsdl:port name="Calculator" binding="tns:CalculatorSoapBinding">
      <soap:address location="http://localhost:8080/WebApplication1/CalculatorService""/>
    </wsdl:port>
  </wsdl:service>

The conclusion is that Netbeans WS Support relies on GlassFish JAX-WS plugin to generate/modify wsdl correctly.
We cannot do much with that.
Comment 6 esmithbss 2008-03-05 22:31:16 UTC
You are closer on a solution in the first section when you discuss the problem in terms of who owns the domain.  But the
question that should be asked is why does it matter that the domain is owned by root?

If I have a Glassfish domain installed on server A and am developing on workstation B, then what operations will I need
to perform against the domain and what privileges do I need to have to perform these privileges?

Since the only operations I can think of that need command line root authentication are starting and stopping the server
you could test during installation whether NB and GF are being installed as root and if so, flag it in the profile to: 
a) ask the user if they want to create/install a private domain, 
b) ask the user for root authentication data when performing root operations.
c) provide a command string for the user to manually launch GF with the proper parameters.

or you could do

d) During installation, ask the user which user they want to install GF as/for.  Should they install it for everyone, in
which case it would be installed as root, or should they install it only for themselves?  It may seem counterintuitive,
but on a notebook running Linux, many users would rather install applications as root, but install dynamic components
like the GF domain as a specific user.

While I know that one of the goals of NB is to have the cleanest and easiest to use interfaces for developers, there are
inherent problems with firewalls, network configurations, etc..., and significant confusion when multiple domains are
installed on some machines.  Particularly when the developer is using the information from the installer to determine
which instance needs to be set up as a service.

With this info, I would think this would actually boil down to an installer issue instead of a GF or JAX-WS issue.
Comment 7 Vince Kraemer 2008-04-26 04:54:23 UTC
I will take another look at this
Comment 8 Vince Kraemer 2008-08-27 02:15:54 UTC
there really isn't a good fix for this that works for all people all the time.
Comment 9 Vince Kraemer 2008-11-14 23:17:32 UTC
The user is free to create a personal domain and assign it to the "default ports"... thus overriding the decision to
create and register a domain for them automatically.
Comment 10 esmithbss 2008-11-17 06:12:10 UTC
I'm sorry, but the last comment doesn't make much sense.  When NB + GF is installed, it creates a domain.  Period.  

If a domain is already available, there is no way to hook up the existing domain as the domain to use during installation.

This is a problem if there is a desire to develop SOA systems, etc... where the component relies on a GF instance to
exist on the box.

Assume I have Glassfish V2-UR2 downloaded from glassfish.dev.java.net, installed on my machine, and set to start when I
boot up.  This is where I've been developing web services with JDeveloper, Eclipse, JBuilder, etc...

Now I want to switch to NetBeans.

I download the version I need to develop SOA systems and go to install it.  In order for me to install the SOA
components for development, I need to install Glassfish.  I already have GF installed, but the IDE requires me to
install a new instance.  Not only that, but it requires me to create a second domain on my box and doesn't (during
installation) allow me to reuse the existing domain or installed version of Glassfish.

Now when I develop (assuming I didn't catch the port changes in the installation form) I believe I'm using the original
GF domain and go to deploy my web services.  Everything appears to work well until I login to my known domain on port
4848 and find that the web services that I'm running don't exist.

I believe what is needed is a mechanism in the installation that tests for an existing Glassfish instance on the
machine.  If one is found, is found to be compatible, and (if it's owned by root) authentication is provided that allows
accesss, the choice is given to the installer to use the existing instance.  If it is not chosen, then a new instance
can be installed.
Comment 11 Quality Engineering 2009-11-02 11:14:30 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX