# Using jars on pyspark (xgboost)

**URL:** <https://forum.knime.com/t/using-jars-on-pyspark-xgboost/16888>\
**Category:** KNIME Extensions\
**Tags:** big-data-extension, big-data\
**Created:** [July 18, 2019, 8:35am UTC](https://forum.knime.com/t/using-jars-on-pyspark-xgboost/16888 "2019-07-18T08:35:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mizunashi92](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/48db29/32.png) [@Mizunashi92](https://forum.knime.com/u/Mizunashi92)\
**Post date:** [July 18, 2019, 8:35am UTC](https://forum.knime.com/t/using-jars-on-pyspark-xgboost/16888/1 "2019-07-18T08:35:22Z")

</div>

Hi, I am trying to do spark xgboost using pyspark nodes.

I have my jar files on my workflow directory, and also used the export context properties to make sure it reads the jars from the said directory.

It is able to the parquet file from the same directory, but when it reads the jars, it throws an error JavaPackage object is not callable.

here is the detailed logs:  
Traceback (most recent call last):  
File “C:/Users/mizuakari/AppData/Local/Temp/pythonScript\_6b689c98\_c755\_4017\_99b1\_101c32d8a957756970461265496973.py”, line 107, in   
predictionCol=‘prediction’, eval\_metric = ‘auc’)  
File “C:\Users\mizuakari\Downloads\knime\_3.7.2.win32.win32.x86\_64\knime\_3.7.2\plugins\org.knime.bigdata.spark.local\_2.4.1.v201901281147\libs\pyspark.zip\pyspark\__init_\_.py”, line 110, in wrapper  
File “C:\Users\mizuakari\AppData\Local\Temp\knime\_localspark\_6207716683640157987\spark\_local\_dir\spark-8b04c409-cb4d-4c93-9586-2be915eab78d\userFiles-9a6dcd79-04ea-46eb-b9f0-4a55e4dcb3b2\sparkxgb.zip\sparkxgb\xgboost.py”, line 115, in **init**  
File “C:\Users\mizuakari\Downloads\knime\_3.7.2.win32.win32.x86\_64\knime\_3.7.2\plugins\org.knime.bigdata.spark.local\_2.4.1.v201901281147\libs\pyspark.zip\pyspark\ml\wrapper.py”, line 67, in \_new\_java\_obj  
TypeError: ‘JavaPackage’ object is not callable

I also attached the zip files with all the required files.

Looking forward for assistance

Best regards,  
Mizu~

[XGB.zip](https://forum-cdn.knime.com/uploads/default/original/2X/1/141b691d39afbf688c6179ae19801da5cffc5738.zip) (2.4 MB)

---

<div class="post-metadata">

**Author:** ![mareike.hoeger](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mareike.hoeger/32/1670_2.png) [@mareike.hoeger](https://forum.knime.com/u/mareike.hoeger)\
**Post date:** [July 30, 2019, 12:34pm UTC](https://forum.knime.com/t/using-jars-on-pyspark-xgboost/16888/2 "2019-07-30T12:34:45Z")

</div>

Hi @Mizunashi92  
I think the issue is, that the jars are not present in the current Spark Context. Could you try to add them in the Create Local Big Data node, using the custom spark.jars Spark Setting?

best regards Mareike

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [January 29, 2020, 12:34am UTC](https://forum.knime.com/t/using-jars-on-pyspark-xgboost/16888/3 "2020-01-29T00:34:53Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
