<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to circumvent Py4JSecurityException for spark-nlp : Constructor public com.johnsnowlabs.nlp.***(java.lang.String) is not whitelisted. in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/how-to-circumvent-py4jsecurityexception-for-spark-nlp/m-p/27646#M1573</link>
    <description>&lt;P&gt;Hi @Vidula Khanna​&amp;nbsp;, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know more about the solution to the suggested solution to the above problem. I have upgraded my cluster to 11.3 LTS (unity catalog enabled ) and shared cluster mode. But one of the java functions I am using gives the whitelisting error. Could you please suggest a possible solution while still keeping the shared cluster access mode?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2023 17:42:55 GMT</pubDate>
    <dc:creator>Apoorv</dc:creator>
    <dc:date>2023-01-25T17:42:55Z</dc:date>
    <item>
      <title>How to circumvent Py4JSecurityException for spark-nlp : Constructor public com.johnsnowlabs.nlp.***(java.lang.String) is not whitelisted.</title>
      <link>https://community.databricks.com/t5/machine-learning/how-to-circumvent-py4jsecurityexception-for-spark-nlp/m-p/27643#M1570</link>
      <description>&lt;P&gt;Running into the following error on our company's cluster. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;py4j.security.Py4JSecurityException: Constructor public com.johnsnowlabs.nlp.DocumentAssembler(java.lang.String) is not whitelisted.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For the following code(which is just tutorial code from the spark-nlp page) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;df = spark.createDataFrame([("Yeah, I get that. is the",)], ["comment"])
document_assembler = DocumentAssembler() \
    .setInputCol("comment") \
    .setOutputCol("document")
    
sentence_detector = SentenceDetector() \
    .setInputCols(["document"]) \
    .setOutputCol("sentence") \
    .setUseAbbreviations(True)
    
tokenizer = Tokenizer() \
  .setInputCols(["sentence"]) \
  .setOutputCol("token")
stemmer = Stemmer() \
    .setInputCols(["token"]) \
    .setOutputCol("stem")
    
normalizer = Normalizer() \
    .setInputCols(["stem"]) \
    .setOutputCol("normalized")
&amp;nbsp;
finisher = Finisher() \
    .setInputCols(["normalized"]) \
    .setOutputCols(["ntokens"]) \
    .setOutputAsArray(True) \
    .setCleanAnnotations(True)
&amp;nbsp;
nlp_pipeline = Pipeline(stages=[document_assembler, sentence_detector, tokenizer, stemmer, normalizer, finisher])
&amp;nbsp;
nlp_model = nlp_pipeline.fit(df)
processed = nlp_model.transform(df).persist()
&amp;nbsp;
processed.count()
processed.show()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I tried adding this to the spark config&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; spark.databricks.pyspark.enablePy4JSecurity false
&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It says &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; spark.databricks.pyspark.enablePy4JSecurity is not allowed when choosing access mode
&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate any help. It seems others at my company have run into the same issue with other packages. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 22:21:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/how-to-circumvent-py4jsecurityexception-for-spark-nlp/m-p/27643#M1570</guid>
      <dc:creator>KenAN</dc:creator>
      <dc:date>2022-10-12T22:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to circumvent Py4JSecurityException for spark-nlp : Constructor public com.johnsnowlabs.nlp.***(java.lang.String) is not whitelisted.</title>
      <link>https://community.databricks.com/t5/machine-learning/how-to-circumvent-py4jsecurityexception-for-spark-nlp/m-p/27644#M1571</link>
      <description>&lt;P&gt;That error is prevalent in high concurrency / shared clusters. Please test it on a single user / standard standalone cluster.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 10:56:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/how-to-circumvent-py4jsecurityexception-for-spark-nlp/m-p/27644#M1571</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-10-18T10:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to circumvent Py4JSecurityException for spark-nlp : Constructor public com.johnsnowlabs.nlp.***(java.lang.String) is not whitelisted.</title>
      <link>https://community.databricks.com/t5/machine-learning/how-to-circumvent-py4jsecurityexception-for-spark-nlp/m-p/27645#M1572</link>
      <description>&lt;P&gt;Hi @Kenan Spruill​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or &lt;B&gt;mark an answer as best&lt;/B&gt;? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Nov 2022 12:50:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/how-to-circumvent-py4jsecurityexception-for-spark-nlp/m-p/27645#M1572</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-27T12:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to circumvent Py4JSecurityException for spark-nlp : Constructor public com.johnsnowlabs.nlp.***(java.lang.String) is not whitelisted.</title>
      <link>https://community.databricks.com/t5/machine-learning/how-to-circumvent-py4jsecurityexception-for-spark-nlp/m-p/27646#M1573</link>
      <description>&lt;P&gt;Hi @Vidula Khanna​&amp;nbsp;, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know more about the solution to the suggested solution to the above problem. I have upgraded my cluster to 11.3 LTS (unity catalog enabled ) and shared cluster mode. But one of the java functions I am using gives the whitelisting error. Could you please suggest a possible solution while still keeping the shared cluster access mode?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 17:42:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/how-to-circumvent-py4jsecurityexception-for-spark-nlp/m-p/27646#M1573</guid>
      <dc:creator>Apoorv</dc:creator>
      <dc:date>2023-01-25T17:42:55Z</dc:date>
    </item>
  </channel>
</rss>

