473,508 Members | 4,179 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling a DLL from a Java Applet

Hi,

I know this question has prob. been asked a million times, but I couldn't
find it in the FAQ, so here goes :

I'm trying to write a Java applet to call a dll that resides on the web
server (running IIS 6). I've written a little test applet that should call a
helloWorld function in the dll, but when I use System.loadLibrary, it gives
me this security warning :

java.security.AccessControlException : access denied
(java.lang.RuntimePermission loadLibrary.myLib)

I've read that it's not possible to run a dll on a client computer (except
perhaps by signing it?), but I can't find much information about dll's on a
web server. If anyone could give me any pointers, I'd really appreciate it
:-)

Thanks,

Rowland.
Jul 17 '05 #1
5 13633
Rowland wrote:
Hi,

I know this question has prob. been asked a million times, but I couldn't
find it in the FAQ, so here goes :

I'm trying to write a Java applet to call a dll that resides on the web
server (running IIS 6). I've written a little test applet that should call a
helloWorld function in the dll, but when I use System.loadLibrary, it gives
me this security warning :

java.security.AccessControlException : access denied
(java.lang.RuntimePermission loadLibrary.myLib)

I've read that it's not possible to run a dll on a client computer (except
perhaps by signing it?), but I can't find much information about dll's on a
web server. If anyone could give me any pointers, I'd really appreciate it
:-)


The applet runs on the client. If the applet spawns code, be it from a
jar, a dll or whatever, the code runs on the client. Therefore it would
be a security issue to allow the applet to execute code from a dll no
matter where the dll came from.

Now, did you want the dll code to be executed on the client or the
server? If you want the client, you'll have to sign the applet and I
would expect things to get messy. If you want the code to execute on
the server, then you need to write some sort of server program (servlet,
web service, simple socket-based server, etc.) to execute the code.
Then make the applet a client of that server.

Ray

--
XML is the programmer's duct tape.
Jul 17 '05 #2
Have you tried to sign your applet ??? It solved the problem for me
when I tried exchanging SOAP data over SSL..... and even using an XML
parser requested my applet to be signed. It MAY solve your problem.
Let me know if it did!

Quiks
--------------
BTW: For those who have to do with monitoring, check the site:
http://www.metamindsolutions.com. It's a great multiplatform
monitoring solution and seems to have been adopted by large accounts
"Rowland" <ba*****@hotmail.com> wrote in message news:<cg*********@hercules.btinternet.com>...
Hi,

I know this question has prob. been asked a million times, but I couldn't
find it in the FAQ, so here goes :

I'm trying to write a Java applet to call a dll that resides on the web
server (running IIS 6). I've written a little test applet that should call a
helloWorld function in the dll, but when I use System.loadLibrary, it gives
me this security warning :

java.security.AccessControlException : access denied
(java.lang.RuntimePermission loadLibrary.myLib)

I've read that it's not possible to run a dll on a client computer (except
perhaps by signing it?), but I can't find much information about dll's on a
web server. If anyone could give me any pointers, I'd really appreciate it
:-)

Thanks,

Rowland.

Jul 17 '05 #3
"Raymond DeCampo" <rd******@spam.twcny.spam.rr.spam.com.spam> wrote in
message news:NW*******************@twister.nyroc.rr.com...
Rowland wrote:
Hi,

I know this question has prob. been asked a million times, but I couldn't find it in the FAQ, so here goes :

I'm trying to write a Java applet to call a dll that resides on the web
server (running IIS 6). I've written a little test applet that should call a helloWorld function in the dll, but when I use System.loadLibrary, it gives me this security warning :

java.security.AccessControlException : access denied
(java.lang.RuntimePermission loadLibrary.myLib)

I've read that it's not possible to run a dll on a client computer (except perhaps by signing it?), but I can't find much information about dll's on a web server. If anyone could give me any pointers, I'd really appreciate it :-)


The applet runs on the client. If the applet spawns code, be it from a
jar, a dll or whatever, the code runs on the client. Therefore it would
be a security issue to allow the applet to execute code from a dll no
matter where the dll came from.

Now, did you want the dll code to be executed on the client or the
server? If you want the client, you'll have to sign the applet and I
would expect things to get messy. If you want the code to execute on
the server, then you need to write some sort of server program (servlet,
web service, simple socket-based server, etc.) to execute the code.
Then make the applet a client of that server.

Ray

--
XML is the programmer's duct tape.


Thanks very much for you response - I'll explain the problem and you might
be able to guide me in the right direction :-).

Basically, I'm writing an administration program for a database. I've
already written the program in VB, but our client wants to convert it so
that it will be deployed from their web-server. For this reason it was
decided to investigate Java. However, to save time (and for other reasoons),
I was hoping to be able to use an existing DLL within the Java program. I've
done this with a Java application before, but I've very little experience
with applets, servlets, etc. The dll will be executing code to talk to a
database, so it would prob. be best to have it server side for security.

So my question is this : What would be the best way to solve this problem.
Can I have a client applet written using the AWT talking to a server servlet
using my dll? Are there other, better options?

Many thanks,

