Wandora Forum Index
Wandora WikiWandora Wiki   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups  SmartFeedSmartFeed   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wandora and Eclipse RCP

 
Post new topic   Reply to topic    Wandora Forum Index -> Tools & Extensions
View previous topic :: View next topic  
Author Message
barab



Joined: 14 May 2009
Posts: 2

PostPosted: Thu May 14, 2009 11:09 pm    Post subject: Wandora and Eclipse RCP Reply with quote

Hello,
I am wondering if anyone has looked at integrating Wandora into the Eclipse Rich Client Platform (RCP) as a plugin. I am starting to look at doing this for something I need to work on, but I am running into a roadblock in my first step of the process.. getting the Wandora project to compile and run under Eclipse.

I am getting this exception right now on startup and I am having trouble figuring out how to get around it.

Quote:
java.lang.NullPointerException
at org.wandora.application.WandoraMenuManager.getSubjectLocatorExtractorMenu(WandoraMenuManager.java:1171)
at org.wandora.application.WandoraMenuManager.getSubjectLocatorExtractorMenu(WandoraMenuManager.java:1165)
at org.wandora.application.WandoraMenuManager.refreshExtractWithSLMenu(WandoraMenuManager.java:1157)
at org.wandora.application.WandoraMenuManager.refreshExtractMenu(WandoraMenuManager.java:197)
at org.wandora.application.WandoraMenuManager.refreshFileMenu(WandoraMenuManager.java:592)
at org.wandora.application.WandoraMenuManager.refreshMenus(WandoraMenuManager.java:134)
at org.wandora.application.WandoraMenuManager.<init>(WandoraMenuManager.java:125)
at org.wandora.application.Wandora.initializeWandora(Wandora.java:348)
at org.wandora.application.Wandora.<init>(Wandora.java:158)
at org.wandora.application.Wandora.main(Wandora.java:2249)


Any help would be greatly appriciated! Thank you!
Back to top
View user's profile Send private message
akivela
Site Admin


Joined: 18 Sep 2007
Posts: 74
Location: Helsinki, Finland

PostPosted: Fri May 15, 2009 12:08 pm    Post subject: Reply with quote

Hello

Great idea! I hope you can share your work with us and other Wandora users later on.

To solve the NullPointerException with a quick hack, you can change the method getSubjectLocatorExtractorMenu so that it returns empty Object array:

Code:

public static final Object[] getSubjectLocatorExtractorMenu(Wandora admin, Context proposedContext, WandoraToolSet extractTools) {
 return new Object[] {};
}


To think more permanent solution, it looks like the argument extractTools passed to the method getSubjectLocatorExtractorMenu is null. Argument extractTools is initialized in class WandoraToolManager2 with method readToolSets. In general all tool sets are defined in Wandora's options file (in resources/conf/options.xml). Wandora reads this options file in constructor of Wandora class. Note, options are read using Java's resource loader which means that options file directory 'resources' must be a valid Java class path.

I would suggest that you first check that Wandora actually loads options file successfully. I assume adding 'resources' to your Java class paths solves the problem. If this doesn't help, please drop a line and let's look your problem more detailed.

Kind Regards,
Aki Kivelä
Wandora Team
Back to top
View user's profile Send private message Visit poster's website
barab



Joined: 14 May 2009
Posts: 2

PostPosted: Fri May 15, 2009 3:57 pm    Post subject: Reply with quote

Thanks for the reply! I have added the resources folder as part of the Eclipse build/class path and the Wandora app can correctly access the files. I have noticed that the options.xml file was nearly empty, options.xml.original had alot more content, including all the information about tools to load. I copied the contents of options.xml.orginal to options.xml and ran again and got a different exception.

Code:

Reading options from resource 'conf/options.xml'.
org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
   at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
   at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:570)
   at org.apache.xerces.framework.XMLDocumentScanner.abortMarkup(XMLDocumentScanner.java:624)
   at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1194)
   at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
   at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
   at org.wandora.utils.XMLbox.getDocument(XMLbox.java:63)
   at org.wandora.utils.XMLbox.getAsHashMapTree(XMLbox.java:309)
   at org.wandora.utils.Options.parseOptions(Options.java:378)
   at org.wandora.utils.Options.parseOptions(Options.java:369)
   at org.wandora.utils.Options.<init>(Options.java:88)
   at org.wandora.application.Wandora.<init>(Wandora.java:152)
   at org.wandora.application.Wandora.main(Wandora.java:2249)
java.lang.NumberFormatException: null
   at java.lang.Integer.parseInt(Unknown Source)
   at java.lang.Integer.parseInt(Unknown Source)
   at org.wandora.application.Wandora.placeWindow(Wandora.java:601)
   at org.wandora.application.Wandora.initializeWandora(Wandora.java:330)
   at org.wandora.application.Wandora.<init>(Wandora.java:158)
   at org.wandora.application.Wandora.main(Wandora.java:2249)
java.lang.NullPointerException
   at org.wandora.application.WandoraMenuManager.getSubjectLocatorExtractorMenu(WandoraMenuManager.java:1171)
   at org.wandora.application.WandoraMenuManager.getSubjectLocatorExtractorMenu(WandoraMenuManager.java:1165)
   at org.wandora.application.WandoraMenuManager.refreshExtractWithSLMenu(WandoraMenuManager.java:1157)
   at org.wandora.application.WandoraMenuManager.refreshExtractMenu(WandoraMenuManager.java:197)
   at org.wandora.application.WandoraMenuManager.refreshFileMenu(WandoraMenuManager.java:592)
   at org.wandora.application.WandoraMenuManager.refreshMenus(WandoraMenuManager.java:134)
   at org.wandora.application.WandoraMenuManager.<init>(WandoraMenuManager.java:125)
   at org.wandora.application.Wandora.initializeWandora(Wandora.java:348)
   at org.wandora.application.Wandora.<init>(Wandora.java:158)
   at org.wandora.application.Wandora.main(Wandora.java:2249)
Deleting file 'D:\workspace\Wandora\.\resources\conf\options.xml.bak'
Renaming file './resources/conf/options.xml' to './resources/conf/options.xml.bak'!
Saving a file './resources/conf/options.xml'


It seems that at the end of execution, it clears the options.xml file removing all the tools information, so if I run the application again I get the orginal exception that was in my first post. Any ideas?

Update: I have seemed to fix my own problem. I copied a fresh options.xml file from the source archive and now I can compile and run under Eclipse. Thanks again, I am sure that I will come across more issues that I'll need help with! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Wandora Forum Index -> Tools & Extensions All times are GMT + 2 Hours
Page 1 of 1

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


Powered by phpBB © 2001, 2005 phpBB Group