类java.lang.ClassNotFoundException源码实例Demo

下面列出了怎么用java.lang.ClassNotFoundException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码2 项目: TencentKona-8   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码3 项目: native-obfuscator   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码4 项目: jdk8u60   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码5 项目: openjdk-jdk8u   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码6 项目: openjdk-jdk8u-backup   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码7 项目: openjdk-jdk9   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        loader.defineClass("BadParams", BadParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码8 项目: jdk8u-jdk   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码9 项目: hottub   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码10 项目: openjdk-8-source   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码11 项目: gemfirexd-oss   文件: RunList.java
/**
* RunList
* suitesToRun: a Vector of suites from RunSuite
* outDir: The output directory for the suite(s)
* pwOut: The output for writing suite and test results
* suiteProperties: From RunSuite for the top suite
* (individual suites in the vector may have their own
* properties which must also be located and applied)
*/

public RunList(Vector suitesToRun, 
    File runDir, File outDir, PrintWriter pwOut,
    Properties suiteProperties, 
    Properties specialProperties, 
    String topParentSuite)
    throws ClassNotFoundException, IOException, Exception
{
    this.runDir = runDir;
    this.outDir = outDir;
    this.pwOut = pwOut;
    this.suiteProperties = suiteProperties; // usual suite props
    this.specialProperties = specialProperties; // for special test Flags
    this.topSuiteName = suiteProperties.getProperty("suitename");
    //System.out.println("----------------------------------------");
    //System.out.println("RunList topSuiteName= " + topSuiteName);
    this.topParentSuite = topParentSuite;
    //System.out.println("topParentSuite= " + topParentSuite);

    // Run the suites
    runSuites(suitesToRun);
}
 
源代码12 项目: gemfirexd-oss   文件: RunTest.java
static void verifyTestType()
      throws ClassNotFoundException, FileNotFoundException, IOException
  {
      //java requires '/' as separator to look into jar, irrespective of OS
      InputStream is =
          loadTestResource("harness/testtypes.properties");
Properties p = new Properties();
p.load(is);
      String testtypes = p.getProperty("testtypes");
   StringTokenizer st = new StringTokenizer(testtypes,",");
   String ttype = "";
      while (st.hasMoreTokens())
      {
          ttype = st.nextToken();
          if ( testType.equals(ttype) )
              return;
      }
      // Not a known test type
      System.out.println("Unknown test type: " + testType);
      System.exit(1);
  }
 
源代码13 项目: openjdk-8   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码14 项目: jdk8u_jdk   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码15 项目: gemfirexd-oss   文件: RunList.java
/**
* RunList
* suitesToRun: a Vector of suites from RunSuite
* outDir: The output directory for the suite(s)
* pwOut: The output for writing suite and test results
* suiteProperties: From RunSuite for the top suite
* (individual suites in the vector may have their own
* properties which must also be located and applied)
*/

public RunList(Vector suitesToRun, 
    File runDir, File outDir, PrintWriter pwOut,
    Properties suiteProperties, 
    Properties specialProperties, 
    String topParentSuite)
    throws ClassNotFoundException, IOException, Exception
{
    this.runDir = runDir;
    this.outDir = outDir;
    this.pwOut = pwOut;
    this.suiteProperties = suiteProperties; // usual suite props
    this.specialProperties = specialProperties; // for special test Flags
    this.topSuiteName = suiteProperties.getProperty("suitename");
    //System.out.println("----------------------------------------");
    //System.out.println("RunList topSuiteName= " + topSuiteName);
    this.topParentSuite = topParentSuite;
    //System.out.println("topParentSuite= " + topParentSuite);

    // Run the suites
    runSuites(suitesToRun);
}
 
源代码16 项目: gemfirexd-oss   文件: RunTest.java
static void verifyTestType()
      throws ClassNotFoundException, FileNotFoundException, IOException
  {
      //java requires '/' as separator to look into jar, irrespective of OS
      InputStream is =
          loadTestResource("harness/testtypes.properties");
Properties p = new Properties();
p.load(is);
      String testtypes = p.getProperty("testtypes");
   StringTokenizer st = new StringTokenizer(testtypes,",");
   String ttype = "";
      while (st.hasMoreTokens())
      {
          ttype = st.nextToken();
          if ( testType.equals(ttype) )
              return;
      }
      // Not a known test type
      System.out.println("Unknown test type: " + testType);
      System.exit(1);
  }
 
源代码17 项目: jdk8u-jdk   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码18 项目: jdk8u-dev-jdk   文件: BadClassFiles.java
private BadClassFiles() throws ClassNotFoundException {
    classes = new Class<?>[] {
        loader.defineClass("EmptyName", EmptyName_bytes),
        loader.defineClass("BadModifiers", BadModifiers_bytes),
        loader.defineClass("BadNameIndex", BadNameIndex_bytes),
        loader.defineClass("NameIndexOutOfBounds", NameIndexOutOfBounds_bytes),
        loader.defineClass("ExtraParams", ExtraParams_bytes),
        // Name with .
        loader.defineClass("BadName1", BadName1_bytes),
        // Name with [
        loader.defineClass("BadName2", BadName2_bytes),
        // Name with ;
        loader.defineClass("BadName3", BadName3_bytes),
        // Name with /
        loader.defineClass("BadName4", BadName4_bytes)
    };
}
 
源代码19 项目: spliceengine   文件: RunList.java
/**
* RunList
* suitesToRun: a Vector of suites from RunSuite
* outDir: The output directory for the suite(s)
* pwOut: The output for writing suite and test results
* suiteProperties: From RunSuite for the top suite
* (individual suites in the vector may have their own
* properties which must also be located and applied)
*/

public RunList(Vector suitesToRun, 
    File runDir, File outDir, PrintWriter pwOut,
    Properties suiteProperties, 
    Properties specialProperties, 
    String topParentSuite)
    throws ClassNotFoundException, IOException, Exception
{
    this.runDir = runDir;
    this.outDir = outDir;
    this.pwOut = pwOut;
    this.suiteProperties = suiteProperties; // usual suite props
    this.specialProperties = specialProperties; // for special test Flags
    this.topSuiteName = suiteProperties.getProperty("suitename");
    //System.out.println("----------------------------------------");
    //System.out.println("RunList topSuiteName= " + topSuiteName);
    this.topParentSuite = topParentSuite;
    //System.out.println("topParentSuite= " + topParentSuite);

    // Run the suites
    runSuites(suitesToRun);
}
 
源代码20 项目: gemfirexd-oss   文件: RunSuite.java
static void BuildSuitesVector(String parent, String subsuites)
    throws ClassNotFoundException, IOException
{
    Properties p;
    StringTokenizer st = new StringTokenizer(subsuites);
    String child = "";
    while (st.hasMoreTokens())
    {
        child = st.nextToken();
        if (child.equals(parent))
        {
            suitesToRun.addElement(parent+":"+child);
            //System.out.println("Add this: " + parent+":"+child);
        }
        else
        {
            p = getSuiteProperties(child, false);
            if ( p.getProperty("suites") == null )
            {
                suitesToRun.addElement(parent+":"+child);
                //System.out.println("Add this: " + parent+":"+child);
            }
            else
            {
                String moresuites = p.getProperty("suites");
                BuildSuitesVector(child, moresuites);
            }
        }
    }
}
 
源代码21 项目: gemfirexd-oss   文件: RegionEventImpl.java
/**
 * Reads the contents of this message from the given input.
 */
public void fromData(DataInput in) throws IOException, ClassNotFoundException
{
  this.regionPath = DataSerializer.readString(in);
  this.callbackArgument = DataSerializer.readObject(in);
  this.op = Operation.fromOrdinal(in.readByte());
  this.originRemote = in.readBoolean();
  this.distributedMember = DSFIDFactory.readInternalDistributedMember(in);
  this.diskException = DataSerializer.readObject(in);
}
 
源代码22 项目: journaldev   文件: SocketServerExample.java
public static void main(String args[]) throws IOException, ClassNotFoundException{
    //create the socket server object
    server = new ServerSocket(port);
    //keep listens indefinitely until receives 'exit' call or program terminates
    while(true){
        System.out.println("Waiting for client request");
        //creating socket and waiting for client connection
        Socket socket = server.accept();
        //read from socket to ObjectInputStream object
        ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
        //convert ObjectInputStream object to String
        String message = (String) ois.readObject();
        System.out.println("Message Received: " + message);
        //create ObjectOutputStream object
        ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
        //write object to Socket
        oos.writeObject("Hi Client "+message);
        //close resources
        ois.close();
        oos.close();
        socket.close();
        //terminate the server if client sends exit request
        if(message.equalsIgnoreCase("exit")) break;
    }
    System.out.println("Shutting down Socket server!!");
    //close the ServerSocket object
    server.close();
}
 
源代码23 项目: gemfirexd-oss   文件: RunSuite.java
static void BuildSuitesVector(String parent, String subsuites)
    throws ClassNotFoundException, IOException
{
    Properties p;
    StringTokenizer st = new StringTokenizer(subsuites);
    String child = "";
    while (st.hasMoreTokens())
    {
        child = st.nextToken();
        if (child.equals(parent))
        {
            suitesToRun.addElement(parent+":"+child);
            //System.out.println("Add this: " + parent+":"+child);
        }
        else
        {
            p = getSuiteProperties(child, false);
            if ( p.getProperty("suites") == null )
            {
                suitesToRun.addElement(parent+":"+child);
                //System.out.println("Add this: " + parent+":"+child);
            }
            else
            {
                String moresuites = p.getProperty("suites");
                BuildSuitesVector(child, moresuites);
            }
        }
    }
}
 
源代码24 项目: gemfirexd-oss   文件: RegionEventImpl.java
/**
 * Reads the contents of this message from the given input.
 */
public void fromData(DataInput in) throws IOException, ClassNotFoundException
{
  this.regionPath = DataSerializer.readString(in);
  this.callbackArgument = DataSerializer.readObject(in);
  this.op = Operation.fromOrdinal(in.readByte());
  this.originRemote = in.readBoolean();
  this.distributedMember = DSFIDFactory.readInternalDistributedMember(in);
  this.diskException = DataSerializer.readObject(in);
}
 
源代码25 项目: pluotsorbet   文件: constructor.java
/**
 * Runs the test using the specified harness.
 *
 * @param harness  the test harness (<code>null</code> not permitted).
 */
public void test(TestHarness harness)
{
    ClassNotFoundException object1 = new ClassNotFoundException();
    harness.check(object1 != null);
    harness.check(object1.toString(), "java.lang.ClassNotFoundException");

    ClassNotFoundException object2 = new ClassNotFoundException("nothing happens");
    harness.check(object2 != null);
    harness.check(object2.toString(), "java.lang.ClassNotFoundException: nothing happens");

    ClassNotFoundException object3 = new ClassNotFoundException(null);
    harness.check(object3 != null);
    harness.check(object3.toString(), "java.lang.ClassNotFoundException");
}
 
源代码26 项目: pluotsorbet   文件: TryCatch.java
/**
 * Runs the test using the specified harness.
 *
 * @param harness  the test harness (<code>null</code> not permitted).
 */
public void test(TestHarness harness)
{
    // flag that is set when exception is caught
    boolean caught = false;
    try {
        throw new ClassNotFoundException("ClassNotFoundException");
    }
    catch (ClassNotFoundException e) {
        // correct exception was caught
        caught = true;
    }
    harness.check(caught);
}
 
源代码27 项目: spliceengine   文件: RunSuite.java
static void BuildSuitesVector(String parent, String subsuites)
    throws ClassNotFoundException, IOException
{
    Properties p;
    StringTokenizer st = new StringTokenizer(subsuites);
    String child = "";
    while (st.hasMoreTokens())
    {
        child = st.nextToken();
        if (child.equals(parent))
        {
            suitesToRun.addElement(parent+":"+child);
            //System.out.println("Add this: " + parent+":"+child);
        }
        else
        {
            p = getSuiteProperties(child, false);
            if ( p.getProperty("suites") == null )
            {
                suitesToRun.addElement(parent+":"+child);
                //System.out.println("Add this: " + parent+":"+child);
            }
            else
            {
                String moresuites = p.getProperty("suites");
                BuildSuitesVector(child, moresuites);
            }
        }
    }
}
 
源代码28 项目: dragonwell8_jdk   文件: BadClassFiles.java
public static void main(String... args)
    throws NoSuchMethodException, IOException, ClassNotFoundException {
    new BadClassFiles().run();
}
 
源代码29 项目: TencentKona-8   文件: BadClassFiles.java
public static void main(String... args)
    throws NoSuchMethodException, IOException, ClassNotFoundException {
    new BadClassFiles().run();
}
 
源代码30 项目: native-obfuscator   文件: BadClassFiles.java
public static void main(String... args)
    throws NoSuchMethodException, IOException, ClassNotFoundException {
    new BadClassFiles().run();
}
 
 类所在包
 同包方法