Le chargement des dll fonctionne si c'est fait au tout d�but du lancement de l'application. Je soup�onne un probl�me de m�moire car le code suivant fonctionne :
new ClasseJNI();
String toto = "0123456789...0123456789"; //taille 100 octets
String [] totoTab = new String [5000];
for (int i = 0; i < 5000; i++)
{
totoTab[i] = toto+i;
}
mais pas celui-ci :
String toto = "0123456789...0123456789"; //taille 100 octets
String [] totoTab = new String [5000];
for (int i = 0; i < 5000; i++)
{
totoTab[i] = toto+i;
}
new ClasseJNI(); //-->UnsatisfiedLinkError avec "library not found"
System.out.println("valeur 1000 : "+totoTab[1000]);
Avez vous une explication ? .
Eric
Eric MOREL a �crit:
Bonjour,
Voil� deux mois que du code utilisant du jni fonctionne correctement. Nous avons ajout� du code java autour (nouvelles fen�tres awt et fonctions m�tiers) et voil� que le JNI ne fonctionne plus et on a l'erreur UnsatisfiedLinkError avec "library not found" alors que rien au niveau du jni n'a boug�. Si on supprime un appel � une des m�thodes ajout�es, cela refonctionne. Cela n'a pourtant rien � voir � premi�re vue. Toutes les dll posent le m�me pb ! Les dll sont charg�es au dernier moment dans un corps statique (le "new ClasseJNI()" est fait suivant le besoin) :
public class ClasseJNI {
public ClasseJNI() {}
public native int methode(String a, String b, String c );
static {
System.loadLibrary("ClasseJNI");
}
}
J'utilise le jdk 1.1.8 avec Jeode sur un iPAQ pocketPC 2002.
Avez vous d�j� rencontr� ce genre de pb ?
Merci,
Eric
**************************************************************************************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or the sender immediately and do not disclose the contents to any one or make copies.
** Antivirus scanned this email for viruses, vandals and malicious content **
**************************************************************************************************
