Expand my Community achievements bar.

removal@javax.script what is the replacement to change

Avatar

Level 1

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

3 Replies

Avatar

Level 2

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.

@ManviSharma1999  -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

 

senthilkumarselvam_0-1682398742175.png

 

Avatar

Employee Advisor

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=/con... 

 

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

 

Hope this helps!

 

Regards,

Nitesh