"Rowland" <banksr0@hotmail.com> wrote in message
news:ch1iuc$ji3$1@sparta.btinternet.com...[color=blue]
> "Raymond DeCampo" <rdecampo@spam.twcny.spam.rr.spam.com.spam> wrote in
> message news:NWPXc.48340$Kt5.16083@twister.nyroc.rr.com...[color=green]
> > Rowland wrote:[color=darkred]
> > > Hi,
> > >
> > > I know this question has prob. been asked a million times, but I[/color][/color]
> couldn't[color=green][color=darkred]
> > > find it in the FAQ, so here goes :
> > >
> > > I'm trying to write a Java applet to call a dll that resides on the[/color][/color][/color]
web[color=blue][color=green][color=darkred]
> > > server (running IIS 6). I've written a little test applet that should[/color][/color]
> call a[color=green][color=darkred]
> > > helloWorld function in the dll, but when I use System.loadLibrary, it[/color][/color]
> gives[color=green][color=darkred]
> > > 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[/color][/color]
> (except[color=green][color=darkred]
> > > perhaps by signing it?), but I can't find much information about dll's[/color][/color]
> on a[color=green][color=darkred]
> > > web server. If anyone could give me any pointers, I'd really[/color][/color][/color]
appreciate[color=blue]
> it[color=green][color=darkred]
> > > :-)
> > >[/color]
> >
> > 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.[/color]
>
> 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[/color]
reasoons),[color=blue]
> I was hoping to be able to use an existing DLL within the Java program.[/color]
I've[color=blue]
> 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[/color]
servlet[color=blue]
> using my dll? Are there other, better options?
>
> Many thanks,
>
> Rowland.
>[/color]
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.