-
1. Re: Wildfly read project libs
ctomc Oct 24, 2016 11:01 AM (in response to victorbbello)What are you trying to do?
WildFly doesn't use URL classloader but rather Modular classloader.
and as such doesn't really have paths for the modules but module names.
So better question is what are you trying to achieve as there could probably be a different way.
-
2. Re: Wildfly read project libs
victorbbello Oct 24, 2016 11:25 AM (in response to ctomc)Thanks for you answer Tomaz.
What I need to do is take a java file uploaded by a website, compile and execute.
List<String> options = new ArrayList<String>(); options.add("-classpath"); StringBuilder sb = new StringBuilder(); Enumeration<URL> resources = parent.getResources("/"); while (resources.hasMoreElements()) { URL url = resources.nextElement(); sb.append(url.getFile()).append(File.pathSeparator); System.out.println("ADD Lib: " + url); } options.add(sb.toString()); // execute the compiler Boolean call = javac.getTask(null, fileManager, null, options, null, compilationUnits).call();
I need to compile this code using my classpath (which has the libraries needed), otherwise I'll get classnotfound when trying to compile.
-
3. Re: Wildfly read project libs
victorbbello Oct 25, 2016 11:40 AM (in response to ctomc)Any ideas how could I do something similar?
Using wildlfy from Eclipse IDE I can get the URL to my libs and compile the code successfully. The problem happens only when I deploy using wildfly as stadonalone or domain... It also works with tomcat 8.Don't know how to keep up...