# Create Java Object throws an error - System.InvalidOperationException: Constructor could not be called

**URL:** <https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384>\
**Category:** Activities\
**Tags:** considering, java, error, activities\
**Created:** [June 16, 2021, 1:14pm UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384 "2021-06-16T13:14:01Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![appswiz](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/appswiz/32/176789_2.png) [@appswiz](https://forum.uipath.com/u/appswiz)\
**Post date:** [June 16, 2021, 1:14pm UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/1 "2021-06-16T13:14:01Z")

</div>

Hi  
I have similar error after I followed the Run Object method example :

RemoteException wrapping System.AggregateException: One or more errors occurred. —\> RemoteException wrapping System.InvalidOperationException: Constructor could not be called. —\> RemoteException wrapping System.InvalidOperationException: The target type was not found.

at UiPath.Java.Service.JavaResponse.ThrowExceptionIfNeeded()  
at UiPath.Java.JavaInvoker.d\_\_17.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\_\_15.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.CreateJavaObject.d\_\_8.MoveNext()  
— End of inner exception stack trace —  
at UiPath.Java.Activities.CreateJavaObject.d\_\_8.MoveNext()  
— End of inner exception stack trace —  
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)  
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)  
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

I’m using a jar file that I got for the purpose of integrating with Isabel Connect : [https://search.maven.org/artifact/com.ibanity.apis/ibanity-java/4.0.20210603141151/jar](https://search.maven.org/artifact/com.ibanity.apis/ibanity-java/4.0.20210603141151/jar)

I created the java object based on the :“com.ibanity.apis.client.http.service.impl.IbanityHttpSignatureServiceImpl” (Target Type) and with a string (UiPath) parameter that need to sent to the method as a java variable that is an Object (java.io.InputStream) .  
the Method invoked is : “getDigestHeader”  
Is this problem, mentioned above resolved ?

---

<div class="post-metadata">

**Author:** ![loginerror](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/loginerror/32/22614_2.png) [@loginerror](https://forum.uipath.com/u/loginerror)\
**Post date:** [June 17, 2021, 2:34pm UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/2 "2021-06-17T14:34:56Z")

</div>

Hi @appswiz

Welcome to our UiPath Forum! 🙂

Would you mind reproducing this issue on the newly created a project with dummy data and attaching it here?

---

<div class="post-metadata">

**Author:** ![appswiz](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/appswiz/32/176789_2.png) [@appswiz](https://forum.uipath.com/u/appswiz)\
**Post date:** [June 23, 2021, 10:25am UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/3 "2021-06-23T10:25:55Z")

</div>

Here it is  
[BulkPayReq - hs2019 java.xaml](https://forum.uipath.com/uploads/short-url/HeiUBEru6wRCJ2CJSj6OGgWL2E.xaml) (36.8 KB)

---

<div class="post-metadata">

**Author:** ![loginerror](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/loginerror/32/22614_2.png) [@loginerror](https://forum.uipath.com/u/loginerror)\
**Post date:** [June 25, 2021, 8:49am UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/4 "2021-06-25T08:49:39Z")

</div>

Could you still attach the project.json file? Mainly the version of the Java package you are using.

---

<div class="post-metadata">

**Author:** ![appswiz](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/appswiz/32/176789_2.png) [@appswiz](https://forum.uipath.com/u/appswiz)\
**Post date:** [June 25, 2021, 9:52am UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/5 "2021-06-25T09:52:04Z")

</div>

This is the Jar file  
[ibanity-java-master.zip](https://forum.uipath.com/uploads/short-url/xDiYGcu52gLtbpj9sN6JG7BCr6x.zip) (387.3 KB)

---

<div class="post-metadata">

**Author:** ![loginerror](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/loginerror/32/22614_2.png) [@loginerror](https://forum.uipath.com/u/loginerror)\
**Post date:** [June 25, 2021, 10:58am UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/7 "2021-06-25T10:58:20Z")

</div>

Thank you. I’ve registered this as a bug for our team to investigate.

---

<div class="post-metadata">

**Author:** ![appswiz](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/appswiz/32/176789_2.png) [@appswiz](https://forum.uipath.com/u/appswiz)\
**Post date:** [June 25, 2021, 9:49am UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/8 "2021-06-25T09:49:29Z")

</div>

[project.json](https://forum.uipath.com/uploads/short-url/zqefEizEbrdAhur10iGSBcJlDNt.json) (1.9 KB)

---

<div class="post-metadata">

**Author:** ![vlad.nicula](https://avatars.discourse-cdn.com/v4/letter/v/3ec8ea/32.png) [@vlad.nicula](https://forum.uipath.com/u/vlad.nicula)\
**Post date:** [June 29, 2021, 6:38am UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/9 "2021-06-29T06:38:02Z")

</div>

Hello, I have downloaded the files above and reproduced the issue.  
This is a user error and not a bug due to the fact that within the java scope there is no **.JAR** loaded. This means that the “Create Java Object” will try to invoke the target type from nothing at this point.  
There is indeed an archive in the project folder but this is not sufficient and therefore the “Create Java Object” will throw the “Constructor could not be called” error.

---

<div class="post-metadata">

**Author:** ![appswiz](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/appswiz/32/176789_2.png) [@appswiz](https://forum.uipath.com/u/appswiz)\
**Post date:** [June 29, 2021, 7:40am UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/10 "2021-06-29T07:40:54Z")

</div>

Dear  
Thanks for the help and support  
I had done the change and added the Load jar (with the path of the jar ) into the Java scope but still getting an error ☹ - No such method exception  
Attached is the log file and also I added the jar file + the xaml file and the jar file  
[BulkPayReq - hs2019 java.xaml](https://forum.uipath.com/uploads/short-url/nZwyFs7JNMv6oJebh4lXkrDshsv.xaml) (36.8 KB)  
[Error log.txt](https://forum.uipath.com/uploads/short-url/ut8ydorf64BFCp38p18dBn6bI9N.txt) (3.1 KB)

---

<div class="post-metadata">

**Author:** ![appswiz](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/appswiz/32/176789_2.png) [@appswiz](https://forum.uipath.com/u/appswiz)\
**Post date:** [June 29, 2021, 7:45am UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/11 "2021-06-29T07:45:19Z")

</div>

I tried to load the jar file but it is not authorized, so I’m sharing it via google drive [ibanity-java-4.0.20210603141151.jar - Google Drive](https://drive.google.com/file/d/1_ofdU2Fyzr9Wi7hw0FMniqzirugH_V39/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![appswiz](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/appswiz/32/176789_2.png) [@appswiz](https://forum.uipath.com/u/appswiz)\
**Post date:** [June 29, 2021, 12:02pm UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/12 "2021-06-29T12:02:21Z")

</div>

Hi  
I also tried with another Jar but still got an error (now the load jar is there) but still error out -  
attached log and link to jar  
[Error log2.txt](https://forum.uipath.com/uploads/short-url/lx5Mq2WvBDJqq6TIPP7cPvuEo13.txt) (2.7 KB)  
[BulkPayReq - hs2019 java\_cor.xaml](https://forum.uipath.com/uploads/short-url/5shgKvqgFYZHwfPNG1CcsYDBGXq.xaml) (43.7 KB)

Link to Jar file : [signatureservice\_jar.jar - Google Drive](https://drive.google.com/file/d/1d7S1nQjVbIVMdfHEqFx_2bD6Ubx5dJFf/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![appswiz](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/appswiz/32/176789_2.png) [@appswiz](https://forum.uipath.com/u/appswiz)\
**Post date:** [July 16, 2021, 3:19pm UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/13 "2021-07-16T15:19:37Z")

</div>

Hi  
Nobody is following on my replies  
BR  
Maoz

---

<div class="post-metadata">

**Author:** ![Mahesh\_Jadhav](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/mahesh_jadhav/32/312034_2.png) [@Mahesh\_Jadhav](https://forum.uipath.com/u/Mahesh_Jadhav)\
**Post date:** [June 3, 2022, 5:25pm UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/14 "2022-06-03T17:25:27Z")

</div>

I am also facing same issue and not able to find any solution. ☹

---

<div class="post-metadata">

**Author:** ![Mahesh\_Jadhav](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/mahesh_jadhav/32/312034_2.png) [@Mahesh\_Jadhav](https://forum.uipath.com/u/Mahesh_Jadhav)\
**Post date:** [June 17, 2022, 6:09pm UTC](https://forum.uipath.com/t/create-java-object-throws-an-error-system-invalidoperationexception-constructor-could-not-be-called/325384/15 "2022-06-17T18:09:01Z")

</div>

I was able to resolve the issue. Actually I created jar file from different machine and different version of Eclipse with same source code and it started working. It could be issue with Jar file I used in Load Jar activity.
