Bonjour à tous ,

Ceci est mon premier message sur le forum, donc si ce post n'est pas au bon endroit je m'en excuse à l'avance.

J'ai un problème pour lequel je n'ai pas trouvé de solution dans la recherche du forum.

Mon problème consiste à trouver pourquoi un appel à JNI dans un plugin Eclipse ne fonctionne pas, si le même code fonctionne dans une application java normale compilée avec Eclipse.

Mon plugin est dérivé d'un exemple offert par Eclipse qui ajoute un item au menu et une action au workbench. L'appel à une fonction native à l'intérieur de la fonction public void run(IAction action) donne l'erreur suivante :

Unhandled event loop exception
Reason:
embedWindow

embedWindow est le nom de ma fonction native. Voici le code de mon plugin:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
 
public class BindCalculator implements IWorkbenchWindowActionDelegate {
	private IWorkbenchWindow window;
	/**
         * The constructor.
         */
	public BindCalculator() {
	}
 
	public native void embedWindow();
 
	static
	{ 
		System.out.println("trying to load Lib");
		System.load("C:/JNITest.dll");
		System.out.println("Lib loaded!");
	}
 
	/**
         * The action has been activated. The argument of the
         * method represents the 'real' action sitting
         * in the workbench UI.
         * @see IWorkbenchWindowActionDelegate#run
         */
	public void run(IAction action) {
 
		System.out.println("Hello World");
		/*
		MessageDialog.openInformation(
			window.getShell(),
			"CalculetteView Plug-in",
			"Hello, Eclipse world");
		*/
		embedWindow();
	}
 
	/**
         * Selection in the workbench has been changed. We 
         * can change the state of the 'real' action here
         * if we want, but this can only happen after 
         * the delegate has been created.
         * @see IWorkbenchWindowActionDelegate#selectionChanged
         */
	public void selectionChanged(IAction action, ISelection selection) {
	}
 
	/**
         * We can use this method to dispose of any system
         * resources we previously allocated.
         * @see IWorkbenchWindowActionDelegate#dispose
         */
	public void dispose() {
	}
 
	/**
         * We will cache window object in order to
         * be able to provide parent shell for the message dialog.
         * @see IWorkbenchWindowActionDelegate#init
         */
	public void init(IWorkbenchWindow window) {
		this.window = window;
	}
}
ma classe implémente IWorkbenchWindowActionDelegate.
La dll est effectivement bien loadée car les commentaires s'affichent sur la console de sortie. Le même code venant d'une application java fonctionne parfaitement. J'aimerais savoir si quelqu'un détient une solution à mon problème.

Merci à l'avance.