472,353 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 13524
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
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...
2
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...
1
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...
2
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"...
2
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...
2
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...
5
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...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

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.