turcsanyip commented on a change in pull request #4540: URL: https://github.com/apache/nifi/pull/4540#discussion_r496900671
########## File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/bootstrap.conf ########## @@ -66,6 +66,15 @@ java.arg.16=-Djavax.security.auth.useSubjectCredsOnly=true # Please see https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_adminserver_config for configuration options. java.arg.17=-Dzookeeper.admin.enableServer=false +# The following options configure a Java Agent to handle native library loading. +# It is needed when a custom jar (eg. JDBC driver) has been configured on a component in the flow and this custom jar depends on a native library +# and tries to load it by its absolute path (java.lang.System.load(String filename) method call). +# Use this Java Agent only if you get "Native Library ... already loaded in another classloader" errors otherwise! +#java.arg.18=-javaagent:./lib/aspectjweaver-${aspectj.version}.jar Review comment: I double checked it and unfortunately the aspect class in `nifi-nar-utils.jar` depends on `aspectjrt.jar`. As `nifi-nar-utils.jar` is located in the lib folder and loaded by the system classloader, `aspectjrt.jar` must be on the system classpath too. And I did not want to separate the 2 AspectJ jars so I put `aspectjweaver.jar` to the lib folder. Options: 1. leave it as it is now (both `aspectjrt.jar` and `aspectjweaver.jar` in the `lib` folder) 2. leave `aspectjrt.jar` in `lib` and move `aspectjweaver.jar` to `lib/aspectj` 3. find another place for the aspect class and move its `aspectjrt.jar` dependency there, move `aspectjweaver.jar` to `lib/aspectj` Option 2 seems to me a bit weird structure and one of the AspectJ jars is still on the system classpath. Option 3 could work but I would keep the native library loading stuff (`AbstractNativeLibHandlingClassLoader` and `LoadNativeLibAspect`) in the same module. So I would still vote for option 1. These jars have no effect if they are not referenced in our code / the agent is not turned on. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
