removal@javax.script what is the replacement to change | Community
Skip to main content
April 24, 2023

removal@javax.script what is the replacement to change

  • April 24, 2023
  • 2 replies
  • 1188 views

Hi AEM Folks, 

 

We are migrating the code into cloud compatible . While running the BPA in the existing instance, it is throwing the removal@javax.script issue in our code. we have implemented the sling scripting USE interface. Much appreciated if you share the replacement for javax.script

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

ManviSharma
Adobe Employee
Adobe Employee
April 24, 2023

Hi,

 

The javax.script the package provides a scripting framework in Java, and it is not recommended to use it in AEM because it can lead to security issues. Instead, Adobe recommends using the Sling Scripting APIs in AEM.

If you have implemented the Sling Scripting 'USE' interface in your code, you do not need to use the javax.script package. You can remove any references to it in your code.

April 25, 2023

@manvisharma  -Thank you for the reply.

 

But the concern here is Sling scripting using javax.script while we implement into our class we need to import javax.script.Binding for init method. Pasted the screen

 

 

nitesh_kumar-1
Adobe Employee
Adobe Employee
April 25, 2023

Hi @senthilkumarselvam ,

 

This seems to be a false positive and related to a bug with BPA in the past. This should have been fixed in this version Best Practices Analyzer 2.1.40

Can you check if you are using this version?

https://experience.adobe.com/#/downloads/content/software-distribution/en/aemcloud.html?package=/content/software-distribution/en/details.html/content/dam/aemcloud/public/best-practices-analyzer/best-practices-analyzer.all-2.1.40.zip 

 

If the issue still exists, kindly open a support ticket.

 

Hope this helps!

 

Regards,

Nitesh