facebook

Failure to read context file

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #254029 Reply

    leima
    Member

    I’ve put a context.properties file in a jar and included it in my project. In execution the following line returns null. What should I do to correct this?

    InputStream in = this.getClass().getResourceAsStream(“/context.properties”);

    #254071

    Scott Anderson
    Participant

    Make sure the context.properties file isn’t in a subdirectory in the jar (like a package). To reference it like that it must be at the root level.

    #254196

    leima
    Member

    Currently I see context.jar-C:\quoteAvaya\quoting\config\dev in package explorer, does it mean I have the file in a subdirectory?

    How do I create a jar with the file not in a subdirectory in the workbench?

    #254206

    leima
    Member

    Through some debugging I’ve found out that the file can be read if the class is executed as a Java application but once I deploy the project on Tomcat as a web application and try to access it via a browser an error occurs at the attempt to read the file. Any ideas?

    Thanks.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Failure to read context file

You must be logged in to post in the forum log in