Skip to Main Content

Programming Languages & Frameworks

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why a java script works fine in rhino engine in java1.6, but not in nashorn script engine in java1.8

Solomon MohantyJul 12 2016 — edited Jul 12 2016

A java script to load java classes from a http server by a custom class loader works fine in jre1.6 with rhino engine. But same script doesn't

work in nashorn engine in jre1.8. Exception thrown is

java.security.AccessControlException: access denied ("java.net.SocketPermission" "172.16.48.100:8443" "connect,resolve"

I tried using below URL to give all permission for java and script code to have all permissions.

https://wiki.openjdk.java.net/display/Nashorn/Nashorn+script+security+permissions

Code is similar to below lines:

"var tmp = UcmdbServiceFactory.initSSL();" +

  "var serviceProvider = UcmdbServiceFactory.getServiceProvider(\"https\",\"172.16.48.100\",8443); " +

  "var clientContext = serviceProvider.createClientContext(\"UCSD\"); " ;

     ScriptEngineManager m = new ScriptEngineManager();

      ScriptEngine engine = m.getEngineByName("nashorn");

  File file = new File(args[0]);

        try {

        //engine.eval(com.cloupia.fw.scripting.Constants.JS_RHINO_COMPAT_SCRIPT);

        URI uri = file.toURI();

        URL url = uri.toURL();

        engine.eval(new URLReader(url));

If anybody has any experience with network class loaders using nashorn script engine, help here.

Comments

Peter Gjelstrup
Answer
1. What is the difference between the below 2 index usage scenarios:
/*+ index(a index_name) parallel(a,4)*/
/*+ parallel_index(a,index_name,4)*/
Are both these same?
No,
First are two hints, one to use index and one to instruct the optimizer to use 4 concurrent servers for a parallel operation

The second is just one hint. it tells optimizer to use 4 concurrent servers on partitioned indexes.
2. What is full index scan and fast full index scan?
Full index scan do single block reads.
Fast full scan do multi block reads.

3. I have a table created in database and it has a few indexes on some columns. How can I check whether the index is Bitmap or B-Tree ?
In user_|all_dba_indexes. Index_type will be BITMAP or NORMAL

Regards
Peter


P.S: Speaking of hints. Bookmark this, can answer most of such questions much better than I can:
http://www.oracle.com/pls/db112/homepage

Edited by: Peter on Mar 26, 2013 1:47 PM
Marked as Answer by AB312062 · Sep 27 2020
AB312062
Thanks Peter !

Can you tell more about the difference in using index and parallel_index. I din't fully understand. If you could explain with some example or provide some link where I can find more information, that would be helpful.

Regards
AB
1 - 2

Post Details

Added on Jul 12 2016
0 comments
1,509 views