Skip to Main Content

New to Java

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Loading same dll more than once in a Java JVM

Arun SanbhatAug 23 2018 — edited Aug 24 2018

Hi,

We are currently using Java JRE 1.8 u 131 on WINDOWS. We have a java standalone desktop application that loads a C dll for processing of data.This it does by loading the dll using System.LoadLibrary("Name of the dll") function call.

Currently the Java application is single threaded and is processing the data using JNI functions written in C classes inside the dll.

Due to increase in the data by many folds, we would want to make the java application multi-threaded. The C side code does not support multi-threading and cannot be changed due to legacy issues. So we plan to use Java multithreading feature and load the same dll in each thread.

Each thread should process the data separately. However I am not sure if this will work. Can someone please inform me if a dll when loaded by any one of the Java threads, can other thread also be able to load it again? Will the dll would be loaded in a single memory space in the JVM or can each dll will be allocated a separate memory that can be only be accessed by the thread that has loaded it?

Comments

Naveent_2785

The below is working:

use JSON.parse() on the string and stored the output in a JSON object. Send the JSON object as a request to the REST reference

mateo91

Thanks! This helps!

Demetrius Brackens

Was javascript used to implement this solution? Do you have an example? Thanks.

mateo91

You must use the Javascript component after your transform component. Then you just add the JSON.parse() call on your JSON Object variable used in the Transform (e.g. JSON.parse(<jsonObjectVariable>);)
I ended up not even needing my Transform Component since I was receiving JSON in my request. Then I just used my Javascript component to parse what I needed in the receive payload before sending it off to the external destination.

Demetrius Brackens

Thanks for your help. This is working for me now.

Hi, I am having the same parsing issue. Can you show me example of JSON.parse(<jsonObjectVariable>);

mateo91

@User_489HG - Did you get this resolved? Let me know and I can provide an example. You can do this with both a JavaScript component and an Assign Component.

Maruthi Gottumukkala

Can you please provide me examples.

Maruthi Gottumukkala

Finally I figured it out. Appreciated for the tip. Thank you so much guys.

User_FRYTH

I am having the same issue kind of issue, in OSB 12c, when using xslt and nXSDTraslate, it shows output in binary format,
Then I have used commons-codec-1.7.jar to extract the string from binary format.
Now my rest api is not accepting the request, so I need to covert it from string to json then send it to REST api.
mateo91/User_489HG , Can you please share some example, how to do that.

1552110

After you Convert your XML to String using Translate activity, Add a JavaScript activity and add $JsonInput = JSON.parse($jsonInputString) to the Code snippet to convert the String to JSON object. In the example here $JsonInput vairiable is a JSON object input for my REST service call. Hope this helps.

User_FYU9P

Thanks for help. It is working

1 - 12
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 21 2018
Added on Aug 23 2018
3 comments
3,693 views