Code Monkey home page Code Monkey logo

nuix-java-engine-baseline's Introduction

Nuix Java Engine Baseline

Nuix Engine 9.10.x.x

View the GitHub project here or download the latest release here.

View the Java docs here.

Overview

Written By: Jason Wells

This repository contains a series of examples making use of the Java Engine API and can be used as a foundation for your own Nuix Java Engine based project. This project provides implementation of some commonly desired functionality one may want around using the Nuix Engine API:

  • Environment configuration checks with hints at addressing some misconfigurations
  • License resolution with fallbacks when initially desired license is not available
  • Logging initialization
  • Diagnostics generation
  • Third party dependency checking
  • Ruby script execution

This project can provide you a quick way to get up and running with some additional functionality built on top. Due to some of the extra features included, this project may not be the easiest way to wrap you head around the fundamental steps needed to use the Nuix Java Engine API. If you are looking for a more straight forward example demonstrating core concepts regarding getting the Nuix Java Engine API up and running, see the Java SDK Starter repository.

Setup

Nuix Java Engine Distributable

We will need to obtain a Nuix Java Engine API distributable release. This contains the various binaries and dependencies needed to run the Nuix Java Engine API.

  1. Download an Engine release from the Nuix download site.
  2. Extract its contents to a directory, such as C:\EngineRelease.
  3. Edit the system environment variables, adding a new variable named NUIX_ENGINE_DIR assigning the directory in the previous step as the value. The project refers to this environment variable to resolve these dependencies.
  4. (Optional) If you wish to obtain your license from either Nuix Management Server (NMS) or Nuix Cloud License Server (CLS) you may want to specify authentication credentials. The project supports obtaining the user name and password from environment variables NUIX_USERNAME and NUIX_PASSWORD (although does not require this).

IDE

This project makes use of Gradle and has been tested with IntelliJ Idea IDE. It may work with other IDEs such as Eclipse as well, but it has only been tested in IntelliJ Idea.

Gradle is a build automation tool. While it adds a small degree of additional complexity (the build.gradle.kts file is not the most straightforward) it does provide some benefits that make it worth the additional complexity.

  1. If you do not already have it installed, download and install IntelliJ Idea IDE (the community edition should be fine).
  2. Download or clone this repository to your development machine.
  3. Download a Nuix Java Engine API release zip file and extract its contents to the engine sub-directory of your local copy.
  4. Start IntelliJ Idea and open project by selecting \Nuix-Java-Engine-Baseline\IntelliJ\build.gradle.kts.
  5. Import process should begin. This can take a few minutes as dependencies are pulled down from the internet, dependencies are indexed, etc.

NuixEngine Class

Making use of the Nuix Java Engine API, at a high level, involves:

  1. Ensure environment is configured appropriately, such as having Nuix Engine dependencies in place.
  2. Start engine instance.
  3. License the engine instance.
  4. Once licensed, make use of the Utilities object to interact with the rest of the API.

This repository provides much of the logic to perform this work, allowing you to get the engine initialized as simply as:

// Define a resolver which will resolve licenses from Cloud License Server (CLS),
// authenticating using upon environment variable "NUIX_USERNAME" and "NUIX_PASSWORD",
// that have at least 4 workers and the feature "CASE_CREATION".
LicenseResolver cloud_4_workers = NuixLicenseResolver.fromCloud()
    .withLicenseCredentialsResolvedFromEnvVars()
    .withMinWorkerCount(4)
    .withRequiredFeatures("CASE_CREATION");

// Define a resolver which will attempt to resolve a license from a local physical dongle
// that has the feature "CASE_CREATION".
LicenseResolver anyDongle = NuixLicenseResolver.fromDongle()
    .withRequiredFeatures("CASE_CREATION");

// Create a new NuixEngine instance which will first attempt to resolve a cloud license and then
// attempt to resolve a dongle license if one cannot be resolved from cloud, using resolvers
// defined above.  Calling run method to execute code with a licensed Engine instance (if a license can be obtained).
NuixEngine.usingFirstAvailableLicense(cloud_4_workers, anyDongle)
    .setEngineDistributionDirectoryFromEnvVars()
    .run((utilities -> {
        log.info("License was obtained!");
        // Do something with Utilities/API here
    }));

