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 77480 - Instanceproperties HTTP-PORT-NUMBER doesnt work until initialized.. need a workaround
Summary: Instanceproperties HTTP-PORT-NUMBER doesnt work until initialized.. need a wo...
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Nitya Doraisamy
URL: http://websvc.netbeans.org/source/bro...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-07 02:19 UTC by Srividhya Narayanan
Modified: 2006-06-26 19:06 UTC (History)
4 users (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 Srividhya Narayanan 2006-06-07 02:19:36 UTC
Here is the relevant email exchanges with Ludo's team on this issue.

------------------
Parsing domain.xml for local scenario can be done. But I won't be able to get to
it this week. Maybe on Monday.

Nitya

ludo wrote:

> Peter Liu wrote:
>
>> Hi Nitya,
>>
>> Any solution to this issue?  Thanks.
>
>
> Well, we cannot know this value until the server is started....
> Even if we have a different default value, we would still be wrong is the
server is installed with different ports...
> Maybe Nitya could (only for the the local install) calculate the real value by
reading the domain.xml instead od querying the running server, but I am not sure
this can be done for Beta. Nitya?
>
> Ludo
>
>>
>> Peter
>>
>> Srividhya Narayanan wrote:
>>
>>> Hi Nitya,
>>>
>>> Peter Liu from my team has identified the cause for the InstanceProvider
issue I raised on not returning the HTTP_PORT_NUMBER. Can you please tell us how
to initialize the port setting code?
>>>
>>> Thanks,
>>> - Vidhya
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> Subject:
>>> Re: endpoint url issue
>>> From:
>>> Peter Liu <Peter.Liu@Sun.COM>
>>> Date:
>>> Tue, 25 Apr 2006 15:58:12 -0700
>>> To:
>>> Srividhya Narayanan <Srividhya.Narayanan@Sun.COM>
>>>
>>> To:
>>> Srividhya Narayanan <Srividhya.Narayanan@Sun.COM>
>>>
>>>
>>> One more thing, once the http port is initialized to 8080, it will remain
8080 across sessions.
>>> It's really just the very first time you install the server, the port is set
to 4848.
>>>
>>> Peter
>>>
>>> Peter Liu wrote:
>>>
>>>> Vidhya,
>>>>
>>>> I figured out why we are getting 4848 and sometimes 8080.  What's happening
>>>> is that the deployment port (8080) doesn't get initialized until the IDE
detects
>>>> that the server is running.  The following is the stacktrace showing the
thread that
>>>> does this.
>>>>        at
org.netbeans.modules.j2ee.deployment.impl.InstancePropertiesImpl.setProperty(InstancePropertiesImpl.java:88)
>>>>        at
org.netbeans.modules.j2ee.sun.ide.j2ee.DeploymentManagerProperties.setHttpPortNumber(DeploymentManagerProperties.java:271)
>>>>        at
org.netbeans.modules.j2ee.sun.ide.j2ee.StartSunServer.isRunning(StartSunServer.java:606)
>>>>        at
org.netbeans.modules.j2ee.deployment.impl.ServerInstance$3.run(ServerInstance.java:498)
>>>>        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:493)
>>>>        at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:926)
>>>>
>>>> So far, I noticed that the thread gets invoked when you open up the server
node.
>>>> This means that if you don't open up the server node, the port number will
be 4848.
>>>> If you do, it will be 8080.  Now the question is how to trigger the
initialization
>>>> code.  Could you ask the NB engineer that you've been talking to see if
there is a way
>>>> to trigger this programmatically?
>>>>
>>>> Peter
Comment 1 Petr Jiricka 2006-06-07 18:40:23 UTC
Radko, I believe we encountered the issue with port 4848 before, in the web
service client area, correct? Do you know how it was addressed? We may want to
see whether the same approach could be used here as well. Thanks.

Comment 2 Lukas Jungmann 2006-06-07 19:04:48 UTC
You probably mean issue 75231, if so then it was fixed by Milan, see [URL] for diff.
Comment 3 Srividhya Narayanan 2006-06-08 01:01:10 UTC
This has nothing to do with invoking it via websvc/core.. This is when I use the
InstanceProperties in J2eModuleProvider. Seems like the other bug is for a
different issue. Nitya in the email conversation enclosed has the complete
context of what needs to be changed.
Comment 4 _ ludo 2006-06-08 01:30:49 UTC
Can you tell if you want this info only when the server is running, or also when
the server is not running or has not ran at all.
This is important for the best fix.

Comment 5 Srividhya Narayanan 2006-06-08 01:34:21 UTC
Ludo, yes we need this info when the server is running, not running or has never
been ran. Thanks.
Comment 6 Petr Jiricka 2006-06-08 08:27:36 UTC
> You probably mean issue 75231

No, what I meant is issue 73638.
Comment 7 Radko Najman 2006-06-08 09:29:17 UTC
Issue #73638 was fixed by Milan. It is implemented in
org.netbeans.modules.websvc.core.jaxws.nodes.JaxWsNode.getWsdlURL()
Comment 8 _ ludo 2006-06-10 04:21:32 UTC
I am looking at the code, and I cannot find how the default value can be ever
set to 4848.


It is defaulted to 8080 if not known...
Can you confirmed you've seen a 4848 value? The code I see cannot do that, so I
am puzzled.
Comment 9 Milan Kuchtiak 2006-06-12 09:30:18 UTC
We are looking for server port using the following :

        J2eeModuleProvider provider =
(J2eeModuleProvider)project.getLookup().lookup(J2eeModuleProvider.class);
        InstanceProperties instanceProperties = provider.getInstanceProperties();
        
        // getting port
        String portNumber =
instanceProperties.getProperty(InstanceProperties.HTTP_PORT_NUMBER);
        if(portNumber == null || portNumber.equals("")) {
            portNumber = "8080"; //NOI18N
        }

If instanceProperties.getProperty(InstanceProperties.HTTP_PORT_NUMBER)
returns null the port is set to 8080.
Comment 10 Peter Liu 2006-06-12 21:28:54 UTC
It looks like this issue has already been fixed.  It's no longer reproducible. 
Please close this bug.

Comment 11 Petr Jiricka 2006-06-26 19:06:16 UTC
Ok, marking as FIXED.