Rowland.
Jul 17 '05 #4
"Rowland" <ba*****@hotmail.com> wrote in message
news:ch**********@sparta.btinternet.com...
"Raymond DeCampo" <rd******@spam.twcny.spam.rr.spam.com.spam> wrote in
message news:NW*******************@twister.nyroc.rr.com...
Rowland wrote:
Hi,

I know this question has prob. been asked a million times, but I couldn't find it in the FAQ, so here goes :

I'm trying to write a Java applet to call a dll that resides on the web server (running IIS 6). I've written a little test applet that should call a helloWorld function in the dll, but when I use System.loadLibrary, it gives me this security warning :

java.security.AccessControlException : access denied
(java.lang.RuntimePermission loadLibrary.myLib)

I've read that it's not possible to run a dll on a client computer (except perhaps by signing it?), but I can't find much information about dll's on a web server. If anyone could give me any pointers, I'd really
appreciate
it :-)

The applet runs on the client. If the applet spawns code, be it from a
jar, a dll or whatever, the code runs on the client. Therefore it would
be a security issue to allow the applet to execute code from a dll no
matter where the dll came from.

Now, did you want the dll code to be executed on the client or the
server? If you want the client, you'll have to sign the applet and I
would expect things to get messy. If you want the code to execute on
the server, then you need to write some sort of server program (servlet,
web service, simple socket-based server, etc.) to execute the code.
Then make the applet a client of that server.

Ray

--
XML is the programmer's duct tape.


Thanks very much for you response - I'll explain the problem and you might
be able to guide me in the right direction :-).

Basically, I'm writing an administration program for a database. I've
already written the program in VB, but our client wants to convert it so
that it will be deployed from their web-server. For this reason it was
decided to investigate Java. However, to save time (and for other

reasoons), I was hoping to be able to use an existing DLL within the Java program. I've done this with a Java application before, but I've very little experience
with applets, servlets, etc. The dll will be executing code to talk to a
database, so it would prob. be best to have it server side for security.

So my question is this : What would be the best way to solve this problem.
Can I have a client applet written using the AWT talking to a server servlet using my dll? Are there other, better options?

Many thanks,

Rowland.

Scratch that - I think I've found the way that will work best for me. I have
a client applet as before, but I also have a server listening on port nnn
for commands from this client. The client creates a socket connection to the
server (which would have to be the same server as the client class files are
located on due to applet security restrictions) which 'does stuff' based on
what commands are passed to it.

I found a good tutorial on how to set up the basics here:
http://www.javaworld.com/javaworld/j...ockets-p2.html

If this idea won't work, I'd be grateful if someone points it out to me
before I get too far into developing it ;-)

Thanks,

Rowland.

Jul 17 '05 #5
Rowland wrote:
"Rowland" <ba*****@hotmail.com> wrote in message
news:ch**********@sparta.btinternet.com...

Thanks very much for you response - I'll explain the problem and you might
be able to guide me in the right direction :-).

Basically, I'm writing an administration program for a database. I've
already written the program in VB, but our client wants to convert it so
that it will be deployed from their web-server. For this reason it was
decided to investigate Java. However, to save time (and for other


reasoons),
I was hoping to be able to use an existing DLL within the Java program.


I've
done this with a Java application before, but I've very little experience
with applets, servlets, etc. The dll will be executing code to talk to a
database, so it would prob. be best to have it server side for security.

So my question is this : What would be the best way to solve this problem.
Can I have a client applet written using the AWT talking to a server


servlet
using my dll? Are there other, better options?

Many thanks,

Rowland.


Scratch that - I think I've found the way that will work best for me. I have
a client applet as before, but I also have a server listening on port nnn
for commands from this client. The client creates a socket connection to the
server (which would have to be the same server as the client class files are
located on due to applet security restrictions) which 'does stuff' based on
what commands are passed to it.

I found a good tutorial on how to set up the basics here:
http://www.javaworld.com/javaworld/j...ockets-p2.html

If this idea won't work, I'd be grateful if someone points it out to me
before I get too far into developing it ;-)

Thanks,

Rowland.


Rowland,

That should work fine; I think it is the best option if you are locked
into a Java front-end. You may also want to consider an ActiveX plug-in
for IE, it should be able to execute code from a DLL.

HTH,
Ray

--
XML is the programmer's duct tape.
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
9857
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
2
6886
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on...
1
1823
by: SPG | last post by:
Hi, We have an applet that has to support the SUN VMs as well as the MS VM. The applet receives updates from a server (via tcp or http) and wraps them up as objects and passes them using the...
2
9514
by: Blondie21 | last post by:
Hi, I have a .jsp file in the following format: .... html headers, jsp code, html code... <jsp:plugin type="applet" code="path.in.packet.appletclassname.class" codebase=".."...
2
9739
by: Neil Cherry | last post by:
I've done a fair amount of searching on this subject and I can call my Java methods with Javascript if I use the <applet></applet> tags but when I switch over to <object></object> tags I'm not...
2
7349
by: MarkMurphy | last post by:
Is there a limitation in ASP.NET in this regard? From the aspx code below, I can successfully call a Java applet. If I try the identical thing in a user control ascx however, the control loads...
5
3523
by: verteidi | last post by:
Hello everyone, I have been searching this forum for a solution to my problem, but unfortunately couldn't find anything so far. It would be very kind if you could take a look at this. I am trying...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.