java.lang.LinkageError.initCause()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中java.lang.LinkageError.initCause()方法的一些代码示例,展示了LinkageError.initCause()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LinkageError.initCause()方法的具体详情如下:
包路径:java.lang.LinkageError
类名称:LinkageError
方法名:initCause

LinkageError.initCause介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

throw (LinkageError)new LinkageError("Failed to resolve "+c).initCause(x);

代码示例来源:origin: javaee/glassfish

@Override
  public Object run() {
    LinkageError x = new LinkageError("injection failed on " + cls + " from " + cls.getClassLoader());
    x.initCause(e);
    throw x;
  }
});

代码示例来源:origin: fusesource/hawtjni

private boolean load(ArrayList<Throwable> errors, File lib) {
  try {
    System.load(lib.getPath());
    nativeLibraryPath = lib.getPath();
    return true;
  } catch (UnsatisfiedLinkError e) {
    LinkageError le = new LinkageError("Unable to load library from " + lib);
    le.initCause(e);
    errors.add(le);
  }
  return false;
}

代码示例来源:origin: fusesource/hawtjni

private boolean loadLibrary(ArrayList<Throwable> errors, String lib) {
  try {
    System.loadLibrary(lib);
    nativeLibraryPath = "java.library.path,sun.boot.library.pathlib:" + lib;
    return true;
  } catch (UnsatisfiedLinkError e) {
    LinkageError le = new LinkageError("Unable to load library " + lib);
    le.initCause(e);
    errors.add(le);
  }
  return false;
}

代码示例来源:origin: org.glassfish.hk2/hk2-config

@Override
  public Object run() {
    LinkageError x = new LinkageError("injection failed on " + cls + " from " + cls.getClassLoader());
    x.initCause(e);
    throw x;
  }
});

代码示例来源:origin: org.fusesource.hawtjni/hawtjni-runtime

private boolean loadLibrary(ArrayList<Throwable> errors, String lib) {
  try {
    System.loadLibrary(lib);
    nativeLibraryPath = "java.library.path,sun.boot.library.pathlib:" + lib;
    return true;
  } catch (UnsatisfiedLinkError e) {
    LinkageError le = new LinkageError("Unable to load library " + lib);
    le.initCause(e);
    errors.add(le);
  }
  return false;
}

代码示例来源:origin: org.fusesource.hawtjni/hawtjni-runtime

private boolean load(ArrayList<Throwable> errors, File lib) {
  try {
    System.load(lib.getPath());
    nativeLibraryPath = lib.getPath();
    return true;
  } catch (UnsatisfiedLinkError e) {
    LinkageError le = new LinkageError("Unable to load library from " + lib);
    le.initCause(e);
    errors.add(le);
  }
  return false;
}

代码示例来源:origin: org.glassfish.hk2/auto-depends

@Override
  public Object run() {
    LinkageError x = new LinkageError("injection failed on " + cls + " from " + cls.getClassLoader());
    x.initCause(e);
    throw x;
  }
});

代码示例来源:origin: eclipse-ee4j/glassfish

@Override
  public Object run() {
    LinkageError x = new LinkageError("injection failed on " + cls + " from " + cls.getClassLoader());
    x.initCause(e);
    throw x;
  }
});

代码示例来源:origin: org.eclipse/org.eclipse.osgi

private boolean lockClassName(String classname) {
  synchronized (classNameLocks) {
    Object lockingThread = classNameLocks.get(classname);
    Thread current = Thread.currentThread();
    if (lockingThread == current)
      return false;
    while (true) {
      if (lockingThread == null) {
        classNameLocks.put(classname, current);
        return true;
      }
      try {
        classNameLocks.wait();
        lockingThread = classNameLocks.get(classname);
      } catch (InterruptedException e) {
        current.interrupt();
        throw (LinkageError) new LinkageError(classname).initCause(e);
      }
    }
  }
}

代码示例来源:origin: com.github.veithen.cosmos/cosmos-equinox

private boolean lockClassName(String classname) {
  synchronized (classNameLocks) {
    Object lockingThread = classNameLocks.get(classname);
    Thread current = Thread.currentThread();
    if (lockingThread == current)
      return false;
    boolean previousInterruption = Thread.interrupted();
    try {
      while (true) {
        if (lockingThread == null) {
          classNameLocks.put(classname, current);
          return true;
        }
        classNameLocks.wait();
        lockingThread = classNameLocks.get(classname);
      }
    } catch (InterruptedException e) {
      current.interrupt();
      throw (LinkageError) new LinkageError(classname).initCause(e);
    } finally {
      if (previousInterruption) {
        current.interrupt();
      }
    }
  }
}

