Re: [mdr-users] NullPointerException
Martin Matula <[email protected]> Fri, 15 Jul 2005 10:22:57 +0200
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.user |
|---|---|
| Message-ID | <[email protected]> |
The exception you get seems to be caused by the fact you put a mdr
module jar on the classpath. This is wrong. You need to put just the
standalone jars on the classpath. The standalone mdr is in nbmdr.jar,
the module is in mdr.jar - remove mdr.jar from your classpath.
Regards,
Martin
Cheng yong wrote:
> Hello, everyone,
>
> I'm now making my own example according to the online document and try
> to figure out how the MDR works. Now I have got an
> NullPointerException Error. Can anyone help me?
>
> What I did is as following:
> 1. NetBeans IDE 3.5.1: imported Metadata UML 1.4 (01-02-15_Diff.xml)
> and generated the JMI Interfaces.
> 2. Eclipse 3.1: created a new project, added all .jar files which I
> can find in the installation folder, imported all generated files.
> 3. Eclipse 3.1: created a new demo class,
>
> package demo;
> import java.io.OutputStream;
> import java.util.Iterator;
> import org.netbeans.api.mdr.MDRManager;
> import org.netbeans.api.mdr.MDRepository;
> import org.netbeans.api.xmi.XMIWriterFactory;
> import org.omg.uml.*;
> import org.omg.uml.behavioralelements.activitygraphs.*;
> public class Demo {
>
> public static void main(String[] args) {
>
> OutputStream out = null;
>
> MDRepository repository =
> MDRManager.getDefault().getDefaultRepository();
>
> UmlPackage extent = (UmlPackage)
> repository.getExtent("Projects metadata");
> try{
>
> XMIWriterFactory.getDefault().createXMIWriter().write(out,extent,"1.2");
> System.out.println(out.toString());
> } catch(Exception e){
> System.out.println("ERROR!");
> }
> }
> }
> 4. Eclipse 3.1: runed the demo, got the error:
>
> java.lang.NullPointerException
> at
> org.netbeans.modules.mdr.MDRManagerImpl.refreshChildren(MDRManagerImpl.java:61)
> at org.netbeans.modules.mdr.MDRManagerImpl.init(MDRManagerImpl.java:84)
> at
> org.netbeans.modules.mdr.MDRManagerImpl.getRepository(MDRManagerImpl.java:94)
> at
> org.netbeans.modules.mdr.MDRManagerImpl.getDefaultRepository(MDRManagerImpl.java:105)
> at demo.Demo.main(Demo.java:18)
> Exception in thread "main"
>
> thanks
>
> Lucia
>
> ------------------------------------------------------------------------
> Start your day with Yahoo! - make it your home page
> <http://us.rd.yahoo.com/evt=34442/*http://www.yahoo.com/r/hs>