Skip to main content

DLLs in Enterprise Application

8 replies [Last post]
hardcode
Offline
Joined: 2007-12-19

Hello!

I'm working on enterprise application (EAR), which is deployed on Sun Java Application Server 9.1. Modules are run via Web Start. I want my app using some DLLs (jdic from https://jdic.dev.java.net/ ). Where should I add these DLLs to the EAR, and how to make them available for other modules? I have found information that using native code by deployed enterprise application is possible only when this code is placed in RAR module, but I don't know how to create it properly. I only want to have access to DLLs, I don't provide my own native code.

Thanks in advance for any help.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
evickroy
Offline
Joined: 2004-07-23

I'm not sure that I would dismiss the JDIC project as dead. What features are you trying to use from JDIC? If it has something you need, I would recommend creating your own JNLP files and bypassing whatever mechanism Glassfish is using that prevents doing what you want if the JDIC feature is that important to you. Managing your own JNLP files isn't rocket science. ;-)

Erik

hardcode
Offline
Joined: 2007-12-19

Big thanks for your answers, they have clarifierd the issue for me. Of course I know how to manage JNLP files, my first idea was to modify launcher generated by Application Server, by adding nativelib tag to resource section. But then I thought there should be better way to achieve it. The logical way for me is that I'm adding JAR with DLLs to my EAR, and I'm telling the Application Server to generate proper JNLP by set something in some descriptor. Unfortunatelly Tim tells it's impossible, that's really not good. So I went back to the idea with own JNLP, of course based on the automatically generated one. I made empty value for href in jnlp tag, then I added this line in resources:

Under myAddress I placed required JARs (signed by myself), and jdic.jnlp file with this contents:


codebase="http://myAddress"
href="http://myAddress/jdic.jnlp">


q
q
q
q










jdic-native.jar includes both jdic.dll and jdic_icon.dll, without subdirs. And this resource seems to be loaded, during launching I have got security warning about using it, I even have checked its presence in Web Start cache. But when I activate function in my app that requires jdic, I still have error message "no jdic in java.library.path". What can be wrong? Also in console I noticed this exception during launching the app:

org.jdesktop.jdic.init.JdicInitException: org.jdesktop.jdic.init.JdicInitException: Unexpected ClassLoader for webstart, only com.sun.jnlp.JNLPClassLoader is supported.

Can it be connected with my problem? Any ideas how to solve it?

tjquinn
Offline
Joined: 2005-03-30

To clarify your question...

Are you using the feature built into GlassFish to launch app client modules using Java Web Start? Or have you written your own Java Web Start JNLP files and are launching those through a web app?

Do the DLLs need to be accessed from the app client, the server-side modules, or both?

- Tim

hardcode
Offline
Joined: 2007-12-19

I launch modules via Admin Console (or via browser: localhost:8080/myApp/myClient), I haven't written own JNLP file. DLLs are required by app client.

evickroy
Offline
Joined: 2004-07-23

We bundle the dlls and exes into a jdic-native.jar and release the jars with their own JNLP file in a separate EAR. The contents of that JNLP file looks something like this...

swinglibs.jnlp
[code]
...




...
[/code]

Then any of our Webstart apps can reference that JNLP file as an extension like so...

some_webstart_app.jnlp
[code]
...


...
[/code]

Unfortunately, I'm not familiar with how Glassfish handles Webstart apps, so someone else will have to respond to that.

Hope this helps.
Erik

tjquinn
Offline
Joined: 2005-03-30

What evickroy describes is what you would do if you were writing your own JNLP.

Unfortunately, the automatic support in GlassFish for generated JNLP documents for app clients does not provide a way for the developer to specify native JARs or other extension JNLP documents.

In GlassFish V3 we plan to significantly improve the developer's ability to influence how the generated JNLP is created, and what I have in mind would support what you want. But for the moment the automatically-generated JNLP in V2 will not be able to do what you need with native libraries.

Sorry to report the bad news.

- Tim

Message was edited by: tjquinn

ljnelson
Offline
Joined: 2003-08-04

Hey, Tim, don't feel too bad--JDIC doesn't run under Glassfish's WebStart anyway because they check to see if the classloader's [i]name[/i] is something in particular. So since Glassfish quite reasonably uses its own classloader to manage WebStart launches, JDIC doesn't work.

I have wasted many precious hours of my life before realizing that the JDIC project is basically dead. :-(

tjquinn
Offline
Joined: 2005-03-30

Hi, Laird. Good to hear from you again.

Yes, I remember your struggles with this and I should have mentioned them in this thread myself. Thanks for chiming in.

I wanted to be sure to emphasize in my note that native libraries in general are not going to work in V2's automatic support for Java Web Start.

Did you choose some other technology in place of JDIC that you would recommend here?

Thanks.

- Tim