[JBoss]Deployed WebServices Probleme Help
Bonsoir,
Je cherche à déployer mon web services sous JBoss 4.0.5.
Mes WS sont fait à partir d'EJB
CalcInterfaces, qui est l'interface pour les EJB
Code:
1 2 3 4 5 6 7 8 9 10
|
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface CalcInterfaces extends Remote {
public String add(int x, int y) throws RemoteException;
public String mult(int x, int y) throws RemoteException;
public String sub(int x, int y) throws RemoteException;
public String div(int x, int y) throws RemoteException;
} |
Fichier remote pour les EJBs
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
import java.rmi.RemoteException;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@Stateless
@WebService
@SOAPBinding(style=Style.RPC)
public class CalcWS implements CalcInterfaces {
private String msgAdd = new String("Result of the add operation = ");
private String msgSub = new String("Result of the sub operation = ");
private String msgMult = new String("Result of the mult operation = ");
private String msgDiv = new String("Result of the div operation = ");
//et les méthodes à prendre en compte au déploiement
@WebMethod
public String add(int x, int y) throws RemoteException {
Integer z = x + y;
return msgAdd + z + ".";
}
@WebMethod
public String mult(int x, int y) throws RemoteException {
Integer z = x * y;
return msgMult + z + ".";
}
@WebMethod
public String sub(int x, int y) throws RemoteException {
Integer z = x - y;
return msgSub + z + ".";
}
@WebMethod
public String div(int x, int y) throws RemoteException {
Integer z = x / y;
return msgDiv + z + ".";
}
} |
Mon fichier web.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" 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://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>ProjetWebServices</display-name>
<description>
Exemple de fichier web.xml avec des informations
sur les servlets.
</description>
<servlet>
<servlet-name>TestService</servlet-name>
<servlet-class>fr.umlv.CalcWS</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestService</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app> |
Je fais un war grace à mon ant
Code:
1 2 3 4 5 6 7 8
|
<target name="war">
<war warfile="${basedir}/libs/ProjetWebServices.war" webxml="${Web.dir}/WEB-INF/web.xml">
<fileset dir="${build.dir}/classes">
<include name="fr/umlv/*.class"/>
</fileset>
</war>
</target> |
Lors du déploiment sur mon server JBoss j'ai le droit à une exception directement
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 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
|
20:03:25,093 ERROR [MainDeployer] Could not create deployment: file:/C:/Program Files/jboss-4.0.5.GA/server/default/deploy/ProjetWebServices.war
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:672)
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:652)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:190)
at org.jboss.mx.loading.UnifiedLoaderRepository3.loadClassFromClassLoader(UnifiedLoaderRepository3.java:277)
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:189)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.jboss.ws.integration.jboss.DeployerInterceptorJSE.isWebserviceDeployment(DeployerInterceptorJSE.java:124)
at org.jboss.ws.integration.jboss.DeployerInterceptor.create(DeployerInterceptor.java:76)
at org.jboss.ws.integration.jboss.DeployerInterceptorJSE.create(DeployerInterceptorJSE.java:74)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy43.create(Unknown Source)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) |
Ca fait des heures que je suis dessus je n'arrive pas à voir de solution.
Si vous avez des lumieres à m'offir je suis prenneur.
Bonne soirée