• XAgent Example?

    By Dave Armstrong 4 years ago

    I'm trying to create an XAgent to build a Word Document using POI, but the JVM is throwing an error of “'org' not found” when I first try to use it with:

    var wordDoc:org.apache.poi.xwpf.usermodel.XWPFDocument = new org.apache.poi.xwpf.usermodel.XWPFDocument();
    

    I'm unsure if I am using the wrong namespaces, if my install did not work, or if there is another problem.

    Does anyone have an example of a working XAgent using this library?

    • By Christian Güdemann 4 years ago

      Hi Dave

      Some Questions:

      • Which version of POI4XPages are you using?
      • Have you activated the plugin as an extension library?
      • Is the library also on your server and your designer client?

      Best regards
      Christian

      • By Dave Armstrong 4 years ago

        1.2.6.201312211419, Yes, and Yes.

        I did find that if I disabled the plugin in my UpdateSite, and instead pulled the jars into my database in WebContent/WEB-INF/lib, the same XAgent throws an Error 500. If I remove the log4j jar from that same folder, it then runs and gets past the 'org not found' error, but then throws a: java.lang.reflect.InvocationTargetException

        Domino server is 9.0.1, if that makes a difference on the various versions.

        • By Christian Güdemann 4 years ago

          The version of POI4XPages may be more interessting. I didn't use POI4XPages in the situation of a XAgent. So can you please share your use case?

          • By Dave Armstrong 4 years ago

            We have a traditional Domino app, and currently use iText via XAgents to format documents into PDFs. The app links to a URL which returns the PDF. One of our clients would like a Word download using this same mechanism - hit a URL, get the Word document in return.