title: Flying Saucer in Lotus Notes
body: <p>I was trying to convert simple XHTML-files to PDF, and used Flying Saucer and iText to do so. It worked without problems in Java, however, when I tried to make a Lotus Notes agent with the same code, I got an exception I am unsure how to deal with.</p>
  <p>The code:</p>
  <pre><code>import lotus.domino.*;
  import java.io.*;
  import com.lowagie.text.DocumentException;
  import org.xhtmlrenderer.pdf.ITextRenderer; 
  import org.xhtmlrenderer.util.XRLog;
  import java.util.*;
  
  public class JavaAgent extends AgentBase {
  
      public void NotesMain() {
  
        try {
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();
          String received = agentContext.getDocumentContext().
               getItemValueString(&quot;Query_String&quot;);
          String[] split;
          split = received.split(&quot;&amp;&quot;);
          String url = split[1];
          split = url.split(&quot;/&quot;);
          String outputFile = split[split.length-1];
          String direc = session.getEnvironmentString(&quot;Directory&quot;, true);
          outputFile = direc + &quot;\\&quot; + outputFile + &quot;.pdf&quot;; 
          OutputStream os = new FileOutputStream(outputFile);
          ITextRenderer renderer = new ITextRenderer();
          renderer.setDocument(url);
          renderer.layout();
          renderer.createPDF(os);
          os.close();
          System.exit(0);
  
        } catch(Exception e) {
          e.printStackTrace();
        }
     }
  }
  </code></pre>
  <p>This yields the following:</p>
  <blockquote>
  <p>09-05-2011 13:33:29   HTTP JVM: Could not initialize configuration for Flying Saucer library. Message is: Can't find resource for bundle java.util.PropertyResourceBundle, key access_properties_not_allowed</p>
  <p>09-05-2011 13:33:29   HTTP JVM: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key access_properties_not_allowed</p>
  <p>09-05-2011 13:33:29   HTTP JVM:    at java.util.MissingResourceException.(MissingResourceException.java:50)</p>
  <p>09-05-2011 13:33:29   HTTP JVM:    at java.util.ResourceBundle.getObject(ResourceBundle.java:400)</p>
  <p>09-05-2011 13:33:29   HTTP JVM:    at java.util.ResourceBundle.getString(ResourceBundle.java:421)</p>
  <p>09-05-2011 13:33:29   HTTP JVM:    at lotus.notes.JavaString.getString(Unknown Source)</p>
  <p>09-05-2011 13:33:29   HTTP JVM:    at lotus.notes.AgentSecurityManager.checkPropertiesAccess(Unknown Source)</p>
  <p>09-05-2011 13:33:30   HTTP JVM:    at java.lang.System.getProperties(System.java:323)</p>
  <p>09-05-2011 13:33:30   HTTP JVM:    at org.xhtmlrenderer.util.Configuration.loadSystemProperties(Configuration.java:419)</p>
  <p>09-05-2011 13:33:30   HTTP JVM:    at org.xhtmlrenderer.util.Configuration.(Configuration.java:147)</p>
  <p>09-05-2011 13:33:30   HTTP JVM:    at org.xhtmlrenderer.util.Configuration.instance(Configuration.java:742)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at org.xhtmlrenderer.util.Configuration.valueFor(Configuration.java:463)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at org.xhtmlrenderer.util.Configuration.isTrue(Configuration.java:709)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at org.xhtmlrenderer.util.XRLog.init(XRLog.java:250)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at org.xhtmlrenderer.util.XRLog.log(XRLog.java:203)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at org.xhtmlrenderer.util.XRLog.render(XRLog.java:194)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at org.xhtmlrenderer.util.XRLog.render(XRLog.java:190)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at org.xhtmlrenderer.layout.SharedContext.(SharedContext.java:107)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at org.xhtmlrenderer.pdf.ITextRenderer.(ITextRenderer.java:111)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at org.xhtmlrenderer.pdf.ITextRenderer.(ITextRenderer.java:102)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at JavaAgent.NotesMain(Unknown Source)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at lotus.domino.AgentBase.runNotes(Unknown Source)</p>
  <p>09-05-2011 13:33:31   HTTP JVM:    at lotus.domino.NotesThread.run(Unknown Source)</p>
  </blockquote>
  <p>The offending line is</p>
  <pre><code>ITextRenderer renderer = new ITextRenderer();
  </code></pre>
  <p>Googling &quot;access_properties_not_allowed&quot; gives literally nothing.</p>