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
|
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
|