Skip to main content

BadIDException finding MAP ID from jar

3 replies [Last post]
dingfelder
Offline
Joined: 2010-09-12

I am getting a BadIDException exception when i click my help button.

My Map.jhm file (and all my other help files) are in a jar file (whih has no subdirectories).

I added the iD in my java code by:

String urlString = new String("jar:file:c:/test/lib/myhelp.jar!/myhelp.hs");
URL url = new URL(urlString);
ClassLoader cl = this.getClass().getClassLoader();
HelpSet hs = new HelpSet(cl, url);
hb = hs.createHelpBroker();
CSH.setHelpIDString(helpButton, "top");

It is my thought that I am missing something or somehow not reading the Map file (rather than the map file not containing the ID) because the map looks right to me:

my map.jhm file contains:

<?xml version="1.0" encoding="ISO-8859-1"?>

Thanks in advance for any advice anyone can provide.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
brinkley
Offline
Joined: 2003-06-06

BadIDExceptions are thrown because the ID doesn't exist in the refering HelpSet. While it looks like yours does exist either the HelpSet wasn't set up correctly or the Map file isn't being read in correctly. Make sure the HelpSet file is properly referenced.

binky

dingfelder
Offline
Joined: 2010-09-12

That was my understanding as well but i'm not quite sure what to look for. The java code reported no errors on loading the helpset so I think it is referenced correctly in the java side. The helpset and map files were created by JHelpDev and they look ok to me (but I'm not a javahelp expert so I may not really know what to look for)

I have included the helpset contents in casse it shows something obvious:



<br /> myTest Help<br />


top





TOC



javax.help.TOCView


myTestTOC.xml




Index



javax.help.IndexView


myTestIndex.xml




Search



javax.help.SearchView


JavaHelpSearch


dingfelder
Offline
Joined: 2010-09-12

no other thoughts on what might be wrong?