Discussion:
[jboss-user] [JBoss Tools] - Making the DirectoryScanner fail
Jesper Skov
2013-01-04 07:42:35 UTC
Permalink
Jesper Skov [https://community.jboss.org/people/jskovjyskebankdk] created the discussion

"Making the DirectoryScanner fail"

To view the discussion, visit: https://community.jboss.org/message/787526#787526

--------------------------------------------------------------
Most of our projects use a custom builder which fetches IVY dependencies and place them in various folders named build/gen-lib*.

This builder has first priority and runs before anything else, intending to make it appear to Eclipse as if the projects had their dependencies checked out with the source (if that makes sense).
It works pretty well and has served us for years.

Part of this design requires some of the build/gen-lib folder to be mentioned in the Deployment Assembly of the project.

Unfortunately, this makes a JBoss Tools 4.0.0.Final plugin unhappy when it scans these folders which may not be created.
(I *think* the Deployment Assembly reference is where your plugin pick the reference, but I'm not sure)

The stack trace looks like this:

java.lang.IllegalStateException: basedir C:\udvikler\ws\plugins\jb.it.reuters\build\gen-lib-deployable is not a directory
    at org.jboss.ide.eclipse.archives.core.asf.DirectoryScanner.scanPrepare(DirectoryScanner.java:552)
    at org.jboss.ide.eclipse.archives.core.asf.DirectoryScanner.scan(DirectoryScanner.java:588)
    at org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory.createDirectoryScanner(DirectoryScannerFactory.java:66)
    at org.jboss.ide.eclipse.archives.webtools.filesets.vcf.WorkspaceFilesetVirtualComponent$WorkspaceFilter.<init>(WorkspaceFilesetVirtualComponent.java:100)
    at org.jboss.ide.eclipse.archives.webtools.filesets.vcf.WorkspaceFilesetVirtualComponent.getRootFolder(WorkspaceFilesetVirtualComponent.java:53)
    at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.consumeComponent(FlatVirtualComponent.java:203)
    at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.addConsumedReferences(FlatVirtualComponent.java:196)
    at org.eclipse.jst.j2ee.internal.common.ClasspathLibraryExpander.optimize(ClasspathLibraryExpander.java:47)
    at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.cacheResources(FlatVirtualComponent.java:119)
    at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.fetchResources(FlatVirtualComponent.java:101)
    at org.eclipse.jst.j2ee.internal.common.ClasspathLibraryExpander.fetchResource(ClasspathLibraryExpander.java:74)
    at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.getBaseEARLibRefs(J2EEComponentClasspathContainer.java:463)
    at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.requiresUpdate(J2EEComponentClasspathContainer.java:208)
    at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathContainer.refresh(J2EEComponentClasspathContainer.java:540)
    at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob.processModules(J2EEComponentClasspathUpdater.java:311)
    at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob.access$4(J2EEComponentClasspathUpdater.java:295)
    at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob$1.run(J2EEComponentClasspathUpdater.java:336)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater$ModuleUpdateJob.run(J2EEComponentClasspathUpdater.java:321)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

I guess I'm really the one making your plugin fail, so I will probably make our plugin create those folders earlier.

But you may want to handle non-existent folders in your scanner differently (either silently, or maybe create a Marker describing the apparently bad configuration for the developer).

Cheers,
Jesper
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/787526#787526]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Max Rydahl Andersen
2013-01-07 11:22:27 UTC
Permalink
Max Rydahl Andersen [https://community.jboss.org/people/maxandersen] created the discussion

"Re: Making the DirectoryScanner fail"

To view the discussion, visit: https://community.jboss.org/message/788722#788722

--------------------------------------------------------------
Jesper, better if you open a bug report on this one and if you could give the exact setup you have done in deployment assembly to reproduce! Thanks!
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/788722#788722]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Jesper Skov
2013-01-07 11:45:27 UTC
Permalink
Jesper Skov [https://community.jboss.org/people/jskovjyskebankdk] created the discussion

"Re: Making the DirectoryScanner fail"

To view the discussion, visit: https://community.jboss.org/message/788726#788726

--------------------------------------------------------------
done: https://issues.jboss.org/browse/JBIDE-13346 https://issues.jboss.org/browse/JBIDE-13346
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/788726#788726]

Start a new discussion in JBoss Tools at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]
Loading...