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

Java Scope: Error intializing Java : System.NullReferenceException: Object reference not set to an instance of an object. #51

Open
wixdonkey opened this issue Jul 22, 2019 · 2 comments

Comments

@wixdonkey
Copy link

wixdonkey commented Jul 22, 2019

Describe the bug

Java Scope: Error intializing Java : System.NullReferenceException: Object reference not set to an instance of an object.

To Reproduce
Steps to reproduce the behavior:

  1. Download the java example from https://activities.uipath.com/docs/running-static-and-object-methods
  2. Open the example without any change by UiPath Studio Community Edition.
  3. Press 'Run' button, then raise the error as follow:
    ======================================================
    19.7.0+Branch.master.Sha.8c253d13718eed5c7db27daef6facd1fe1b0d067

Source: Java Scope

Message: Error intializing Java : System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.Java.Service.JavaService.b__7_2(IAsyncResult ar)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Java.Service.JavaService.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Java.JavaInvoker.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Java.Activities.JavaScope.d__12.MoveNext()

Exception Type: System.InvalidOperationException

RemoteException wrapping System.InvalidOperationException: Error intializing Java : System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.Java.Service.JavaService.b__7_2(IAsyncResult ar)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Java.Service.JavaService.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Java.JavaInvoker.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Java.Activities.JavaScope.d__12.MoveNext()
at UiPath.Shared.Activities.AsyncTaskNativeImplementation.BookmarkResumptionCallback(NativeActivityContext context, Object value)
at UiPath.Shared.Activities.AsyncTaskNativeActivity.BookmarkResumptionCallback(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkCallbackWrapper.Invoke(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Expected behavior
Could popup the messagebox as the expectation.

Screenshots
1
2

Desktop (please complete the following information):

  • OS: Windows 10 pro 64-bit
  • UiPath.Java.Activities 1.0.7053.27728
  • 2019.7.0 - 7/16/2019 Community Edition
  • java version "1.8.0_162"
    Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
    Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)

Additional context
Download the example from below:
https://activities.uipath.com/docs/running-static-and-object-methods

@cosmyo
Copy link
Contributor

cosmyo commented Aug 5, 2019

Hi @wixdonkey I will take a look.
Meanwhile, have you tried setting Java Library Path in Java Scope to point to java.exe on your computer ?

@wixdonkey
Copy link
Author

wixdonkey commented Aug 12, 2019

Hi @cosmyo,
Thank for your help in advance!

I already set the Java Library Path. But even if I do nothing but just initialize the java scope, there's always an initial error.
The below are some details, hope it will help.

Here is my java home env:
image

Here is my scenario:

  1. Only drag the 'Java Scope' to the stage.
  2. Set the 'Java Library Path'.
    image
  3. Press F5
    A moment later the error would be raised.
    image

From my perspective, I think it's not about the Java Library Path. Since if I don't set the path, Java Libarary will get the path from ENV PATH.

The java scope activity guide wrote:
Java Library Path - The path to the Java Library Executable java.exe file. If no path is supplied in this property, the Java Library will be loaded from the PATH environment variable. This field supports only strings and String variables.
https://docs.uipath.com/activities/docs/java-scope

alcxs added a commit to twsoftr/Community.Activities that referenced this issue Nov 17, 2020
adrian-zanescu pushed a commit that referenced this issue Dec 8, 2020
* Fix for issue #51

* Update on fix for Issue 51

* Added tests for Java Invoker timeout

* Fix for issue #31 on empty array

* fix for #31 for null parameters

* fix issue with comparison of parameter types

* implemented typed null solution for #31

* small fix for array indexing #31

* TestCases for issues #30 and #31

* Unit Tests of Generic Methods for issues #30 and #31

* merged

* TestProgram.jar refactor

* Removed unused

* updated

* Changes

* changes

* done

* Suppressions

* Bug fixes

* Fixed comments

* recompiled JAR file

Co-authored-by: alcxs <[email protected]>
Co-authored-by: petcua1 <[email protected]>
Co-authored-by: Vlad Nicula <[email protected]>
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

2 participants