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 36726 - Failed XMI 1.2 => 2.0 conversion
Summary: Failed XMI 1.2 => 2.0 conversion
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker with 1 vote (vote)
Assignee: Daniel Prusa
URL:
Keywords:
: 36808 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-21 18:09 UTC by jcahoon
Modified: 2004-08-13 12:11 UTC (History)
0 users

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 jcahoon 2003-10-21 18:09:15 UTC
Hi Jeff,
this exception is thrown by writer because in 
order for the XMI file to 
be generated correctly, the metamodel should 
contain information saying 
what URI should be used when declaring namespaces 
from your metamodel in 
the generated XMI document. XMI 1.2 was lacking 
this capability, thus an 
  arbitrary URI is used there. For XMI 2.0 the 
writer is trying to use 
the correct URI and it expects it to be specified 
in the metamodel using 
a speciat tag defined in the XMI 2.0 
specification. The tag is of course 
not there, because the model was read from XMI 
1.2. Anyway, I think that 
the behavior of XMI 2.0 writer is too strict and 
we should relax this 
constraint (the tag should not be mandatory), so 
I see this as a bug in 
the XMI Writer. It would be good if you could 
file a new issue for this 
and someone will look at it next week (hopefuly 
on Monday).
Thanks,
Martin

jeff_cahoon wrote:

> I was hoping to produce some XML Schmea for my 
model using:
>  
> mdr/src/org/netbeans/lib/jmi/xmi/SchemaProducer
>  
> I think it requires XMI version 2.0.
>  
> My model was loaded using XMI 1.2 from 
Poseidon, so I tried
> to alter MDR so that its "Export XMI" utility 
would generate XMI 2.0.
> I changed:
> 
mdr/src/org/netbeans/lib/jmi/xmi/DelegatingWriter.
java
> so that it would only use XMI20Writer.
> I did the same thing with :
> mdr/src/org/netbeans/lib/jmi/xmi/Producer.java
>  
> However, I got the following error.
>  
> Annotation: Exception occurred in Request 
Processor
> org.netbeans.lib.jmi.util.DebugException: A tag 
defining namespace uri 
> not found, package Model
>  at 
org.netbeans.lib.jmi.xmi.XMI20Writer.findNamespace
s(XMI20Writer.java:76)
>  at org.netbeans.lib.jmi.xmi.WriterBase.write
(WriterBase.java:270)
>  at org.netbeans.lib.jmi.xmi.WriterBase.write
(WriterBase.java:201)
>  at 
> org.netbeans.lib.jmi.xmi.DelegatingWriter.write
(DelegatingWriter.java:43)
>  at org.netbeans.api.xmi.XMIWriter.write
(XMIWriter.java:88)
>  at org.netbeans.lib.jmi.xmi.XMIWriterImpl.write
(XMIWriterImpl.java:45)
>  at 
> 
org.netbeans.modules.mdrexplorer.looks.reflect.act
ions.SaveXMIAction$1.run(SaveXMIAction.java:95)
>  at org.openide.util.Task.run(Task.java:136)
>  at org.openide.util.RequestProcessor$Task.run
(RequestProcessor.java:330)
> [catch] at 
> org.openide.util.RequestProcessor$Processor.run
(RequestProcessor.java:677)
>  
> I am beginning to think that I may have been 
expecting too much from MDR.
> Maybe it is not possible to load an XMI 1.2 
model and export XMI 2.0.
>  
> Is there another way?
>  
> Thanks,
> Jeff
Comment 1 Martin Matula 2003-10-23 19:21:32 UTC
*** Issue 36808 has been marked as a duplicate of this issue. ***
Comment 2 Martin Matula 2004-06-20 11:57:40 UTC
Dan, please look at this issue.
Comment 3 Daniel Prusa 2004-07-22 16:06:35 UTC
Fixed.
/cvs/mdr/jmiutils/src/org/netbeans/lib/jmi/xmi/XMI20Writer.java,v  <--
 XMI20Writer.java
new revision: 1.2; previous revision: 1.1