Examples of URLClassLoader


Examples of java.net.URLClassLoader

        // What is this ??
        urls.add(new File(clctxt.getRealPath("/")).getCanonicalFile().toURL());

        URL urlsA[]=new URL[urls.size()];
        urls.toArray(urlsA);
        loader = new URLClassLoader(urlsA, this.getClass().getClassLoader());

    }
View Full Code Here

Examples of java.net.URLClassLoader

        urls.add(new File(
                clctxt.getRealPath("/")).getCanonicalFile().toURI().toURL());

        URL urlsA[]=new URL[urls.size()];
        urls.toArray(urlsA);
        loader = new URLClassLoader(urlsA, this.getClass().getClassLoader());

    }
View Full Code Here

Examples of java.net.URLClassLoader

          // HACK for now
          compileClassPath = compileClassPath.replace("jre", "jdk");
          compileClassPath += "/lib/tools.jar";
          info.append("    checking default compiler in " + compileClassPath + "\n");
          try {
            javaCompiler = Class.forName(compiler, true, new URLClassLoader(new URL[] { new URL("file",
                "localhost", compileClassPath) }));
          } catch (Error er) {
            log.error("Setting up Java compiler error ", er);
          } catch (Exception ex) {
            log.error("Setting up Java compiler exception ", ex);
View Full Code Here

Examples of java.net.URLClassLoader

        // What is this ??
        urls.add(new File(clctxt.getRealPath("/")).getCanonicalFile().toURL());

        URL urlsA[]=new URL[urls.size()];
        urls.toArray(urlsA);
        loader = new URLClassLoader(urlsA, this.getClass().getClassLoader());

    }
View Full Code Here

Examples of java.net.URLClassLoader

                    try {
                        //
                        // we need to pass context classloader here, so the jsps can reference /WEB-INF/classes and
                        // /WEB-INF/lib. JspCompilationContext would only take URLClassLoader, so we fake it
                        //
                        URLClassLoader classLoader = new URLClassLoader(new URL[]{}, context.getLoader().getClassLoader());
                        for (Iterator it = names.iterator(); it.hasNext();) {
                            String name = (String) it.next();
                            long time = System.currentTimeMillis();
                            JspCompilationContext jcctx = createJspCompilationContext(name, false, opt, sctx, jrctx, classLoader);
                            ClassLoader prevCl = ClassUtils.overrideThreadContextClassLoader(classLoader);
View Full Code Here

Examples of java.net.URLClassLoader

                    //
                    // we need to pass context classloader here, so the jsps can reference /WEB-INF/classes and
                    // /WEB-INF/lib. JspCompilationContext would only take URLClassLoader, so we fake it
                    //
                    compileItem("/", opt, context, jrctx, summary,
                            new URLClassLoader(new URL[]{}, context.getLoader().getClassLoader()), 0, compile);
                } finally {
                    jrctx.destroy();
                }
            }
View Full Code Here

Examples of java.net.URLClassLoader

//            catch (IOException e) {
//                Plugin.getDefault().logError("Unable to locate java library location for code completion.", e);
//            }                      
//        }
       
        return new URLClassLoader(jarURLs.toArray(new URL[0]));
    }
View Full Code Here

Examples of java.net.URLClassLoader

      this.obj = obj;
    }
  }
 
  @Test public void testDeserializationUnknownException() throws Exception {
    ClassLoader cl = new URLClassLoader(new URL[] {UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
    Object obj = ReflectionHelper.create("test.Test", null, cl); //$NON-NLS-1$
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(new ExceptionHolder(new BadException(obj)));
View Full Code Here

Examples of java.net.URLClassLoader

        assertTrue(e instanceof SQLException);
        assertEquals("Remote java.sql.SQLException: something bad happended", e.getMessage()); //$NON-NLS-1$
 
 
  @Test public void testDeserializationUnknownChildException2() throws Exception {
    ClassLoader cl = new URLClassLoader(new URL[] {UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
    ArrayList<String> args = new ArrayList<String>();
    args.add("Unknown Exception"); //$NON-NLS-1$
    Exception obj = (Exception)ReflectionHelper.create("test.UnknownException", args, cl); //$NON-NLS-1$
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

Examples of java.net.URLClassLoader

        m.invoke(serverOld);
    }

    private static ClassLoader getClassLoader(String jarFile) throws Exception {
        URL[] urls = { new URL(jarFile) };
        return new URLClassLoader(urls, null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.