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]

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to