In the example above, the run method will internally call the NuixEngine.getUtilities method. This in turn will do the following:

  1. Call NuixEngine.checkPreconditions which will check some environmental settings, using sensible defaults when possible and throwing informative errors when it cannot.
  2. Initialize log4j2 logging for you.
  3. Constructuct GlobalContainer and Engine instances for you with some lifetime management hooked into JVM shut down.
  4. Work through the 1 or more LicenseResolver instances provided to resolve a license, logging information about the process.
  5. Log information regarding presence of third party dependencies.
  6. Yield a licensed instance of Utilities for you to work with, if a license was able to be obtained.

Running an Example Outside Gradle

Gradle simplifies running the examples, but what is needed to run an example (or your own code) outside of Gradle? We need to take similar steps to what Gradle would be doing:

  • Start a JVM (Java Virtual Machine) to run the program.
  • Make sure that the engine release sub-directories bin and bin\x86 can be resolved via the PATH environment variable.
  • Make sure your JAR can be resolved on the JVM classpath.
  • Make sure the Nuix dependency JAR files in the engine release lib sub-directory can be resolved on the JVM classpath.
  • Make sure we know the entry point to our program. The entry point is the Java class containing the public static void main(String[] args) method to run.

Make Sure Java is Installed

It is assumed that you have Java installed and that running the command java on the console will succeed.

PATH References to bin and bin/x86

You will need to make sure that the PATH environment variable for the JVM process points to the engine release sub-directories bin and bin\x86. This can be accomplished different ways. The easiest is to add those paths to the PATH environment variable. There are ways to set these temporarily for the JVM process you start. For example you could use a batch file and SET LOCAL / END LOCAL (doc) in combination with SET (doc) or start your program via something like the .NET class Process which allows for customizing the environment variables just for a process it starts via

Process nuixProcess = new Process();
...
...
string engineDir = "C:\\EngineRelease";
string engineBinDir = engineDir + "\\bin";
string enginex86BinDir = engineBinDir + "\\x86";
string existingPath = Environment.GetEnvironment("PATH");
nuixProcess.StartInfo.EnvironmentVariables.Add("PATH", existingPath+";"+engineBinDir+";"+enginex86BinDir );

Construct the Command

The command takes the basic form:

java --add-exports=java.base/jdk.internal.loader=ALL-UNNAMED -cp "<Engine Lib Directory>/*;<Path to Jar>" <Main Class>

If my engine release lib directory is located at C:\EngineRelease\lib, my compiled JAR is located at C:\MyApp\MyCustomNuixApp-v1.0.0.jar and my public static void main(String[] args) method exists in a class com.company.CustomNuixApp then the command would look like this:

java --add-exports=java.base/jdk.internal.loader=ALL-UNNAMED -cp "C:/EngineRelease/lib/*;C:/MyApp/MyCustomNuixApp-v1.0.0.jar" com.company.CustomNuixApp

