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 85837 - two identical nodes under Types/Reference Schema
Summary: two identical nodes under Types/Reference Schema
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: WSDL Tools (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Shivanand Kini
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-26 21:45 UTC by Sherry Barkodar
Modified: 2006-10-06 00:18 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
loanrequestor.zip is added (17.85 KB, application/octet-stream)
2006-09-26 21:46 UTC, Sherry Barkodar
Details
loanrequestor.xsd (1.41 KB, application/octet-stream)
2006-09-26 23:13 UTC, Sherry Barkodar
Details
screenshot running 200609260000 (79.37 KB, application/octet-stream)
2006-09-26 23:35 UTC, Sherry Barkodar
Details
WSDL File showing Single import node (99.50 KB, image/jpeg)
2006-09-27 07:59 UTC, deepakhp
Details
Source view of single import (138.02 KB, image/jpeg)
2006-09-27 08:00 UTC, deepakhp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sherry Barkodar 2006-09-26 21:45:32 UTC
Created a BPEL Module, LoanRequestor
Created XML Schema, LoanRequestor.xsd
Created a BPEL Process
Create a New WSDL Document
Check Import XML Schema, select LoanRequestor.xsd.
In the Abstract Configuration wizard do the following: 

In the Input area, set the message part name to requestLoanMessage . 

In the Input area, under Element Or Type, click the ellipsis button. 

Expand LoanRequestor > src/LoanRequestor.xsd > Elements 

Select processApplication and click Ok. 

In the Output area, set the message part name to responsePart .

In the Output area, under Element Or Type, click the ellipsis button. 

Expand LoanRequestor > src/LoanRequestor.xsd > Elements 

Select processApplicationResponse and click OK. 

Click Next. 

The Concrete Configuration page opens. 

For Binding Subtype, make sure the Document Literal is selected. 

Click Finish. 
there are 2 identical nodes under Types > Reference Schema
Open the WSDL source, there are two imports:
 <types>
        <xsd:schema
targetNamespace="http://j2ee.netbeans.org/wsdl/LoanRequestor"
xmlns:ns1="http://xml.netbeans.org/schema/LoanRequestor">
            <xsd:import namespace="http://xml.netbeans.org/schema/LoanRequestor"
schemaLocation="../../../../Demo/LoanRequestor/src/LoanRequestor.xsd"/>
            <xsd:import namespace="http://xml.netbeans.org/schema/LoanRequestor"
schemaLocation="LoanRequestor.xsd"/>
        </xsd:schema>
    </types>
Comment 1 Sherry Barkodar 2006-09-26 21:46:03 UTC
Created attachment 34548 [details]
loanrequestor.zip is added
Comment 2 jlautz 2006-09-26 22:37:10 UTC
Which build? I just verified the fix for a similar issue 85656 in the 060925_1
build.
Comment 3 Sherry Barkodar 2006-09-26 22:49:50 UTC
 used the following:
http://balui.sfbay/kits/oriondev/main/Build060925_1/installers/ 
Comment 4 jlautz 2006-09-26 23:02:03 UTC
I am having problems reproducing this scenario. Which .xsd file from your zip am
I supposed to use to create the XML schema in the second step? There are a
bunch, and most of them complain when I try to import them because of a
reference to a Demo directory?
Comment 5 Ritesh Adval 2006-09-26 23:13:08 UTC
You are usinng 9/25 build

http://balui.sfbay/kits/oriondev/main/Build060925_1/installers/ 

This bug was fixed on 9/25, I just verified your use case and it works fine.

please retest withe today's build.


*** This issue has been marked as a duplicate of 85656 ***
Comment 6 Sherry Barkodar 2006-09-26 23:13:47 UTC
Created attachment 34553 [details]
loanrequestor.xsd
Comment 7 Sherry Barkodar 2006-09-26 23:14:41 UTC
loanRequestor.xsd is under src folder. I just attached it.
Comment 8 Sherry Barkodar 2006-09-26 23:25:34 UTC
when I go to bug 85656
It says: Verified on Windows XP with NB 55 060925_1.
I am using the same build!! What am I missing?
Comment 9 jlautz 2006-09-26 23:26:18 UTC
I cannot recreate this problem with the 060925_1 build. Does the build you're
running have 200609260000 or 200609250000 in the title bar?
Comment 10 Sherry Barkodar 2006-09-26 23:35:07 UTC
Created attachment 34554 [details]
screenshot running  200609260000
Comment 11 Sherry Barkodar 2006-09-26 23:37:04 UTC
If you just import the schema but do not select the message type for input type
and output type then you are not able to see the problem.
follow my steps using the imported schema.
Comment 12 jlautz 2006-09-26 23:56:32 UTC
I followed steps exactly as written, starting with creating a new BPEL model.
The issue that this is marked duplicate of (issue 85656) also changes the
message part types to be an element defined in the imported schema (specified in
Name and Location pane). It failed in 060925, works today in 060925_1.

I noticed that the .zip file contains a lot of artifacts besides the wsdl, bpel,
and xsd. Might those be causing this unexpected behavior?

I'm trying to pinpoint where your scenario and mine are importantly different.
(Thinking . . . thinking . . . )
Comment 13 jlautz 2006-09-27 01:58:50 UTC
I opened up the project in the .zip file, and I noticed that when I look at the
generated WSDL, the two generated import statements aren't identical:

<xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/LoanRequestor"
xmlns:ns1="http://xml.netbeans.org/schema/LoanRequestor">
     <xsd:import namespace="http://xml.netbeans.org/schema/LoanRequestor"
schemaLocation="../../../../Demo/LoanRequestor/src/LoanRequestor.xsd"/>
     <xsd:import namespace="http://xml.netbeans.org/schema/LoanRequestor"
schemaLocation="LoanRequestor.xsd"/>
</xsd:schema>

The first import is showing up in the graphical WSDL editor as a Broken
reference. Any ideas why it's looking for something in a Demo directory that
isn't included in the project?
Comment 14 Ritesh Adval 2006-09-27 02:16:01 UTC
As I mentioned eariler, there was a bug where the import was not getting 
generated correctly when you finish the wizard.

import was generated something like the one you are refering:

schemaLocation="../../../../Demo/LoanRequestor/src/LoanRequestor.xsd"/>

This has been fixed so correct import is generated. It will show broken refernce
now since there is no xsd 
at ../../../../Demo/LoanRequestor/src/LoanRequestor.xsd
Comment 15 jlautz 2006-09-27 02:36:44 UTC
radval -- which bug fix are you referencing in your last comment? issue 85400 is
about broken references . . . ? issue 85656 doesn't describe what the fix was
either . . . I'm not sure where to go from here.
Comment 16 deepakhp 2006-09-27 07:58:13 UTC
Verified with the 060925_1 build (java-tools-bundle-main-060925_1-windows.exe).
Not able to reproduce the bug. I can see only one import.
Please see attachment.
Marking the bug verified.
Comment 17 deepakhp 2006-09-27 07:59:06 UTC
Created attachment 34559 [details]
WSDL File showing Single import node
Comment 18 deepakhp 2006-09-27 08:00:02 UTC
Created attachment 34560 [details]
Source view of single import
Comment 19 lchang 2006-09-29 23:43:26 UTC
Reopening this.  I was not able to reproduce this before, but now on the 0928 
build I can.  I do not think this is consistently reproduceable on all 
machines, but it is consistently reproduceable on my machine.

I have installed the same build (same JDK version) on two WindowsXP machine.  
On one machine it can be constantly reproduced, on the other machine, i do not 
see the issue at all.  I would like for a developer to come take a look at my 
machine as I do not see any diffrences between the two, but this is definitely 
an issue for me.
Comment 20 Shivanand Kini 2006-10-02 20:10:01 UTC
After debugging this, in some cases model.findSchemas(namespace) returned a
empty list even though the schema was present in the model.

Comment 21 Shivanand Kini 2006-10-04 00:58:25 UTC
assigning to model.
Comment 22 Nam Nguyen 2006-10-04 01:35:26 UTC
Skini, your debug observation does not correspond to bug description.  Could you
explain more why you think this is model bug.  Also confirm that you are able to
reproduce this bug.
Comment 23 Nam Nguyen 2006-10-04 06:51:04 UTC
I cannot reproduce this bug on my computer.  

The inconsistent nature of the bug probably tells of the timing issue.  Without
know much about how the wizard pages dispatch model mutaions, I guess there
might be 2 places of interest: 
(1) where we call addImport directly (corresponds to import schema on first
page) and,
(2) where addImport is called indirectly as result of Part.setElement().

In both places, make sure skip addImport call if there already exists import
with the same schemalocation or namespace.

Reassign back to wsdltools.
Comment 24 Shivanand Kini 2006-10-04 19:45:50 UTC
i was not able to reproduce this on my machine. But I used the QE machine and
debugged on it. Based on that observation, i found that the
model.findSchemas(namespace) gave empty result.  Thats why I felt it was a model
problem.

I will debug through the model, as soon as I find a build that I can reproduce
it on.
Sherry was also able to reproduce it on her machine with todays build. So i
installed it on my machine, but I am not able to reproduce it.
Comment 25 Shivanand Kini 2006-10-04 19:46:22 UTC
cc ing Nam with comments
Comment 26 Shivanand Kini 2006-10-05 01:25:45 UTC
This is reproduceable if you set your windows TEMP dir to C:\Windows\Temp
and you project is in some space seperated folder like "Document And Settings".

The fix would be encode the url so that spaces are replaced by %20 and other
such character by their encoded versions.

Comment 27 Shivanand Kini 2006-10-05 02:52:11 UTC
Currently, the fix is going to as follows:
There are two steps while creating a wsdl through the wizard.
1. Create a temporary wsdl model
2. Copy this temporary wsdl to the correct wsdl.

So the schema location in first step is generated relative to the temp wsdl.
The relative path in this case has spaces in it, which needs to be escaped.

Then later, when the finish is clicked on wizard, the temp model is copied to
new one and the imports are processed to put the correct relative path.

Current fix is to use absolute URI's for temp model for schema location.
In post process, the schema locations are adjusted.
Comment 28 Shivanand Kini 2006-10-05 03:08:51 UTC
Fixed in release55 and release55_dev.
Code reviewed by Ritesh.
Tested by me.
Comment 29 lchang 2006-10-05 23:27:20 UTC
Verified that the now only one import will appear:

<types>
  <xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/LoanRequestor">
    <xsd:import namespace="http://xml.netbeans.org/schema/LoanRequestor" 
schemaLocation="LoanRequestor.xsd"/>
  </xsd:schema>
</types>