Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workload-fn with java lambda expression cannot access external maven dependencies #5

Closed
mikub opened this issue Jan 10, 2020 · 1 comment

Comments

@mikub
Copy link
Contributor

mikub commented Jan 10, 2020

Additional external maven dependencies loaded during runtime are accessible to all workflow step functions - i.e. either to clojure library functions, java classes or clojure anonymous functions.

They however do not seem to be visible to java lambda function code (see 4 in wiki)

Steps to reproduce:

  1. I load new maven dependencies (using GUI or just by updating ext-dependencies file) during runtime.
  2. I then prototype a new workflow step with a java lambda expression and reference the library loaded in step 1
  3. I get an error:
Compiler messages:
ERROR: package xxx.xxx.xxx does not exist
Compiler standard error output:

Expected behaviour: no error in step 3, instead the java lambda code should see the library on the classpath.

Example:

  1. load new maven dependency [com.github.librepdf/openpdf "1.3.11"]
  2. create a new workflow step with following java expression:
p -> { 
        com.lowagie.text.Document doc = new com.lowagie.text.Document();
        java.util.Map m = new java.util.HashMap();
        m.put("doc", doc);
        return m;
      }
  1. error message is as follows:
Compiler messages:
ERROR: package com.lowagie.text does not exist
Compiler standard error output:

If I don't use java lambda and just switch to clojure fn I can instantiate com.lowagie.text.Document without issues:

(fn [p]
{:doc (com.lowagie.text.Document.)})
mikub added a commit that referenced this issue Jan 11, 2020
@mikub
Copy link
Contributor Author

mikub commented Jan 11, 2020

Fixed in commit 880ea80 - This change breaks java lambda unit testing on Java 9 and higher though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant