title: Reaching a static folder in a web app with maven & tomcat
body: <p>As a newbie to developing web applications, I am developing an app (java 8, maven, tomcat, windows 10) using grobid.</p>
  <p><a href="https://i.stack.imgur.com/mjVtu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mjVtu.png" alt="enter image description here" /></a></p>
  <p>To be able to use the grobid resources, I need to reach grobid-home folder (see the capture that it is under resources folder) as mentioned here <a href="https://grobid.readthedocs.io/en/latest/Configuration/" rel="nofollow noreferrer">grobid</a></p>
  <p>The code to find home folder is:</p>
  <pre><code>String pGrobidHome = &quot;src/main/resources/grobid-home&quot;;
  GrobidHomeFinder grobidHomeFinder = new GrobidHomeFinder(Arrays.asList(pGrobidHome));
  GrobidProperties.getInstance(grobidHomeFinder);
  </code></pre>
  <p>and this works fine when I run my code locally (w/o tomcat). <strong>PS. I run my code using WSL to be able to run it on linux system.</strong></p>
  <p>However, when I use the same code part in my app changing the path with,</p>
  <pre><code>ServletContext ctx=getServletContext();
  String path = ctx.getRealPath(&quot;/WEB-INF/classess&quot;);
  </code></pre>
  <p>I got the following error:</p>
  <pre><code>Unsupported protocol for Grobid home at location: file:/C:/Users/u0156666/TOMCAT/apache-tomcat-9.0.65/webapps/webapp_war/WEB-INF/classes/grobid-home/lexicon/names/firstname.5k
  
  org.grobid.core.main.GrobidHomeFinder.fail(GrobidHomeFinder.java:92)
      org.grobid.core.main.GrobidHomeFinder.getGrobidHomePathOrLoadFromClasspath(GrobidHomeFinder.java:141)
      org.grobid.core.main.GrobidHomeFinder.findGrobidHomeOrFail(GrobidHomeFinder.java:53)
      org.grobid.core.utilities.GrobidProperties.getInstance(GrobidProperties.java:97)
      main.java.mainProcess.&lt;init&gt;(mainProcess.java:48)
      main.java.FileUploadServlet.doPost(FileUploadServlet.java:55)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
  </code></pre>
  <p>Apparently the way I get the path to the home-folder is not correct. So how should I reach a folder when I run my application on a server?</p>
  <p>Thanks in advance!</p>