# Aggregate Exception while invoking java code from UIpath

**URL:** <https://forum.uipath.com/t/aggregate-exception-while-invoking-java-code-from-uipath/167477>\
**Category:** Help\
**Tags:** java, error, activities\
**Created:** [November 13, 2019, 5:15am UTC](https://forum.uipath.com/t/aggregate-exception-while-invoking-java-code-from-uipath/167477 "2019-11-13T05:15:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siddu](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/siddu/32/96934_2.png) [@Siddu](https://forum.uipath.com/u/Siddu)\
**Post date:** [November 13, 2019, 5:15am UTC](https://forum.uipath.com/t/aggregate-exception-while-invoking-java-code-from-uipath/167477/1 "2019-11-13T05:15:22Z")

</div>

Hi All, I m getting a System.AggregateException, when I try to invoke java code from UiPath. An error always pointed to Invoke Java method, the path of the jar file and method name are proper. please suggest me some solutions for this. I have attached the Exception screenshot for your reference.

 ![AggregateException](https://global.discourse-cdn.com/uipath/original/3X/8/8/889d0d1908c9f8d2c7fbdad9d879cc23866c56b7.png)

---

<div class="post-metadata">

**Author:** ![mr.wolf](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@mr.wolf](https://forum.uipath.com/u/mr.wolf)\
**Post date:** [February 4, 2020, 5:18pm UTC](https://forum.uipath.com/t/aggregate-exception-while-invoking-java-code-from-uipath/167477/2 "2020-02-04T17:18:28Z")

</div>

Hi, I got the same error. The exception details are:

> RemoteException wrapping System.AggregateException: One or more errors occurred. —\> RemoteException wrapping System.InvalidOperationException: The method could not be invoked. —\> RemoteException wrapping System.InvalidOperationException: The result from java could not be deserialized. —\> RemoteException wrapping System.ArgumentNullException: String reference not set to an instance of a String.  
> Parameter name: s  
> at System.Text.Encoding.GetBytes(String s)  
> at UiPath.Java.Service.JavaResponse.Deserialize(String json)  
> Did you found a way to solve the problem?

---

<div class="post-metadata">

**Author:** ![Ayad\_LABIAD](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Ayad\_LABIAD](https://forum.uipath.com/u/Ayad_LABIAD)\
**Post date:** [July 6, 2020, 3:55pm UTC](https://forum.uipath.com/t/aggregate-exception-while-invoking-java-code-from-uipath/167477/3 "2020-07-06T15:55:41Z")

</div>

Hello everybody,

I have the same issue. Have you found a fix to this error ?

Regards

---

<div class="post-metadata">

**Author:** ![gurucharansimha5](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gurucharansimha5/32/177168_2.png) [@gurucharansimha5](https://forum.uipath.com/u/gurucharansimha5)\
**Post date:** [November 2, 2020, 11:35am UTC](https://forum.uipath.com/t/aggregate-exception-while-invoking-java-code-from-uipath/167477/4 "2020-11-02T11:35:44Z")

</div>

Hi @Palaniyappan could you please help with the above issues in order to solve aggregate function issues while invoking the jar file.

---

<div class="post-metadata">

**Author:** ![gurucharansimha5](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gurucharansimha5/32/177168_2.png) [@gurucharansimha5](https://forum.uipath.com/u/gurucharansimha5)\
**Post date:** [November 2, 2020, 11:53am UTC](https://forum.uipath.com/t/aggregate-exception-while-invoking-java-code-from-uipath/167477/5 "2020-11-02T11:53:29Z")

</div>

Hi for me this issue is resolved, i gave wrong path in the Load jar activity.  
Now i gave only the path of the jar, previously i passed the parameter also.  
@Palaniyappan Thank you.

---

<div class="post-metadata">

**Author:** ![Palaniyappan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/palaniyappan/32/524095_2.png) [@Palaniyappan](https://forum.uipath.com/u/Palaniyappan)\
**Post date:** [November 2, 2020, 2:15pm UTC](https://forum.uipath.com/t/aggregate-exception-while-invoking-java-code-from-uipath/167477/6 "2020-11-02T14:15:44Z")

</div>

Perfect  
Welcome to uipath community 🙌🏻  
@gurucharansimha5