代码示例来源:origin: com.sun.xml.ws/jaxws-rt

public SOAPFactory getSOAPFactory() {
  try {
    return SAAJFactory.getSOAPFactory(saajFactoryString);
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: com.sun.xml.ws/jaxws-rt

public MessageFactory getMessageFactory() {
  try {
    return SAAJFactory.getMessageFactory(saajFactoryString); 
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: com.sun.xml.ws/rt

public SOAPFactory getSOAPFactory() {
  try {
    return SAAJFactory.getSOAPFactory(saajFactoryString);
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: com.sun.xml.ws/rt

public MessageFactory getMessageFactory() {
  try {
    return SAAJFactory.getMessageFactory(saajFactoryString); 
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: javaee/metro-jax-ws

public SOAPFactory getSOAPFactory() {
  try {
    return SAAJFactory.getSOAPFactory(saajFactoryString);
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: javaee/metro-jax-ws

public MessageFactory getMessageFactory() {
  try {
    return SAAJFactory.getMessageFactory(saajFactoryString); 
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
}

代码示例来源:origin: com.sun.xml.ws/jaxws-rt

private SOAPVersion(String httpBindingId, String nsUri, String contentType, String implicitRole, String roleAttributeName,
          String saajFactoryString, QName faultCodeMustUnderstand, String faultCodeClientLocalName,
          String faultCodeServerLocalName,Set<String> requiredRoles) {
  this.httpBindingId = httpBindingId;
  this.nsUri = nsUri;
  this.contentType = contentType;
  this.implicitRole = implicitRole;
  this.implicitRoleSet = Collections.singleton(implicitRole);
  this.roleAttributeName = roleAttributeName;
  this.saajFactoryString = saajFactoryString;
  try {
    saajMessageFactory = MessageFactory.newInstance(saajFactoryString);
    saajSoapFactory = SOAPFactory.newInstance(saajFactoryString);
  } catch (SOAPException e) {
    throw new Error(e);
  } catch (NoSuchMethodError e) {
    // SAAJ 1.3 is not in the classpath
    LinkageError x = new LinkageError("You are loading old SAAJ from "+ Which.which(MessageFactory.class));
    x.initCause(e);
    throw x;
  }
  this.faultCodeMustUnderstand = faultCodeMustUnderstand;
  this.requiredRoles = requiredRoles;
  this.faultCodeClient = new QName(nsUri,faultCodeClientLocalName);
  this.faultCodeServer = new QName(nsUri,faultCodeServerLocalName);
}

代码示例来源:origin: stapler/stapler

public void run(JellyBuilder builder) {
    StaplerClosureScript gcs;
    try {
      gcs = (StaplerClosureScript) InvokerHelper.createScript(clazz, new Binding());
    } catch (LinkageError e) {
      throw (LinkageError)new LinkageError("Failed to run "+clazz+" from "+scriptURL).initCause(e);
    }
    gcs.setDelegate(builder);
    gcs.scriptURL = scriptURL;
    gcs.run();
  }
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.osgi

private Class<?> findClassImpl(String name, ClasspathEntry classpathEntry, List<ClassLoaderHook> hooks) {
  if (debug.DEBUG_LOADER)
    Debug.println("ModuleClassLoader[" + classloader.getBundleLoader() + " - " + classpathEntry.getBundleFile() + "].findClassImpl(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$
  String filename = name.replace('.', '/').concat(".class"); //$NON-NLS-1$
  BundleEntry entry = classpathEntry.findEntry(filename);
  if (entry == null)
    return null;
  byte[] classbytes;
  try {
    classbytes = entry.getBytes();
  } catch (IOException e) {
    if (debug.DEBUG_LOADER)
      Debug.println("  IOException reading " + filename + " from " + classpathEntry.getBundleFile()); //$NON-NLS-1$ //$NON-NLS-2$
    throw (LinkageError) new LinkageError("Error reading class bytes: " + name).initCause(e); //$NON-NLS-1$
  }
  if (debug.DEBUG_LOADER) {
    Debug.println("  read " + classbytes.length + " bytes from " + classpathEntry.getBundleFile() + "!/" + filename); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    Debug.println("  defining class " + name); //$NON-NLS-1$
  }
  try {
    return defineClass(name, classbytes, classpathEntry, entry, hooks);
  } catch (Error e) {
    if (debug.DEBUG_LOADER)
      Debug.println("  error defining class " + name); //$NON-NLS-1$
    throw e;
  }
}

相关文章