# System.AggregateException while invoking java code from Uipath

**URL:** <https://forum.uipath.com/t/system-aggregateexception-while-invoking-java-code-from-uipath/167506>\
**Category:** Help\
**Tags:** java, error, activities\
**Created:** [November 13, 2019, 6:54am UTC](https://forum.uipath.com/t/system-aggregateexception-while-invoking-java-code-from-uipath/167506 "2019-11-13T06:54:52Z")\
**Posts on this page:** 8\
**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, 6:54am UTC](https://forum.uipath.com/t/system-aggregateexception-while-invoking-java-code-from-uipath/167506/1 "2019-11-13T06:54:52Z")

</div>

Hi All, I am getting System.aggregateException while invoking java code from Uipath, the error always pointed to Invoke java code activity, path and method name are proper. I tried it many ways but every time I end up with an exception so kindly give me the solution, I have

 ![AggregateException](https://global.discourse-cdn.com/uipath/original/3X/8/8/889d0d1908c9f8d2c7fbdad9d879cc23866c56b7.png) attached the screenshot of exception, thank you in advance.

---

<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 13, 2019, 8:33am UTC](https://forum.uipath.com/t/system-aggregateexception-while-invoking-java-code-from-uipath/167506/2 "2019-11-13T08:33:26Z")

</div>

Kindly check once with the code getting executed or not in a shell  
And if still that does help here then recreate the activity on deleting this and try once  
Ensure that all parameter is provided to the code and the activity as well

Cheers @Siddu

---

<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 14, 2019, 4:50am UTC](https://forum.uipath.com/t/system-aggregateexception-while-invoking-java-code-from-uipath/167506/3 "2019-11-14T04:50:31Z")

</div>

@Palaniyappan  
Environment variables are not set properly so i was getting exception, now the java code without error executing from shell, but this time i am getting different exception when ran java code from uipath. i am not providing any parameters here, directly calling “main” method. The exception is like Invalid operation(“Constructor Could not be called”). What could be the issue?

---

<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:** [January 6, 2020, 5:32am UTC](https://forum.uipath.com/t/system-aggregateexception-while-invoking-java-code-from-uipath/167506/4 "2020-01-06T05:32:44Z")

</div>

@Palaniyappan Any updates on this?

---

<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:** [January 6, 2020, 5:59am UTC](https://forum.uipath.com/t/system-aggregateexception-while-invoking-java-code-from-uipath/167506/5 "2020-01-06T05:59:19Z")

</div>

> [@Siddu](#):
>
> Invalid operation(“Constructor Could not be called”).

This look like an Error along the code while creating a constructor

Cheers @Siddu

---

<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:** [January 6, 2020, 6:03am UTC](https://forum.uipath.com/t/system-aggregateexception-while-invoking-java-code-from-uipath/167506/6 "2020-01-06T06:03:53Z")

</div>

Hi @Palaniyappan In my java code i am not using any constructor, simply i am adding two integers and sending output to uipath under main method. i am calling main method from uipath.

Thanks

---

<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:** [January 6, 2020, 6:06am UTC](https://forum.uipath.com/t/system-aggregateexception-while-invoking-java-code-from-uipath/167506/7 "2020-01-06T06:06:44Z")

</div>

> [@Palaniyappan](#):
>
> Constructor Could not be called

Hi @loginerror kindly help us on this  
@Siddu

---

<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:** [January 6, 2020, 10:03am UTC](https://forum.uipath.com/t/system-aggregateexception-while-invoking-java-code-from-uipath/167506/8 "2020-01-06T10:03:43Z")

</div>

Hi @Siddu

Could you Copy to Clipboard and paste here the full error message?

Bonus points for a sample project that reproduces the issue 🙂
