On May 31, 7:20 pm, Scott Blum <[email protected]> wrote: > On Mon, May 31, 2010 at 12:41 PM, Marko Vuksanovic < > > > > > > [email protected]> wrote: > > I'm working on a distributed build system for gwt and I seem to have > > run into 2 problems. > > > First problem is related to UiBinder. Once I transfer all the files to > > the remote machine (that is src, required jars and result emitted by > > precompile step) I changed the classpath context and executed compile > > perms as follows: > > > new CompilePerms(options).run(logger); > > > where options is an instance of CompilePermsOptions. > > > the error I get is > > > Scanning for additional dependencies: file:/D:/Devel/open-source/ > > gwt-distributed-compiler/agent/0002/src/hr/example/orka/client/panels/ > > MainPanel.java > > Computing all possible rebind results for > > 'hr.example.orka.client.panels.MainPanel.MainPanelUiBinder' > > Rebinding > > hr.tkd.orka.client.panels.MainPanel.MainPanelUiBinder > > Invoking generator > > com.google.gwt.uibinder.rebind.UiBinderGenerator > > [ERROR] Unable to find resource: hr/example/orka/client/ > > panels/MainPanel.ui.xml > > This is the primary error. Are you sure that file is showing up on the > remote machine? Before you invoke the compiler, you can try doing a > classLoader.getResource("hr/example/orka/client/panels/MainPanel.ui.xml") > and make sure it's found.
I'm sure that the file is located on the remote machine. I have checked it manually and the other thing is that once I transfer files to the remote machine and execute compile perms manually as described here (http://code.google.com/p/google-web-toolkit/wiki/ DistributedBuilds - java -cp ... com.google.gwt.dev.CompilePerms com.google.gwt.sample.hello.Hello -workDir work -perms 0 (I adjusted this to my needs, off course)). So, I'm sure that the files are where they should be... I'll try classLoader.getResource("hr/example/orka/ client/panels/MainPanel.ui.xml") in an hour or so - will post the result here. > > Second problem is that once I transfer files to the other machine, > > where the CompilePerms is executed - once everything is finished the > > jar files, which were added to the ClasspathContext using > > URLClasspathLoader don't seem to be unloaded even when the context is > > reverted to what it was before and all the references are set to null. > > > prevClassLoader = Thread.currentThread().getContextClassLoader(); > > URLClassLoader urlClassLoader = URLClassLoader.newInstance( > > classpathURLs.toArray(new URL[] {}), prevClassLoader); > > Thread.currentThread().setContextClassLoader(urlClassLoader); > > > new CompilePerms(options).run(logger); > > //System.gc(); > > //System.gc(); > > Thread.currentThread().setContextClassLoader(prevClassLoader); > > urlClassLoader = null; > > classpathURLs = null; > > > Is it possible that some other classloader, within the gwt code, has > > set some references to hose jars? > > It's probably the refs in ResourceOracleImpl. We keep them around for > hosted mode refresh to be faster. Take a look at that, describe your use > case, and we can talk about how those things can get cleaned up. Well, the use case is basically that I want to have a machine that will be used for compiling different projects. So, once precompile is done and all the necessary data are transfered to the remote machine for compilePerms - the remote machine does the compile perms step and emits some result. That result is then returned to the client which sent the data for processing (compilation). That data, which was sent to be processed, is not necessary on the remote machine, not any more so it should be cleaned up. > Scott -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
