title: Java applet can't find JavaPOS configuration files
body: <p>I've created an applet that uses JavaPOS to communicate with a payment terminal on the user's local system.</p>
  
  <p>When run from within the Eclipse IDE, the applet works fine, but not when run in a browser. In a browser, the applet can't seem to find the jpos/res/jpos.properties and jposxml.cfg files.</p>
  
  <p>When the following statements are executed in the applet (in the start() method, not init()):</p>
  
  <pre><code>JposEntryRegistry registry = JposServiceLoader.getManager().getEntryRegistry();
  registry.load();
  </code></pre>
  
  <p>this is the output I see in the Java console window:</p>
  
  <pre><code>jpos/res/jpos.properties file not found
  jpos/res/jpos.properties file not found
  jpos/res/jpos.properties file not found
  </code></pre>
  
  <p>And no entries are loaded in the JposEntry registry.</p>
  
  <p>I've tried the following to get the applet to "see" the two files:</p>
  
  <ol>
  <li><p>jpos/res/jpos.properties is already present in one of the jars referenced by the applet. Nevertheless, I've added this file to the applet's main jar. I've also tried adding it to the directory on the server containing the jars (with the correct relative path). None of this works.</p></li>
  <li><p>I can work around the inability of jpos.properties to be found by setting System properties with the appropriate values, like this:</p>
  
  <pre><code>System.setProperty("jpos.loader.serviceManagerClass", "jpos.loader.simple.SimpleServiceManager");
  System.setProperty("jpos.config.populatorFile", "jposxml.cfg");
  System.setProperty("jpos.util.tracing.TurnOnNamedTracers", "JposServiceLoader,SimpleEntryRegistry,SimpleRegPopulator,XercesRegPopulator");
  System.setProperty("jpos.util.tracing.TurnOnAllNamedTracers", "ON");
  </code></pre>
  
  <p>However, the applet still can't find jposxml.cfg. This file is present in the root of the applet's main jar file. I've tried putting on the server in the same directory as the jars. I've also tried creating a separate jar file containing only jposxml.cfg, but that doesn't work either. I get the following output in the Java console window:</p>
  
  <pre><code>[AbstractRegPopulator]getPopulatorFileIS(): populatorFileName=jposxml.cfg
  [JposServiceLoader]manager.getEntryRegistry().load() OK
  [AbstractRegPopulator]getPopulatorFileIS(): populatorFileName=jposxml.cfg
  </code></pre>
  
  <p>But the list of JposEntries is empty. As a result the applet can't communicate with the payment terminal.</p></li>
  </ol>
  
  <p>The applet is loaded via a JNLP file (and all required jars via a JNLP extension). Both JNLP files have security set to &lt;all-permissions/&gt;. All jars are signed with the same certificate. The same code works perfectly in Eclipse. Any ideas on what the problem is?</p>