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

843833
I'm wondering if there will be an update of the tutorial, it would be really helpful.
I got the example working, you just have to build it with ant.
Deploy it with the deployTool,leaving the deployment setting filename blanc and generate the stub by selecting the deployed application.
When running with runclient you have to specify this stub and than it seems to work fine.

Regards
843833
Looks like the structure of the J2EE ver1.3 and 1.4 is different.
Using the deploytool will ease a lot rather than using the command-line ANT. Sun people, please WHY there is no JNDI names tab in the deploytool? as well as the security option tab. Do clarify on this matter.
843833
Hi,

How do you generate the stub ??

Thx in advance,
Nicolas G.
843833
hi all,

Is their a solution to set up de platform-specific deployment file in the deploytool of j2sdkee 1.4 ??
The deployment failed at each time for the moment.

thx a lot,
Nicolas G.
843833
The JNDI tab is missing in the deploytool and i guess this should be a bug in the same. SUN do rectify it at the earliest.
843833
There is actually no bug in the 1.4 version
You have to first create the EJB jar and the Client jar etc as usual then you will have to select
{"File"|"Deployment Settings"|"Create New File"}

it will present a default file name, accept that or give an xml file name of your choice. You have just created the deployment descriptor. Now go back to the application tree and you will see a node called "Sun's J2ee Reference Implementation". This node will appear under all your existing branches. Click on this node under your EJB branch. Now you can see the JNDI name tab. Enter the JNDI name here and in your client application

It should work

Joy
843833
One tip to solve a "beginner's trouble" that I had.
Trying the sample "cmpcustomer" I didn't know precisely how to set the jndi names, the link to cloudscape and so on.

I extracted the file "sun-j2ee-ri.xml" (the one that in the previous version was used to provide deploying data) from the ear and used it to fill the information as suggested in the previous post.

It worked!
Hope to have been useful

Carlo
843833
i have been trying to fix this j2ee1.4 jndi tab problem for about 7 days now..
i was really feeling frustrated i must confess. i am going to try it out now with the hope it will work.
and if i may ask, must i always specify the client jar file first before performing these actions to get the deploy tool?

hoping to hear from you soon.
thanx
-Ebi
843833
hi folks,
i've resolved the jndi tab problem and finally deployed the ConverterApp app.
but when i try to run the ConverterClient from the command prompt, it always throws an exception like Unsupported Exception.
Can anyone tell me how to get around this.
thanx
-ebiere
843833

did you try runcleint.bat ?
843833
You said you resolved the JNDI Tab problem, could you please explain how you managed this. This is my current road-block in getting the Converter example going.

Thanks.
843833
You might want to try using J2EE Tools. It works with the examples in the J2EE Tutorial using J2EE Version 1.3.1 and the J2EE Tutorial Addendum using J2EE Version 1.4. The steps for using both are described in detail. You'll find it at

http://groups.msn.com/J2EETools
843833
Thanx for the info, it helped me out a lot !

But I dont really understand what is going on, why do you have to create {"File"|"Deployment Settings"|"Create New File"} ??

Raymond
1 - 13
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,514 views