1 Reply Latest reply on Feb 8, 2008 10:45 AM by Francis LIMOUSY

    java.lang.LinkageError

    Francis LIMOUSY Newbie

      Hello,

      I have a weird error trying to use my newly generated WS.
      The problem occurs on the client side :

      Caused by: java.lang.LinkageError: Class javax/xml/soap/AttachmentPart violates loader constraints
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
       at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1815)
       at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:869)
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1322)
       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:164)
       at $Proxy70.<clinit>(Unknown Source)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
       at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:588)
       at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.createProxy(ServiceDelegateImpl.java:331)
       at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:211)
       at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:148)
       at javax.xml.ws.Service.getPort(Service.java:116)
       at authentification.bean.session.AuthentificationService.getAuthentificationPort(AuthentificationService.java:56)
       at bsa.admin.view.StartBean.login(StartBean.java:114)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
       ... 38 more
      


      This linkage error results in a ClassNotFoundException.
      Here is the code of my WebserviceClient:

      @WebServiceClient(name = "AuthentificationService", targetNamespace = "http://session.bean.authentification/", wsdlLocation = "http://localhost:8080/AuthentificationService/Authentification?wsdl")
      public class AuthentificationService
       extends Service
      {
      
       private final static URL AUTHENTIFICATIONSERVICE_WSDL_LOCATION;
      
       static {
       URL url = null;
       try {
       url = new URL("http://localhost:8080/AuthentificationService/Authentification?wsdl");
       } catch (MalformedURLException e) {
       e.printStackTrace();
       }
       AUTHENTIFICATIONSERVICE_WSDL_LOCATION = url;
       }
      
       public AuthentificationService(URL wsdlLocation, QName serviceName) {
       super(wsdlLocation, serviceName);
       }
      
       public AuthentificationService() {
       super(AUTHENTIFICATIONSERVICE_WSDL_LOCATION, new QName("http://session.bean.authentification/", "AuthentificationService"));
       }
      
       /**
       *
       * @return
       * returns Authentification
       */
       @WebEndpoint(name = "AuthentificationPort")
       public Authentification getAuthentificationPort() {
       return (Authentification)super.getPort(new QName("http://session.bean.authentification/", "AuthentificationPort"), Authentification.class);
       }
      
      }
      


      And now the (supposely) not linked Authentification.class

      @WebService(name = "Authentification", targetNamespace = "http://session.bean.authentification/")
      @SOAPBinding(style = SOAPBinding.Style.RPC)
      public interface Authentification {
      
      
       /**
       *
       * @param arg1
       * @param arg0
       * @return
       * returns authentification.bean.session.User
       */
       @WebMethod
       @WebResult(partName = "return")
       public User authenticate(
       @WebParam(name = "arg0", partName = "arg0")
       String arg0,
       @WebParam(name = "arg1", partName = "arg1")
       String arg1);
      
       /**
       *
       * @param arg1
       * @param arg0
       * @return
       * returns net.java.dev.jaxb.array.StringArray
       */
       @WebMethod
       @WebResult(partName = "return")
       public StringArray getRoles(
       @WebParam(name = "arg0", partName = "arg0")
       int arg0,
       @WebParam(name = "arg1", partName = "arg1")
       int arg1);
      
      }