Bonjour, j'ai un petit problème qui traine depuis maintenant plusieurs jours et impossible de mettre la main sur une solution.
j'essaye de mettre en place une applet qui doit communiquer avec un web service. j'ai choisi d'utiliser la librairie Apache Axis pour programmer ma classe "client" web service.
Voici une partie de la classe :
lorsque je lance les tests unitaires sur ma classe, tout passe correctement (initialisation, connexion au web service, valeur de retour des fonctions, ....).
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 import java.io.*; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import javax.xml.namespace.QName; import javax.xml.rpc.ServiceException; import java.net.URL; public class OSS_LCOM_Applet_ISD_WSClient { Service my_o_Service = null; Call my_o_Call = null; public OSS_LCOM_Applet_ISD_WSClient() throws Exception { try { String a_sz_TotalWDSLFile = "http://url_de_mon_fichier_wsdl/ficher.wsdl"; QName a_o_ServiceName = new QName("http://url_du_web_service/","service"); URL a_o_WSDLFile = new URL(a_sz_TotalWDSLFile); this.my_o_Service = new Service(a_o_WSDLFile.openStream(), a_o_ServiceName); } catch(ServiceException the_o_Exception) { the_o_Exception.printStackTrace(); } catch(Exception the_o_Exception) { throw the_o_Exception; } } ... }
Mais lorsque j'intègre la class au reste de l'applet, signe l'applet, et tente de l'utiliser dans le site web, j'ai l'erreur suivante :
Après analyse, cette erreur est générée par l'initialisation de mon object "Service", bien que les paramètres soient identiques dans l'utilisation réelle que dans les tests unitaires.
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 Exception in thread "thread applet-oss_lcom_applet_isdimporter/OSS_LCOM_Applet_ISD_ISDImporter.class-1" java.lang.NoClassDefFoundError: IllegalName: <br /> at java.lang.ClassLoader.preDefineClass(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:530) at java.security.AccessController.doPrivileged(Native Method) at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:517) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:288) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370) at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:37) at org.apache.axis.handlers.BasicHandler.<clinit>(BasicHandler.java:43) at org.apache.axis.client.Service.getAxisClient(Service.java:104) at org.apache.axis.client.Service.<init>(Service.java:220) at oss_lcom_applet_isdimporter.OSS_LCOM_Applet_ISD_WSClient.<init>(OSS_LCOM_Applet_ISD_WSClient.java:56) at oss_lcom_applet_isdimporter.OSS_LCOM_Applet_ISD_ISDImporter.init(OSS_LCOM_Applet_ISD_ISDImporter.java:80) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
le fichier WSDL est bien présent et accessible, et le contenu est correct.
J'imagine que le problème doit en fait venir de l'accessibilité des librairies, mais pas moyen de comprendre où se situe l'erreur.
Merci par avance à ceux qui pourrais me donner une solution, une piste, ou simplement un avis ...
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 <OBJECT name="StandartISDImportApplet" type="application/x-java-applet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="0" height="0" align="baseline" > <PARAM NAME="code" VALUE="oss_lcom_applet_isdimporter/OSS_LCOM_Applet_ISD_ISDImporter.class" > <PARAM NAME="codebase" VALUE="/modules/oss/applets/ISD/" > <PARAM NAME="scriptable" VALUE="1" > <PARAM NAME="archive" VALUE="OSS_LCOM_Applet_ISDImporter.jar, axis.jar, axis-ant.jar, commons-discovery-0.2.jar, commons-logging-1.0.4.jar, jaxrpc.jar, log4j-1.2.8.jar, mailapi.jar, OSS_LCOM_Applet.jar, plugin.jar, saaj.jar, wsdl4j-1.5.1.jar" > <PARAM NAME="JSMessagingFunction" VALUE="DisplayAppletMessages" > <PARAM NAME="Ticket" VALUE="614d" > <comment> <embed name="MozillaISDImportApplet" code="oss_lcom_applet_isdimporter/OSS_LCOM_Applet_ISD_ISDImporter.class" codebase="/modules/oss/applets/ISD/" archive="OSS_LCOM_Applet_ISDImporter.jar, axis.jar, axis-ant.jar, commons-discovery-0.2.jar, commons-logging-1.0.4.jar, jaxrpc.jar, log4j-1.2.8.jar, mailapi.jar, OSS_LCOM_Applet.jar, plugin.jar, saaj.jar, wsdl4j-1.5.1.jar" type="application/x-java-applet" pluginspage="http://java.sun.com/javase/downloads/ea.jsp" JSMessagingFunction="DisplayAppletMessages" Ticket="614d" scriptable="1" > <noembed>No Java Support.</noembed> </embed> </comment> </OBJECT>
Partager