Problème web Service: class file has wrong version!
Bonjour, j'ai un petit souci au niveau d'un de mes fichiers, il n'est pas à la bonne version.
Voici le message d'erreur:
Citation:
D:\J2EE\Ch12\SimpleServiceApp>javac -classpath %classpath%;stubs -d . client/*.java
client/SimpleServiceClient.java:4: cannot access webservices.SimpleService_Impl
bad class file: stubs\webservices\SimpleService_Impl.class
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
import webservices.SimpleService_Impl;
^
1 error
Voici le fichier SimpleServiceClient.java:
Code:
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
| package client;
import webservices.SimpleServiceIF;
import webservices.SimpleService_Impl;
import javax.xml.rpc.Stub;
public class SimpleServiceClient {
public static void main(String[] args) {
try {
Stub stub = (Stub)(new SimpleService_Impl().getSimpleServiceIFPort());
SimpleServiceIF myProxy = (SimpleServiceIF)stub;
System.out.println("Service joint !");
// Boucle sur les mots
for (int i = 0; i < args.length; i++) {
String returnedString =
myProxy.getEchoString(args[i]);
System.out.println("Chaine envoyee : " + args[i]
+ ", chaine retournee : " + returnedString);
}
} catch(Exception e) {
e.printStackTrace();
}
}
} |
Voici les différents fichiers utilisés pour la crétion de mon web service:
service-config.xml
Code:
1 2 3 4 5 6 7 8 9 10 11
| <?xml version="1.0" encoding="UTF-8"?>
<configuration
xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<service
name="SimpleService"
targetNamespace="urn:simpleService"
typeNamespace="urn:simpleService"
packageName="webservices">
<interface name="webservices.SimpleServiceIF"/>
</service>
</configuration> |
mapping.xml
Code:
1 2 3 4 5 6 7 8 9 10
| <?xml version="1.0" encoding="UTF-8"?>
<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd"
version="1.1">
<package-mapping>
<package-type>webservices</package-type>
<namespaceURI>urn:simpleService</namespaceURI>
</package-mapping>
</java-wsdl-mapping> |
client-config.xml
Code:
1 2 3 4 5 6
| <?xml version="1.0" encoding="UTF-8"?>
<configuration
xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<wsdl location="http://localhost:8080/simple-jaxrpc/simple?WSDL"
packageName="webservices"/>
</configuration> |
Apparemment, c'est un problème de version, donc je suppose que l'un de mes fichiers ou tous sont écrits dans une mauvaise version, par rapport au J2EE 1.4 que j'utilise. Merci d'avance pour vos lumières.
Mumu27!