Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8154448

I am uploading a .java file through UI and this file is complied and loading successfully in web application. But, when I give it to Quartz

XMLWordPrintable

    • x86
    • windows_8

      FULL PRODUCT VERSION :
      java version "1.8.0_73"
      java(TM) SE Runtime Environment (build 1.8.0_73-b02)
      java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft windows [6.3.9600]

      A DESCRIPTION OF THE PROBLEM :
      An exception has occurred in the compiler (1.8.0_25). Please file a bug at the J
      ava Developer Connection (http://java.sun.com/webapps/bugreport) after checking
       the Bug Parade for duplicates. Include your program and the following diagnosti
      c in your report. Thank you.
      java.lang.NullPointerException
              at com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:60)
              at com.sun.tools.javac.main.Main.compile(Main.java:414)
              at com.sun.tools.javac.main.Main.compile(Main.java:381)
              at com.sun.tools.javac.main.Main.compile(Main.java:370)
              at com.sun.tools.javac.main.Main.compile(Main.java:361)
              at com.sun.tools.javac.Main.compile(Main.java:56)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run web application in tomcat, upload a .java file, then compile it and create object using Class.forName().


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      expecting an object of the uploaded file
      ACTUAL -
      An exception has occurred in the compiler (1.8.0_25). Please file a bug at the J
      ava Developer Connection (http://java.sun.com/webapps/bugreport) after checking
       the Bug Parade for duplicates. Include your program and the following diagnosti
      c in your report. Thank you.
      java.lang.NullPointerException
              at com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:60)
              at com.sun.tools.javac.main.Main.compile(Main.java:414)
              at com.sun.tools.javac.main.Main.compile(Main.java:381)
              at com.sun.tools.javac.main.Main.compile(Main.java:370)
              at com.sun.tools.javac.main.Main.compile(Main.java:361)
              at com.sun.tools.javac.Main.compile(Main.java:56)

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      An exception has occurred in the compiler (1.8.0_25). Please file a bug at the J
      ava Developer Connection (http://java.sun.com/webapps/bugreport) after checking
       the Bug Parade for duplicates. Include your program and the following diagnosti
      c in your report. Thank you.
      java.lang.NullPointerException
              at com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:60)
              at com.sun.tools.javac.main.Main.compile(Main.java:414)
              at com.sun.tools.javac.main.Main.compile(Main.java:381)
              at com.sun.tools.javac.main.Main.compile(Main.java:370)
              at com.sun.tools.javac.main.Main.compile(Main.java:361)
              at com.sun.tools.javac.Main.compile(Main.java:56)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      int errorCode = com.sun.tools.javac.Main.compile(new String[] { "-classpath", "bin", "-cp",
      ".;"+PATHCONST.TOOLS + ";" + PATHCONST.QUARTZ + ";" + PATHCONST.JUNIT + ";" + PATHCONST.SELENIUM_JAVA + ";" + PATHCONST.SELENIUM_SERVER + ";"
      + System.getProperty("java.class.path"),
      "-d", PATHCONST.TOMCAT_CLASSES_PATH, className });

      Method method = URLClassLoader.class.getDeclaredMethod("addURL", new Class[]{URL.class});
      method.setAccessible(true);
      method.invoke(ClassLoader.getSystemClassLoader(), new Object[]{new File(ClassFilePath).toURI().toURL()});
      // ClassLoader cload = new URLClassLoader(new URL[] { new File(PATHCONST.TOMCAT_CLASSES_PATH).toURI().toURL() },
      // Thread.currentThread().getContextClassLoader());

      System.out.println("errorcode and cload : "+errorCode+" "+method+"\njars n file path"+PATHCONST.JUNIT);

      Class c1= Class.forName(fileN);
      System.out.println("class is :"+c1);
      return c1;
      ---------- END SOURCE ----------

      SUPPORT :
      YES

            aroy Abhijit Roy (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: