Skip to main content

Deploy JDIC With Java Applet - Problem

10 replies [Last post]
max83
Offline
Joined: 2008-03-27

Hi all,

I've been using JDIC version 0.9, release 1 in applet as told in document[1] . I've tried using JDIC_PLUS in applet (version 0.9, release 4).I've done nothing different from before as told in deployment document[1]. Exceptions shown below are thrown while initializing JDIC.

org.jdesktop.jdic.init.JdicInitException: java.lang.UnsatisfiedLinkError: no jdic in java.library.path
at org.jdesktop.jdic.init.JdicManager.initBrowserNative(Unknown Source)
at org.jdesktop.jdic.browser.WebBrowser.(Unknown Source)

Caused by: java.lang.UnsatisfiedLinkError: no jdic in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.jdesktop.jdic.init.InitUtility.(Unknown Source)
... 12 more

What do you think the problem is and how can it be solved ?

Regards.

[1] https://jdic.dev.java.net/documentation/deployment.html

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
suzzane
Offline
Joined: 2012-02-10

hi,

i was having the same problem but i resolved it by placing the jdic.jar and jdic.dll in the projects class path......

pstojkovic
Offline
Joined: 2008-05-15

Hello,

the instructions I've written are targeted specifically at JDIC (not JDICplus unfortunately).
I haven't used JDICplus but I did a quick check of it, and found the following:

- when you unpack JDICplus binaries distribution archive, in folder [i]JDICplus-0.2.1-bin-win32\lib[/i] there are [b]JDICplus.jar[/b] and [b]JDICplus_native_applet.jar[/b]. [i]JDICplus_native_applet.jar[/i] includes [i]jdicArc.dll[/i] and [i]jdicWeb.dll[/i] as well as [i]org/jdic/NativeExtractor.class[/i]. This applet is obviously signed and has NativeExtractor stated as Main-Class in its manifest. It just implies that everything (unpacking of required native libraries) should be working automatically, and yet...

- then take the JDICplus source archive. Take a close look at [i]JDICplus-0.2.1-src\demo\JDICplus_native_applet\src\org\jdic\[/i][b]NativeExtractor.java[/b].

- take even more closer look at: [i]JDICplus-0.2.1-src\src\share\classes\org\jdic\[/i][b]NativeLoadMgr.java[/b]

- it seems that, apart from just storing native .dll files from .jar into a location in path, there should be a mechanism to load them as libraries. Most likely it can be done using [b]NativeLoadMgr.loadLibrary[/b] method.

To conclude: when in applet, after copying native DLLs, try loading the libraries before using them.

Greetingz.

uta
Offline
Joined: 2007-01-10

The URL for binary download:

https://jdic.dev.java.net/servlets/ProjectDocumentList?folderID=9354&exp...

[pre]
- Now there is only cross platform version of JDIC.
- There are not intersections in class names for different platforms, instead the reflection functionality is used.
- Java part of JDIC could be build by NetBeans projects.
jdic\src\share_applet -> jdic_native_applet.jar
jdic\src\share -> jdic.jar
jdic\src\unix -> jdic_stub_unix.jar
jdic\src\windows -> jdic_stub_windows.jar
- Please, view the example projects for correct linkage in different cases.
- Linkage with jdic.jar + jdic_native_applet.jar activates native part for ANY class loader.
But for JNLP start there is the better way (compare SimpleBrowser.jnlp and
SimpleBrowserAlt.jnlp from jdic-0.9.5-bin-cross-platform.zip)
[/pre]

Regards,
-uta

max83
Offline
Joined: 2008-03-27

Hi uta,

Thank you very much for the very nice work you did. And i am sorry because of my late reply.

I tried the Jdic version 0.9.5. But i had a problem with it.

I am currently using Jdic version 0.9.1. I followed the document (an old but useful document) linked from https://jdic.dev.java.net/documentation/deployment.html. I have a problem with this version, let's call it as gray window problem. And my main issue is that problem, i am really okay with other functionalities. Please let me explain the problem in action step by step.

1) The applet which contains Jdic WebBrowser component is opened in a tab (tab#1) of a web browser. Every thing is fine for now.
2) Another tab is opened (tab#2).
3) tab#1 is closed.
4) The applet is opened in tab#2. And the panel which contains Jdic WebBrowser is seen as gray.

This problem has a Java Console output like below (LOG#1).
----------------------------------------------------------------------------------------------------------------------------
LOG#1:
PART1:
*** Jtrace: init share native.....
*** Jtrace: not loaded by jws
*** Jtrace: current runnning path \C:\Apps\jre1.6.0_05\lib\ext\
*** Jtrace: check if loaded in extension mode
*** Jtrace: jar path to verifyC:\Apps\jre1.6.0_05\lib\ext/jdic_crossplatform.jar
*** Jtrace: jar path to verifyC:\Apps\jre1.6.0_05\lib\ext/jdic_native.jar
*** Jtrace: dealing with META-INF/MANIFEST.MF
*** Jtrace: dealing with META-INF/JD_C-KEY.SF
*** Jtrace: dealing with META-INF/JD_C-KEY.DSA
*** Jtrace: dealing with jdic.dll
*** Jtrace: dealing with tray.dll
*** Jtrace: dealing with IeEmbed.exe
*** Jtrace: dealing with MozEmbed.exe
*** Jtrace: loaded in extension mode with os specific format
*** Jtrace: runnning path after dealing \C:\Apps\jre1.6.0_05\lib\ext\
*** Jtrace: init share native.....
*** Jtrace: Envent Thread new once!
*** Jtrace: Using browserManager null
*** Jtrace: Default browserManager is used.
*** Jtrace: Engine Internet Explorer is set as activeEngine.
*** Jtrace: Envent Thread run once!
*** Jtrace: Msg Client new once!
*** Jtrace: Found a free socket port: 1823
native lib path C:\Apps\jre1.6.0_05\lib\ext/jdic_native*** Jtrace: init share native.....
*** Jtrace: nspr4.dll under C:\Apps\jre1.6.0_05\lib\ext/jdic_native\ielib is set to PATH
*** Jtrace: Engine initialize once!
native lib path C:\Apps\jre1.6.0_05\lib\ext/jdic_native*** Jtrace: Executing C:\Apps\jre1.6.0_05\lib\ext/jdic_native\IeEmbed.exe -port=1823

PART2:
*** Error: Engine Internet Explorerhas been initialized,can't change it anymore!
----------------------------------------------------------------------------------------------------------------------------

I also tried the Jdic v0.9.5 you deployed. I tried the demo applet called "SampleAppletBrowser". Firstly i did not clear the *.exe and *.dll files which came with v.0.9.1. But the applet was not open. The Java Console logs can be seen below (LOG#2);
----------------------------------------------------------------------------------------------------------------------------
LOG#2:

*** Jtrace: init share native.....
*** Jtrace: not loaded by jws
*** Jtrace: current runnning path \C:\Apps\jre1.6.0_05\lib\ext\
*** Jtrace: check if loaded in extension mode
*** Jtrace: jar path to verifyC:\Apps\jre1.6.0_05\lib\ext/jdic_crossplatform.jar
*** Jtrace: jar path to verifyC:\Apps\jre1.6.0_05\lib\ext/jdic_native.jar
*** Jtrace: dealing with META-INF/MANIFEST.MF
*** Jtrace: dealing with META-INF/JD_C-KEY.SF
*** Jtrace: dealing with META-INF/JD_C-KEY.DSA
*** Jtrace: dealing with jdic.dll
*** Jtrace: dealing with tray.dll
*** Jtrace: dealing with IeEmbed.exe
*** Jtrace: dealing with MozEmbed.exe
*** Jtrace: loaded in extension mode with os specific format
*** Jtrace: runnning path after dealing \C:\Apps\jre1.6.0_05\lib\ext\
*** Jtrace: init share native.....
*** Jtrace: Envent Thread new once!
*** Jtrace: Envent Thread run once!
*** Jtrace: Msg Client new once!
*** Jtrace: Using browserManager null
*** Jtrace: Default browserManager is used.
*** Jtrace: No browser is selected as active,you must specify one by setActiveEngine()!
Exception in thread "EventThread" java.lang.NullPointerException
at org.jdesktop.jdic.browser.internal.MsgClient.(Unknown Source)
at org.jdesktop.jdic.browser.internal.NativeEventThread.run(Unknown Source)
*** Jtrace:
MyFocusListener: focusGained

*** Jtrace:
MyFocusListener: focusLost
----------------------------------------------------------------------------------------------------------------------------

Then i cleared the old *.exe and *.dll files. And the applet opened and Jdic component worked without any problem.
Logs can be seen below (LOG#3);
----------------------------------------------------------------------------------------------------------------------------
LOG#3:
Native loader!
isDefaultBrowserMozilla
*** Jtrace: Executing IeEmbed.exe
*** Jtrace: JDIC found BIN path=[C:\Documents and Settings\...........Temp\jdic_0_9_5]
isDefaultBrowserMozilla
*** Jtrace:
MyFocusListener: focusGained

*** Jtrace: connecting ... 0
*** Jtrace: connected
*** Jtrace: Got event: type = 0 instance = 0
*** Jtrace: send data to socket: 0,0,
*** Jtrace: Got event: type = 1 instance = 0
*** Jtrace: send data to socket: 0,1,1706568
*** Jtrace:
MyFocusListener: focusLost

*** Jtrace: read data from socket: 0,30420,30030,3022,back=00,3022,forward=00,3024,Waiting for about:blank...
*** Jtrace: get a complete short message: 0,3042
*** Jtrace: Got event from browser 0, 3042, null
*** Jtrace: Got event: type = 5 instance = 0
*** Jtrace: send data to socket: 0,5,http://www.google.com
*** Jtrace: get a complete short message: 0,3003
*** Jtrace: Got event from browser 0, 3003, null
*** Jtrace: Got event from NativeEventThread 3003
*** Jtrace: Got event: type = 4 instance = 0
*** Jtrace: read data from socket: 0,3022,back=00,3022,forward=00,3024,Waiting for about:blank...0,3022,back=00,3022,forward=00,3023,about:blank0,30040,3024,Done0,30050,3023,about:blank0,3005
*** Jtrace: get a complete short message: 0,3022,back=0
*** Jtrace: Got event from browser 0, 3022, back=0
*** Jtrace: Got event from NativeEventThread 3022
*** Jtrace: Back State changed = false
*** Jtrace: Got event: type = 13 instance = 0
*** Jtrace: send data to socket: 0,4,0,0,300,1200,13,
*** Jtrace: get a complete short message: 0,3022,forward=0
*** Jtrace: Got event from browser 0, 3022, forward=0
*** Jtrace: Got event from NativeEventThread 3022
*** Jtrace: Forward State changed = false
*** Jtrace: Got event: type = 14 instance = 0
*** Jtrace: send data to socket: 0,14,
*** Jtrace: get a complete short message: 0,3024,Waiting for about:blank...
*** Jtrace: Got event from browser 0, 3024, Waiting for about:blank...
*** Jtrace: Got event from NativeEventThread 3024
*** Jtrace: get a complete short message: 0,3022,back=0
*** Jtrace: Got event from browser 0, 3022, back=0
*** Jtrace: Got event from NativeEventThread 3022
*** Jtrace: Back State changed = false
*** Jtrace: get a complete short message: 0,3022,forward=0
*** Jtrace: Got event from browser 0, 3022, forward=0
*** Jtrace: Got event from NativeEventThread 3022
*** Jtrace: Forward State changed = false
*** Jtrace: read data from socket: 0,3023,about:blank0,30040,3024,Done0,30050,3023,about:blank0,30050,3001,http://www.google.com/
*** Jtrace: get a complete short message: 0,3023,about:blank
*** Jtrace: Got event from browser 0, 3023, about:blank
*** Jtrace: Got event from NativeEventThread 3023
*** Jtrace: get a complete short message: 0,3004
*** Jtrace: Got event from browser 0, 3004, null
*** Jtrace: Got event from NativeEventThread 3004
*** Jtrace: get a complete short message: 0,3024,Done
*** Jtrace: Got event from browser 0, 3024, Done
*** Jtrace: Got event from NativeEventThread 3024
*** Jtrace: get a complete short message: 0,3005
*** Jtrace: Got event from browser 0, 3005, null
*** Jtrace: Got event from NativeEventThread 3005
*** Jtrace: get a complete short message: 0,3023,about:blank
*** Jtrace: Got event from browser 0, 3023, about:blank
*** Jtrace: Got event from NativeEventThread 3023
*** Jtrace: get a complete short message: 0,3005
*** Jtrace: Got event from browser 0, 3005, null
*** Jtrace: Got event from NativeEventThread 3005
*** Jtrace: get a complete short message: 0,3001,http://www.google.com/
*** Jtrace: Got event from browser 0, 3001, http://www.google.com/
*** Jtrace: Got event from NativeEventThread 3001
*** Jtrace: URL = http://www.google.com/
*** Jtrace: send data to socket: @0,3001,0
*** Jtrace: read data from socket: 0,30030,3024,Done0,3003
*** Jtrace: get a complete short message: 0,3003
*** Jtrace: Got event from browser 0, 3003, null
*** Jtrace: Got event from NativeEventThread 3003
*** Jtrace: get a complete short message: 0,3024,Done
*** Jtrace: Got event from browser 0, 3024, Done
*** Jtrace: Got event from NativeEventThread 3024
*** Jtrace: get a complete short message: 0,3003
*** Jtrace: Got event from browser 0, 3003, null
*** Jtrace: Got event from NativeEventThread 3003
*** Jtrace: read data from socket: 0,30050,3024,Waiting for http://www.google.com/...0,3005
*** Jtrace: get a complete short message: 0,3005
*** Jtrace: Got event from browser 0, 3005, null
*** Jtrace: Got event from NativeEventThread 3005
*** Jtrace: get a complete short message: 0,3024,Waiting for http://www.google.com/...
*** Jtrace: Got event from browser 0, 3024, Waiting for http://www.google.com/...
*** Jtrace: Got event from NativeEventThread 3024
*** Jtrace: get a complete short message: 0,3005
*** Jtrace: Got event from browser 0, 3005, null
*** Jtrace: Got event from NativeEventThread 3005
*** Jtrace: read data from socket: 0,30050,3005
*** Jtrace: get a complete short message: 0,3005
*** Jtrace: Got event from browser 0, 3005, null
*** Jtrace: Got event from NativeEventThread 3005
*** Jtrace: get a complete short message: 0,3005
*** Jtrace: Got event from browser 0, 3005, null
*** Jtrace: Got event from NativeEventThread 3005
*** Jtrace: read data from socket: 0,3024,Waiting for http://www.google.com.tr/...0,3022,back=00,3022,forward=00,3022,back=00,3022,forward=00,3022,back=00,3022,forward=00,3023,about:blank0,3004
*** Jtrace: get a complete short message: 0,3024,Waiting for http://www.google.com.tr/...
*** Jtrace: Got event from browser 0, 3024, Waiting for http://www.google.com.tr/...
*** Jtrace: Got event from NativeEventThread 3024
*** Jtrace: get a complete short message: 0,3022,back=0
*** Jtrace: Got event from browser 0, 3022, back=0
*** Jtrace: Got event from NativeEventThread 3022
*** Jtrace: Back State changed = false
*** Jtrace: get a complete short message: 0,3022,forward=0
*** Jtrace: Got event from browser 0, 3022, forward=0
*** Jtrace: Got event from NativeEventThread 3022
*** Jtrace: Forward State changed = false
*** Jtrace: get a complete short message: 0,3022,back=0
*** Jtrace: Got event from browser 0, 3022, back=0
*** Jtrace: Got event from NativeEventThread 3022
*** Jtrace: Back State changed = false
*** Jtrace: get a complete short message: 0,3022,forward=0
*** Jtrace: Got event from browser 0, 3022, forward=0
*** Jtrace: Got event from NativeEventThread 3022
*** Jtrace: Forward State changed = false
*** Jtrace: get a complete short message: 0,3022,back=0
*** Jtrace: Got event from browser 0, 3022, back=0
*** Jtrace: Got event from NativeEventThread 3022
*** Jtrace: Back State changed = false
*** Jtrace: get a complete short message: 0,3022,forward=0
*** Jtrace: Got event from browser 0, 3022, forward=0
*** Jtrace: Got event from NativeEventThread 3022
*** Jtrace: Forward State changed = false
*** Jtrace: read data from socket: 0,3023,about:blank0,30040,3024,Downloading picture http://www.google.com.tr/intl/en_com/images/logo_plain.png...
*** Jtrace: get a complete short message: 0,3023,about:blank
*** Jtrace: Got event from browser 0, 3023, about:blank
*** Jtrace: Got event from NativeEventThread 3023
*** Jtrace: read data from socket: 0,30040,3024,Downloading picture http://www.google.com.tr/intl/en_com/images/logo_plain.png...0,3024,Done0,30050,30050,3023,Google0,3005
*** Jtrace: get a complete short message: 0,3004
*** Jtrace: Got event from browser 0, 3004, null
*** Jtrace: Got event from NativeEventThread 3004
*** Jtrace: read data from socket: 0,3024,Downloading picture http://www.google.com.tr/intl/en_com/images/logo_plain.png...0,3024,Done0,30050,30050,3023,Google0,30050,3007
*** Jtrace: get a complete short message: 0,3024,Downloading picture http://www.google.com.tr/intl/en_com/images/logo_plain.png...
*** Jtrace: Got event from browser 0, 3024, Downloading picture http://www.google.com.tr/intl/en_com/images/logo_plain.png...
*** Jtrace: Got event from NativeEventThread 3024
*** Jtrace: get a complete short message: 0,3024,Done
*** Jtrace: Got event from browser 0, 3024, Done
*** Jtrace: Got event from NativeEventThread 3024
*** Jtrace: get a complete short message: 0,3005
*** Jtrace: Got event from browser 0, 3005, null
*** Jtrace: Got event from NativeEventThread 3005
*** Jtrace: get a complete short message: 0,3005
*** Jtrace: Got event from browser 0, 3005, null
*** Jtrace: Got event from NativeEventThread 3005
*** Jtrace: get a complete short message: 0,3023,Google
*** Jtrace: Got event from browser 0, 3023, Google
*** Jtrace: Got event from NativeEventThread 3023
*** Jtrace: get a complete short message: 0,3005
*** Jtrace: Got event from browser 0, 3005, null
*** Jtrace: Got event from NativeEventThread 3005
*** Jtrace: get a complete short message: 0,3007
*** Jtrace: Got event from browser 0, 3007, null
*** Jtrace: Got event from NativeEventThread 3007
*** Jtrace: read data from socket: 0,3005
*** Jtrace: get a complete short message: 0,3005
*** Jtrace: Got event from browser 0, 3005, null
*** Jtrace: Got event from NativeEventThread 3005
----------------------------------------------------------------------------------------------------------------------------

But the problem which i stated above (gray window problem) has been occured again.
Logs from Java Console can be seen below again (LOG#4);
----------------------------------------------------------------------------------------------------------------------------
LOG#4:
*** Jtrace: Got event: type = 12 instance = 0
*** Jtrace: send data to socket: 0,12,
*** Jtrace: read data from socket: 0,3021,http://www.google.com.tr/
*** Jtrace: get a complete short message: 0,3021,http://www.google.com.tr/
*** Jtrace: Got event from browser 0, 3021, http://www.google.com.tr/
*** Jtrace: Got event: type = 2 instance = 0
*** Jtrace: send data to socket: 0,2,
Exception in thread "Thread-10" java.lang.NullPointerException: null pData
at sun.awt.windows.WComponentPeer.hide(Native Method)
at java.awt.Component.removeNotify(Unknown Source)
at org.jdesktop.jdic.browser.WebBrowser.access$201(Unknown Source)
at org.jdesktop.jdic.browser.WebBrowser$1.run(Unknown Source)
*** Jtrace: read data from socket: 0,3044
*** Jtrace: get a complete short message: 0,3044
*** Jtrace: Got event from browser 0, 3044, null
*** Jtrace:
MyFocusListener: focusGained

*** Jtrace:
MyFocusListener: focusLost

----------------------------------------------------------------------------------------------------------------------------

My main issues is this problem (gray window problem). I would be glad if you propose a solution to overcome this issue.

Thanks in advance,
Regards.

PS: Please see my notes from previous post
["This issue seems to be solved but i could not make it work (http://forums.java.net/jive/thread.jspa?messageID=177519&#177519)."].

japeka
Offline
Joined: 2008-05-21

[b]Urgent help's needed!
[/b]

Here what I have done with JDICPlus and org.jdic.web.BrTabbed component. I finally managed to get the applet browser working using JDICPlus's TabbedBrowser as a basis for my applet browser. What I did was I just remove the main method, all window related operations and other needed stuffs in order to transform application into an applet.

However, I am encountering few problems with running the applet. Currently as my Java IDE is Netbeans 6.01 and as running the appletbrowser inside NetBeans I am able to execute the applet with appletviewer quite stablely. What I want is I want to get the applet out of Netbeans and run it on html page inside applet tags? What must I do to achieve this goal? I would appreciate step-by-step guidelines how to do it.

Another problem with appletbrowser is some pages with Javascript are crushing the execution of applet totally. F. ex a log might say something like

[i]#
# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d152d73, pid=6124, tid=4092
#
# Java VM: Java HotSpot(TM) Client VM (10.0-b22 mixed mode windows-x86)
# Problematic frame:
# C [awt.dll+0xa2d73]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

--------------- T H R E A D ---------------

Current thread (0x0bb2e800): JavaThread "AWT-Windows" daemon [_thread_in_native, id=4092, stack(0x0c200000,0x0c250000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x000000f0

Registers:
EAX=0x00000001, EBX=0x00000021, ECX=0x00000004, EDX=0x00000001
ESP=0x0c24f6b0, EBP=0x0038051a, ESI=0x00000004, EDI=0x0d116de8
EIP=0x6d152d73, EFLAGS=0x00010202

Top of Stack: (sp=0x0c24f6b0)
0x0c24f6b0: 0d116de8 6d152db6 6d12b96a 0c24f798
0x0c24f6c0: 0038051a 0c24f71c 00000000 00000001
0x0c24f6d0: 0038051a 00000000 0c24f6c8 00000000
0x0c24f6e0: 0bb2e8f4 0c24f710 6d164d08 00000000
0x0c24f6f0: 6d123718 00000021 0038051a 02010001
0x0c24f700: 0c24f798 00000021 00000000 0c24f700
0x0c24f710: 0c24f7b0 6d164a90 00000000 0c24f748
0x0c24f720: 76831a10 0038051a 00000021 0038051a

Instructions: (pc=0x6d152d73)
0x6d152d63: ff 52 5c 5e 5b 5f 5d c3 cc cc cc cc cc 56 8b f1
0x6d152d73: 8b 86 ec 00 00 00 85 c0 74 23 8b 0d 1c 97 19 6d
[/i]

What might be causing this error with Javascript? Is it a reported bug or something else?
Or am I missing something?

Please help me out with this!
-japeka-

pstojkovic
Offline
Joined: 2008-05-15

Hello,

the problem probably lies within the fact than new JDIC version didn't include automatic extraction of [b]jdic.dll[/b] from [b]jdic_native.jar[/b] to [i]\lib\ext[/i] folder as it did in earlier version.

There is a workaround I applied (probably tedious and non-optimal solution but I hope it could be of some help). The idea is to take only the components you actually need from JDIC, and pack them together with your own classes into single JAR file. However, there must be a routine inside your class to extract needed native library jdic.dll (and other) to some location within java.library.path. This way, we have overcome another issue - absolute path for [i]Implementation-URL[/i] in manifest file, so you can deploy your web application more flexibly.

[i][u]Part I[/u][/i] (how to pack everything together - actually comes after Part II)

- extract jdic.jar (using ZIP) to a temp folder and there will be a folder structure corresponding to package structure org/jdesktop/jdic/desktop/...

- put jdic.dll (and other native .dll files if you require them) into this temp folder

- put your class files within corresponding package/folder structure into the same temp folder as com/mycompany/mypackage/myclasses...

- make a JAR file to include these three items
[i]jar cvf myappletunsigned.jar com org jdic.dll[/i]

- sign this JAR file
[i]jarsigner -verbose -keystore ...\my.keystore -storepass mypass -signedjar myapplet.jar myappletunsigned.jar mycertificate[/i]

- this single JAR file now contains everything

[i][u]Part II[/u][/i] (how to extract jdic.dll on user's machine)

- if you are making an applet, in your java class, somewhere within [b]init[/b] method, obtain jdic.dll from the JAR, with
[i]InputStream in = getClass().getResourceAsStream("/jdic.dll");[/i]
...
[i]// Read from input stream into an array of bytes[/i]
...

- Find the folder on user's machine where jdic.dll can be stored. You can parse string obtained by [i]System.getProperty("java.library.path")[/i] to get a path to an available folder.

- Store the jdic.dll to a folder.
[i]File ft = new File(folderpath + File.separator + "jdic.dll");[/i]
...
[i]FileOutputStream out = new FileOutputStream(ft);[/i]
...
[i]// Write from array of bytes to output stream[/i]
...

- now you can include some checks in your code, like to verify if there is jdic.dll already on user's machine in target folder, etc.
- Also if you need other native libraries (tray.dll for example), don't forget to apply the same mechanism to them.
- And go back to Part I to actually pack everything into JAR.

Hope this helps. Greetings.

max83
Offline
Joined: 2008-03-27

Hi,

Thanks for your detailed response. I will try it as soon as possible. I hope it will work.

Thanks,
Regards.

japeka
Offline
Joined: 2008-05-21

Hi pstojkovic and max83,

I followed the instructions what pstojkovic described as a workaround solution. I did all the things what was requested but still I get error message about "jdicWeb.dll was not found in java.library.path". In my case I had jdicWeb.dll jar'red inside jar file and copied it to one of java.library.path locations. I check and confirm that the file gets created but still the error ...
Now I am wondering what went wrong?

Did U max83 get it working by applying the instructions?

Thanx

Message was edited by: japeka

max83
Offline
Joined: 2008-03-27

Hi japeka,

I have not tried the proposed solution but i hope it will help. I am currently using Jdic v0.9 release 1. This version is okay for me (in my appliation i only need an internal web browser nested in applet which renders HTMLs with images, flash objects, avi files etc.), my problem with this version is when the preview window is refreshed constructed by Jdic components gone gray. This issue seems to be solved but i could not make it work (http://forums.java.net/jive/thread.jspa?messageID=177519&#177519).

I will try it with JdicPlus when i have some time to change my component's infrastructure that uses Jdic to JdicPlus because as far as i see Jdic and JdicPlus have very different API interface.

Regards.

max83
Offline
Joined: 2008-03-27

As an addition to my previous post, this problem was stated at issue 428[1]. But it seems that it does not work with JDIC-PLUS. If there is a way to make it work with JDIC-PLUS, please let me know.

Thanks,
Regards.

[1][b]https://jdic.dev.java.net/issues/show_bug.cgi?id=428[/b]