Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26449

    Hi, PD4ML works great and I’ve successfully integrated it into my weblogic instance in a multi-threaded environment to perform real-time HTML to PDF conversion for archival purposes. I created a custom resource provider based on the article in this forum. My custom resource provider uses Java’s JAI to reencode images on the fly so JPGs can be compressed and the PDF size reduced. This is working well, but I have encountered one issue with using a custom resource provider.

    In my weblogic instance, PD4ML seems to be dynamically loading my custom resource provider through the root classloader. My project consists of an ear, that is packed with several wars and jars. But the custom class is defined within a war within an ear. PD4ML only finds it when I take my custom class and its dependencies and put them in a separate jar on the server classpath, so PD4ML can load it with the root classloader.

    That works, but it limits the resource provider’s integration with other project-specific classes that I would like to use such as loggers and custom property file readers, which are not accessible to the root classloader.

    Is it possible to have PD4ML use a classloader for my custom resource provider other than the root classloader? Can it dynamically load my class through a classloader that I define? Can I add that as another property to the dynamic map?

    As well, is there a published list of properties that can be added to the map?

    Much thanks for a great app!

    #28194

    Current versions load the class like that:
    [language=java:f8vh12om]Class c = Class.forName(className);
    ResourceProvider provider = (ResourceProvider) c.newInstance();[/language:f8vh12om]

    We’ve just changed to
    [language=java:f8vh12om]Class c;
    try {
    c = Class.forName(className);
    } catch (ClassNotFoundException e) {
    try {
    c = Thread.currentThread().getContextClassLoader().loadClass(className);
    } catch (ClassNotFoundException e1) {
    c = ResourceCache.class.getClassLoader().loadClass(className);
    }
    }[/language:f8vh12om]

    (ResourceCache is one of PD4ML classess)

    In theory it should help. Please contact support pd4ml com if you have anything to add to the code or if you want to test it with your application before we released new version.

    #28195

    Perfect, I think that would do it!

    I’ll get in touch with support.

    Thanks,
    Aaron

    #28196

    The version implements the feature (v361b2) is already available for download.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘General questions / FAQ’ is closed to new topics and replies.