1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Ticket #330 (closed defect: fixed)

Opened 2 years ago

Last modified 19 months ago

NanoSparqlServer does not locate "html" resources when run as an embedded server from the jar

Reported by: thompsonbry Owned by: thompsonbry
Priority: critical Milestone:
Component: NanoSparqlServer Version: QUADS_QUERY_BRANCH
Keywords: Cc: martyncutcher, mrpersonick

Description

The NanoSparqlServer? does not locate "html" resources when run as an embedded server from the jar. The problem is on the one hand that the bigdata-war/src directory was not being included within the jar. However, even with that directory copied into the jar the NanoSparqlServer? is still not locating these resources.

Most people will run the NanoSparqlServer? from the WAR, which does not have this problem. This issue will mainly be encountered by people using the NanoSparqlServer? as a benchmarking utility.

Change History

Changed 2 years ago by thompsonbry

Modified build.xml to bundle the web app resources in the bigdata jar.

Changed 2 years ago by thompsonbry

  • status changed from new to accepted

Martyn suggests an incantation along the following lines to locate the web resources in the class path:

String webDir = this.class.getClassLoader().getResource("com/company/project/mywebdir").toExternalForm();

ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); context.setResourceBase(webDir);

Changed 19 months ago by thompsonbry

  • priority changed from major to critical
  • status changed from accepted to closed
  • resolution set to fixed

We have three different evaluation environments which need to be handled. The IDE, the JAR, and the WAR. The IDE and JAR are both "embedded" deployments and are run through NanoSparqlServer#main?(). The web resources for the NanoSparqlServer? are deployed to bigdata-war/src/html in the JAR, which is their path in the top-level project. However, we can not use that path in the IDE as it would require the project root to be on the build path. Therefore, I have modified NanoSparqlServer? to first look for the "bigdata-war/src/html" resource (JAR) and then look for the "html" resource (IDE). I have also added "bigdata-war/src" to the build path for Eclipse.

This fixes the deployment under the IDE (the index.html page is now located).

Note: See TracTickets for help on using tickets.