IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Prograqmming Using Java Options · View
Muhilan
Posted: Tuesday, February 9, 2010 5:59:31 AM
Rank: Newbie

Joined: 2/9/2010
Posts: 1
Location: Chennai
Hi,

I am unable to open the XML file using XMLSpy Java API , I just used the sample code mentioned in the Help section of Altova.

I am always getting Null pointer Exception while opening the file (last line of the code snippet)

public static void main(String[] args)

{

SpyApplication app = null;

SpyDoc oDoc = null;

SpyXMLData oData = null;

SpyXMLData oNewChild = null;



try

{

app = new SpyApplication();

app.ShowApplication( true );



oDoc = app.GetDocuments().OpenFile("C:\\test.xml", true );


Is there any way to solve this , i just placed my XML file within C:...

Thanks ,
Muhil



Rocco
Posted: Wednesday, February 10, 2010 1:06:59 PM
Rank: Advanced Member

Joined: 5/16/2009
Posts: 82
Hi Muhilan,

Did you check if 'app' has a valid value? I have just found out on a test machine that if I open too many programs then a call to

Code:

app = new SpyApplication();


returns just 'null'.
(the same thing happens when I launch XMLSpy standalone on that machine, it just doesn't start, until I close some program and try again)

Could you try to close all the other programs and run again your code?

Cheers
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.