Some things to note:

  • The argument --add-exports=java.base/jdk.internal.loader=ALL-UNNAMED is necessary and you will have startup issues if you do not include this. Note that NuixEngine class will check for this during check of pre-conditions.
  • The class path references use forward slashes (/) rather than the Windows norm of using back slashes (\).
  • The engine lib directory class path reference ends with /* to include all JAR files in that directory.
  • The program JAR reference is an absolute reference to the JAR file (it could be reference to its containing directory though).
  • The class path entries are delimited with a semicolon (;).
  • The last argument is the fully qualified name (package and class name) of the class containing the entry point we are running.

Gradle Package Dependency

Just want to make use of the wrapper? You can add the wrapper classes as a dependency to your own Gradle project.

You will need to generate a personal access token with at least the permission read:packages. Place this token in the environment variable GITHUB_TOKEN. Place your GitHub username in the environment variable GITHUB_USERNAME. You can also supply the username and token by other means if you wish (see below), but the environment variables mentioned above should work with the Gradle code below.

The you will need to merge the following into your project's build.gradle.kts file:

// Directory containing Nuix Engine release
val nuixEngineDirectory: String = System.getenv("NUIX_ENGINE_DIR")
println("NUIX_ENGINE_DIR: ${nuixEngineDirectory}")
if (nuixEngineDirectory.isEmpty()) {
    throw InvalidUserDataException("Please populate the environment variable 'NUIX_ENGINE_DIR' with directory containing a Nuix Engine release")
}

val engineLibDir = "${nuixEngineDirectory}\\lib"
println("engineLibDir: ${engineLibDir}")

repositories {
    mavenCentral()

    // Resolve GitHub username and access token
    val github_username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_USERNAME")
    val github_token = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")

    // Link to repository so package can be resolved
    maven {
        url = uri("https://maven.pkg.github.com/nuix/nuix-java-engine-baseline")
        credentials {
            username = github_username
            password = github_token
        }
    }
}

dependencies {
    // Engine wrapper as dependency
    implementation("com.nuix.innovation:enginewrapper:Nuix9.10-v1.+")

    // Test run-time engine release lib dir
    testImplementation(fileTree(baseDir = engineLibDir) {
        include("*.jar")
    })
}

// Function to perform some configuration of test environment when tests are ran
fun configureTestEnvironment(test: Test) {
    // Engine runtime temp directory
    val nuixTempDirectory = findProperty("tempDir") ?: "${System.getenv("LOCALAPPDATA")}\\Temp\\Nuix"

    // Args passed to JVM running tests
    test.jvmArgs(
            "--add-exports=java.base/jdk.internal.loader=ALL-UNNAMED",
            "-Xmx4G",
            "-Djava.io.tmpdir=\"${nuixTempDirectory}\"",
    )

    // Configure ENV vars for JVM tests run in
    test.setEnvironment(
            // Add our engine release's bin and bin/x86 to PATH
            Pair("PATH", "${System.getenv("PATH")};${nuixEngineDirectory}\\bin;${nuixEngineDirectory}\\bin\\x86"),

            // Forward ENV username and password
            Pair("NUIX_USERNAME", System.getenv("NUIX_USERNAME")),
            Pair("NUIX_PASSWORD", System.getenv("NUIX_PASSWORD")),

            // Forward LOCALAPPDATA and APPDATA
            Pair("LOCALAPPDATA", System.getenv("LOCALAPPDATA")),
            Pair("APPDATA", System.getenv("APPDATA")),

            // We need to make sure we set these so workers will properly resolve temp dir
            // (when using a worker based operation via EngineWrapper).
            Pair("TEMP", nuixTempDirectory),
            Pair("TMP", nuixTempDirectory),

            Pair("NUIX_ENGINE_DIR", nuixEngineDirectory)
    )
}

// Ensure that tests are ran by JUnit and that test environment gets configured
tasks.test {
    dependsOn(tasks.findByName("copyJarsToEngine"))
    useJUnitPlatform()
    configureTestEnvironment(this)
}

Where to Get Help

Having trouble getting things up and running? Here are several places you can seek assistance:

License

Copyright 2023 Nuix

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

nuix-java-engine-baseline's People

Contributors

juicydragon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nuix-java-engine-baseline's Issues

Incorporate system property 'nuix.libdir'

Example:

System.setProperty("nuix.libdir", "C:\\EngineDist\\lib");

Should hopefully provide a fix for situation in which extremely long class path being passed to workers causes the worker invocation command to be too long.

CLS licence never gets released

In the cloud licence mode of acquiring a licence the time to live on the acquired licence is typically going to be a long time so you should release it when the consumer's accept call is done.

That is, unless you want to support some sort of semi-offline mode like nuix console does with its -release switch (by default it holds the licence for another session on the same machine). In which case this wrapper would provide a means to specify whether to release the licence on cleanup or not.

Thirdparty dependency checker issue

Hi

I am working on admin user it is connecting to license server and third party dependency checker working but I am login with user it is not working.

Could you please help me this issue.

Thank you in advance.

NOTE: I gave same permission with User and Admin

Execution hangs after iterating over available server licenses

Using your EngineWrapper (with the Nuix Engine v8.4.6.866) to obtain licenses from our NMS the execution hangs for close to a minute after this code section:

logger.info("Iterating available licences...");
for(AvailableLicence license : licences) {
logger.info(LicenseFeaturesLogger.summarizeLicense(license));
}

it seems that the executions stopps after the programm iterated over all available licenses on the server.

when I set the logging level to debug. I get the following debug messages after the last license where summarised:

2020-07-24 11:40:03 DEBUG com.nuix.util.net.f:a():82 - Resolving for _nuix2._tcp...
2020-07-24 11:40:24 DEBUG com.nuix.util.net.f:a():100 - No results for _nuix2._tcp

after that the executions continues without problem and a license is obtained. when is comment the code section above and don't iterate to the last license these Debug messages won't appear.

what is Nuix doing in the background and how can I stop it?

Not working in executable jar

Hi Nuix Team,

I able to run the latest released nuix engine 9.10.xx version in intellij with VM arguments

--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED

now I generated build and run from executable jar like

java -Xms2g -Xmx4g -jar nuixEngineTest.jar --add-exports=java.base/jdk.internal.loader=ALL-UNNAMED

not working and throw error

ERROR com.nuix.util.jvm.classloader.EngineBootstrapClassLoader - Matching method not found for "load module "java.lang.NoSuchMethodException: org.springframework.boot.loader.LaunchedURLClassLoader.loadModule(java.lang.module.ModuleReference)        at java.lang.Class.getMethod(Class.java:2108) ~[?:?]        at com.nuix.util.jvm.classloader.EngineBootstrapClassLoader.a(SourceFile:139) ~[nuix-util-9.10.9.584.jar!/:?]        at java.util.Optional.ifPresent(Optional.java:183) ~[?:?]        at com.nuix.util.jvm.classloader.EngineBootstrapClassLoader.a(SourceFile:132) ~[nuix-util-9.10.9.584.jar!/:?]        at com.nuix.util.jvm.classloader.EngineBootstrapClassLoader.run(SourceFile:74) ~[nuix-util-9.10.9.584.jar!/:?]        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]        at com.nuix.engine.e.<init>(SourceFile:49) ~[nuix-engine-impl-9.10.9.584.jar!/:?]        at com.nuix.engine.DefaultGlobalContainerFactory.createSpi(SourceFile:23) ~[nuix-engine-impl-9.10.9.584.jar!/:?]        at nuix.engine.GlobalContainerFactory.newContainer(SourceFile:60) ~[nuix-engine-api-9.10.9.584.jar!/:?]        at com.lio.eprintutility.services.LoginServiceImpl.getAllServerLicense(LoginServiceImpl.java:255) ~[classes!/:?]        at com.lio.eprintutility.services.LoginServiceImpl$1.call(LoginServiceImpl.java:45) ~[classes!/:?]        at com.lio.eprintutility.services.LoginServiceImpl$1.call(LoginServiceImpl.java:41) ~[classes!/:?]        at javafx.concurrent.Task$TaskCallable.call(Task.java:1425) ~[javafx-graphics-11-win.jar!/:?]        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]        at javafx.concurrent.Service.lambda$executeTask$6(Service.java:725) ~[javafx-graphics-11-win.jar!/:?]        at java.security.AccessController.doPrivileged(Native Method) ~[?:?]        at javafx.concurrent.Service.lambda$executeTask$7(Service.java:724) ~[javafx-graphics-11-win.jar!/:?]        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]        at java.lang.Thread.run(Thread.java:834) [?:?]

Could you please help me from the above issue.

Thank you .

Regard's
Ramesh

java.lang.NoClassDefFoundError when switching to Nuix Engine engine-dist-win32-amd64-9.6.6.317

I am developing a project based on Nuix-Java-Engine-Baseline and the Nuix Engine. When switching the engine from 9.2.4.392 to 9.6.6.317 the execution of my program runs into an error. When using it with the engine version 9.2.4.392 it runs just fine.

C:\Users\user\Desktop\casemaker-0.0.1-SNAPSHOT>"C:\Program Files\Eclipse Foundation\jdk-11.0.12.7-hotspot\bin\java.exe" -Xms2G -Xmx2G -Dlog4j.configurationFile="C:\Users\user\Desktop\casemaker-0.0.1-SNAPSHOT\log4j2-nuix-9.yml" -Dnuix.logdir="C:\Nuix\engine-dist-win32-amd64-9.6.6.317\logs\20220102174752" -Dnuix.libdir="C:\Nuix\engine-dist-win32-amd64-9.6.6.317\lib" -cp lib\*;C:\Nuix\engine-dist-win32-amd64-9.6.6.317\lib\* de.comp.nuix.api.CreateCase "C:\Nuix\CaseFolder" "TestCase" "C:\Nuix_Evidence\Language_Test"
2022-02-01 17:47:53.833 +0100 [main] 1684 INFO  de.comp.nuix.common.config.DataBridgeConfigurator - DataBridgeConfig gefunden in: dataBridgeConfig.json
2022-02-01 17:47:53.848 +0100 [main] 1699 INFO  de.comp.nuix.api.EngineWrapper - Setting 'nuix.libdir' to: C:\Nuix\engine-dist-win32-amd64-9.6.6.317\lib
2022-02-01 17:47:53.864 +0100 [main] 1715 INFO  de.comp.nuix.api.EngineWrapper - Creating GlobalContainer...
2022-02-01 17:47:54.834 +0100 [main] 2685 INFO  com.nuix.storage.lowlevel.graph.a - Setting un-specified OrientDB System property 'memory.leftToOS' to Nuix default of '90%'.
2022-02-01 17:47:54.834 +0100 [main] 2685 INFO  com.nuix.storage.lowlevel.graph.a - Setting un-specified OrientDB System property 'memory.useUnsafe' to Nuix default of 'false'.
2022-02-01 17:47:54.834 +0100 [main] 2685 INFO  com.nuix.storage.lowlevel.graph.a - Setting un-specified OrientDB System property 'storage.compressionMethod' to Nuix default of 'gzip'.
2022-02-01 17:47:55.447 +0100 [main] 3298 INFO  com.nuix.util.concurrent.d - Initialising with 2 IO threads
2022-02-01 17:47:55.460 +0100 [main] 3311 INFO  com.nuix.util.concurrent.d - Initialising with 4 store threads
2022-02-01 17:47:55.622 +0100 [main] 3473 INFO  com.nuix.util.jvm.classloader.EngineBootstrapClassLoader - EngineBootstrapClassLoader invoked.
2022-02-01 17:47:55.660 +0100 [main] 3511 INFO  com.nuix.util.jvm.classloader.EngineBootstrapClassLoader - Trying to load JARS under this path- C:\Nuix\engine-dist-win32-amd64-9.6.6.317\lib\non-fips
2022-02-01 17:47:55.660 +0100 [main] 3511 INFO  com.nuix.util.jvm.classloader.EngineBootstrapClassLoader - Valid ClassLoader Module Path resolved to C:\Nuix\engine-dist-win32-amd64-9.6.6.317\lib\non-fips
2022-02-01 17:47:55.776 +0100 [main] 3627 WARN  com.nuix.util.jvm.classloader.EngineBootstrapClassLoader - Failed to invoke Load Module for EngineBootStrapClassLoader as java.base does not export jdk.internal.loader to unnamed module
2022-02-01 17:47:55.776 +0100 [main] 3627 INFO  com.nuix.util.crypto.i - NuixSecurityServices created in non-FIPS mode
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.nuix.storage.lowlevel.graph.internal.impl.orientdb.e (file:/C:/Nuix/engine-dist-win32-amd64-9.6.6.317/lib/nuix-storage-lowlevel-9.6.6.317.jar) to method java.lang.ClassLoader.findLoadedClass(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.nuix.storage.lowlevel.graph.internal.impl.orientdb.e
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2022-02-01 17:47:55.776 +0100 [main] 3627 INFO  de.comp.nuix.api.EngineWrapper - Removing shutdown hook to EngineWrapper::close
Exception in thread "main" java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
        at com.nuix.util.crypto.i.a(SourceFile:35)
        at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:167)
        at com.nuix.util.k.e(SourceFile:107)
        at com.nuix.util.jvm.classloader.EngineBootstrapClassLoader.b(SourceFile:86)
        at com.nuix.util.jvm.classloader.EngineBootstrapClassLoader.run(SourceFile:81)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at com.nuix.engine.e.<init>(SourceFile:49)
        at com.nuix.engine.DefaultGlobalContainerFactory.createSpi(SourceFile:23)
        at nuix.engine.GlobalContainerFactory.newContainer(SourceFile:60)
        at de.comp.nuix.api.EngineWrapper.withServerLicense(EngineWrapper.java:189)
        at de.comp.nuix.api.CreateCase.main(CreateCase.java:95)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 11 more

C:\Users\user\Desktop\casemaker-0.0.1-SNAPSHOT>PAUSE

I would expect it to run in the new version as in the old version.

Basic example is not working: ClassNotFoundException for org.picocontainer.MutablePicoContainer

Unfortunately the basic example is not working for me. I always get
Caused by: java.lang.ClassNotFoundException: org.picocontainer.MutablePicoContainer

The full error message is:

[Fatal Error] log4j2.yml:1:1: Content is not allowed in prolog.
Exception in thread "main" java.lang.NoClassDefFoundError: org/picocontainer/MutablePicoContainer
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at com.nuix.common.dependency.Dependencies.a(SourceFile:66)
	at com.nuix.common.dependency.Dependencies.bootstrap(SourceFile:55)
	at com.nuix.engine.e.<init>(SourceFile:46)
	at com.nuix.engine.DefaultGlobalContainerFactory.createSpi(SourceFile:26)
	at nuix.engine.GlobalContainerFactory.newContainer(SourceFile:66)
	at com.nuix.enginebaseline.NuixEngine.ensureGlobalContainer(NuixEngine.java:479)
	at com.nuix.enginebaseline.NuixEngine.getUtilities(NuixEngine.java:314)
	at com.nuix.enginebaseline.NuixEngine.run(NuixEngine.java:337)
	at com.nuix.enginebaseline.Main.main(Main.java:25)
Caused by: java.lang.ClassNotFoundException: org.picocontainer.MutablePicoContainer
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 18 more

Caused by: java.lang.ClassNotFoundException: org.picocontainer.MutablePicoContainer

Execution failed for task ':Main.main()'.
> Process 'command 'D:/Java/jdk-11.0.2/bin/java.exe'' finished with non-zero exit value 1

The Main class is very simple based on your example:

public class Main {

    public static void main(String[] args) {

        try {
            LicenseResolver anyDongle = NuixLicenseResolver.fromDongle()
                    .withRequiredFeatures("CASE_CREATION");
            NuixEngine.usingFirstAvailableLicense(anyDongle)
                    .setEngineDistributionDirectoryFromEnvVar()
                    .run((utilities -> {
                        //log.info("License was obtained!");
                        System.out.println("Licence obtained!");
                        // Do something with Utilities/API here
                    }));
        }catch(Exception e){
            System.out.println(e.getMessage());
        }
    }
}

Is there anything I need to check?

How do i implement Processor for addeing evidence to case

Hi,
I have implemented nuix java based api with this i'm able to connect to licensed server then i got Utility instance so that i can able to create new case or open existed case. now i want to add evidence to existing case and need to process.

please could you help. thanks in advance

Nuix Java API Project - Switching Engine Releases at runtime

Hi Nuix-Team,

I'm currently building a Java Application that uses the Nuix JAVA API to process data. What I noticed when processing docx-files was, that the files were marked as poisoned items. I found out that this was due to the fact, that the nuix jars couldn't find the passware.dll-files. I was able to get around this issue by setting the windows system path as you describe it in the read.me for this projekt.

In the future I want to let the user decide which engine he wants to use at runtime. This isn't possible when I need to put the bin-folders from a specific engine release on the systems path. I tried a couple of other options like setting -Djava.library.path and -Djna.library.path, but the passware.dll weren't found.

Do you have any tips for me concerning this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.