Page 1 of 2 12 LastLast
Results 1 to 20 of 24
  1. #1
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default helpset findHelpSet returns null

    Hi

    String pHelpSet = "docBook/jh/jhelpset.hs";
    myHSUrl = HelpSet.findHelpSet(null, pHelpSet);

    returns null always although the jhelpset.hs exists under the folder docBook/jh

    What could be wrong ?

    Regards
    kmm

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,520
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by kmm1977 View Post
    Hi

    String pHelpSet = "docBook/jh/jhelpset.hs";
    myHSUrl = HelpSet.findHelpSet(null, pHelpSet);

    returns null always although the jhelpset.hs exists under the folder docBook/jh

    What could be wrong ?
    Have you tried an absolute path, e.g. "/usr/kmm1977/docBook/jh/jhelpset.hs"?

    kind regards,

    Jos

  3. #3
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default splashscreen problem

    i run the app in windows do u mean somethin glike

    D:\\kmm1977\\docBook\\jh\\jhelpset.hs ?

  4. #4
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default splashscreen problem

    it still returns null

    is someother forum i read somelike this

    ClassLoader c1 = this.class.getClassLoader();
    URL hsURL = new URL("file:/c:/helpHS");
    hs = new HelpSet(c1, hsURL);

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    What does the API doc for HelpSet.findHelpSet() say?
    What package is HelpSet in?

  6. #6
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default helpset problem

    structure goes like this in eclipse

    - mainApp
    - src/main
    - application.java ( here is my main application )

    - JRE System Lib
    - Reference Lib
    - bin ( here i have my jar files , also jhall.jar )
    - docBook
    - jh ( here is the jhelpset.hs )
    - resources
    - src

    it is not in any package its in a folder in the application folder

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    Can you post the code for the findHelpSet() method?
    I have no idea what it does.

  8. #8
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default helpset problem

    its a huge code structure but i can explain

    the main application is mainApp which is in package report

    the manager class ( with main ) here is where the
    myHSUrl = HelpSet.findHelpSet(null, pHelpSet); is called in the constructor

    this is another package called onlineservice

    from my main application i call the Manager constructor
    myManager = new Manager("docBook/jh/jhelpset.jh",myScreen);

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    Where in the method does it decide to return null?
    Look there.

  10. #10
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default helpset problem

    yes i looked there
    but it returns only null

    the helpset files are not bundles as jar but are in folder

    docBook/jh/jhelpset.hs
    ...

    so i add this path to my classpath in eclipse

    and i call this helpfile from my main app

    HelpSet.findHelpSet(null, "docBook/jh/jhelpset.hs");
    i also tried all types of path combination , it adamant not to work :confused:

  11. #11
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    but it returns only null
    Are you saying that the findHelpSet method is this:
    Java Code:
    public  ... findHelpSet( ...) {
        return null;  // this is only line of code in this method
    }
    Hard to believe! There must be more to it than that

  12. #12
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default helpset problem

    yes there is more lines which follow

    URL myURL = HelpSet.findHelpSet(null, "docBook/jh/jhelpset.hs");

    but since here i get null as return values , it crashes

    ,
    what is basically required for implementing a java help system ?

    may be i m missing some packages !!

  13. #13
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    Your are missing my point.
    Why does the method: findHelpSet() return null?
    That's what you want to fix, isn't it?

  14. #14
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default helpset problem

    yes
    i dont understand why findHelpSet returns null

    although there exists jhelpset.hs file

  15. #15
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    We're sort of getting in a loop here.
    Do you have the source code for findHelpSet? Can you look at it to see why it would return a null?
    Or do you have doc for findHelpSet. Does it say why it will return a null?

  16. #16
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default helpset problem

    oh sorry for the misunderstanding

    findHelpSet is not implemented by me
    please see the reference below

    URL javax.help.HelpSet.findHelpSet(ClassLoader arg0, String arg1)

  17. #17
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    What did you find in the doc?

    Here's a short program that may help you find the correct path to the file. Change filename to your path and put the program in the folder where your programs are. Keep changing filename until the value of url is not null.
    Java Code:
    /*
    findHelpSet
    
    public static java.net.URL findHelpSet(java.lang.ClassLoader cl,
                                           java.lang.String name)
    As above but default on locale to Locale.getDefault()
    Parameters:
    cl - The ClassLoader to use. If cl is null the default ClassLoader is used.
    name - The name of the resource.
    Returns:
    Null if not found.
    
    */
    
    import java.net.*;
    
    public class TestGetResource1 {
    
       public static void main(String[] args) {
         String filename = "../../Testing/ForumQuestions3/TestGetResource.java";
          try {
            URL url = (new TestGetResource1()).getClass().getClassLoader().getResource(filename);
            System.out.println("FN=" + filename + ", url=" + url);
          }catch(Exception x) {
            System.out.println("Error: FN=" + filename + ", error:" + x);
          }
       }
    }
    /*
    FN=TestGetResource.java, url=file:/D:/JavaDevelopment/Testing/ForumQuestions3/TestGetResource.java
    FN=/TestGetResource.java, url=file:/D:/JavaDevelopment/Testing/ForumQuestions3/TestGetResource.java
    FN=../ForumQuestions3/TestGetResource.java, url=file:/D:/JavaDevelopment/Testing/ForumQuestions3/TestGetResource.java
    FN=../../Testing/ForumQuestions3/TestGetResource.java, url=file:/D:/JavaDevelopment/Testing/ForumQuestions3/TestGetResource.java
    FN=../../Testing/XXForumQuestions3/TestGetResource.java, url=null      <<<< NB: null when file does not exist
    */
    Last edited by Norm; 06-21-2010 at 06:22 PM.

  18. #18
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default helpset problem

    thank you first for the effort you took

    that example was great , which helped me understand the problem

    what i found that , is that the path is the problem . the application was not finding the files correctly

    thats an issue for eclipse to solve

    i put all the files in the bin folder of the application and it seems to work

    i have to find out to configure the eclipse search path to make the app find the files .

    any way thanks for that

  19. #19
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,520
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by kmm1977 View Post
    thats an issue for eclipse to solve
    It has nothing to do with Eclipse; helpsets are resources and are searched for as such; read the API documentation for the Class file where it is described how resources are found.

    kind regards,

    Jos

  20. #20
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Post helpset problem

    ok i ll look into it


    I now make a runnable jar , with eclipse and all is fine

    only the resource files i.e. png files are not shown in the help system of my application

    the png files lie under the subfolder of, the folder structure is as follows

    application folder
    - src/main
    - JRE System Lib
    - Reference Lib
    - bin ( here i have my jar files , also jhall.jar )
    - docBook
    - jh ( here is the jhelpset.hs )
    - resources
    - src

Page 1 of 2 12 LastLast

Similar Threads

  1. IndexSearch.docfreq returns 0.0
    By noir in forum Lucene
    Replies: 0
    Last Post: 04-26-2010, 09:32 AM
  2. Carriage Returns in JTEXTAREA
    By AJArmstron@aol.com in forum Advanced Java
    Replies: 8
    Last Post: 04-17-2010, 07:34 PM
  3. String file and carriage returns
    By AJArmstron@aol.com in forum New To Java
    Replies: 2
    Last Post: 04-17-2010, 01:28 AM
  4. NetworkInterface returns only ports that are up
    By dogbert in forum Networking
    Replies: 0
    Last Post: 10-13-2009, 05:12 PM
  5. What's the need for co-variant returns ?
    By ajeeb in forum New To Java
    Replies: 0
    Last Post: 03-23-2009, 09:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •