Problem by using the converter

Hi,



I am trying to write an converter. It should convert md2, md3, milkshape, 3ds, obj and ase to jme by using the basic converters included in the jme api. Unfortunately i keep getting an Nullpointer Exception. I suspect, that jme is trying to render the models before saving them, which will not work out.

Before showing you my code, I have to mention that:



in, out and form are private variables for the program

in stores the location of the file, which shall be converted

out stores the location(including the future file name)

and form store the format



This is part of the interesting code:



    private boolean change() throws FormatNotFoundException, IOException
    {
        ByteArrayOutputStream bo = new ByteArrayOutputStream();
        URL toconv = in.toURI().toURL();

       
        if(form.equalsIgnoreCase("md2"))
        {
            Md2ToJme mtj = new Md2ToJme();
            mtj.convert(new BufferedInputStream(toconv.openStream()),bo);
        }
        else if(form.equalsIgnoreCase("md3"))
        {
            Md3ToJme mtj = new Md3ToJme();
            mtj.convert(new BufferedInputStream(toconv.openStream()),bo);
        }
        else if(form.equalsIgnoreCase("milkshape"))
        {
            MilkToJme mtj = new MilkToJme();
            mtj.convert(new BufferedInputStream(toconv.openStream()),bo);
        }
        else if(form.equalsIgnoreCase("3ds"))
        {
            MaxToJme mtj = new MaxToJme();
            mtj.convert(new BufferedInputStream(toconv.openStream()),bo);
        }
        else if(form.equalsIgnoreCase("obj"))
        {
            ObjToJme mtj = new ObjToJme();
            mtj.convert(new BufferedInputStream(toconv.openStream()),bo);
        }
        else if(form.equalsIgnoreCase("ase"))
        {
            AseToJme mtj = new AseToJme();
            mtj.convert(new BufferedInputStream(toconv.openStream()),bo);
        }
        else
        {
            throw new FormatNotFoundException();
        }
       
       
        byte[] bout = bo.toByteArray();
        FileOutputStream fos = new FileOutputStream(out);
        ObjectOutputStream os = new ObjectOutputStream(fos);
       
        System.out.println(fos. getFD());
       
        if(bout.length<=0)
        {
            return false;
        }
       
        os.writeObject(bo);
       
        os.close();
        fos.close();
       
        return true;
    }



I hope you can help me and tell me what I have to change in order to make it work. I also hope that as a new being  :) to this forum and to jme I am not stressing to much of your time, therefore be nice to me  :P

At the top of your main() function, call "new DummyDisplaySystem();"

thx you saved my day