Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » FlatFile cannot be cast to IFlatFolder(Can't deploy maven webapp)
FlatFile cannot be cast to IFlatFolder [message #1065433] Tue, 25 June 2013 16:40 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 4
Registered: August 2011
Junior Member
A few weeks ago I upgraded my macbook pro and since then I can no longer use WTP to launch my webapp. It fails consistently publishing (or trying to) with this error

Could not publish to the server.
org.eclipse.wst.common.componentcore.internal.flat.FlatFile cannot be cast to org.eclipse.wst.common.componentcore.internal.flat.IFlatFolder

This is a servlet+javascript project with maven. So far I have tried
- new workspace and re-import project
- new version of eclipse
- new version of tomcat
- m2e wtp incubator plugin
- all of the above at once

Any help would be appreciated if you have seen this before. Google is finding nothing based on this error

Thanks
Re: FlatFile cannot be cast to IFlatFolder [message #1065436 is a reply to message #1065433] Tue, 25 June 2013 16:53 Go to previous messageGo to next message
Roberto Sanchez Herrera is currently offline Roberto Sanchez HerreraFriend
Messages: 36
Registered: January 2011
Member
Hello,
What version of the products you mentioned are you using? For example, what version of WTP? eclipse? Tomcat? m2e and m2e-wtp?

Was your application working fine with the products mentioned above? and then you upgraded one of the products, and your application stopped working?

Also, do you see a full stack trace? If you do not see it in a dialog, search in the Errors view, or in the workspace log.

Are you using linked resources?

Re: FlatFile cannot be cast to IFlatFolder [message #1065559 is a reply to message #1065436] Wed, 26 June 2013 13:55 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 4
Registered: August 2011
Junior Member
Eclipse Juno service release 2 Build id: 20130225-0426
Tomcat (tried 6.0.18, 7.0.34, 7.0.41)
m2e 1.1.0.20120530-0009
m2e-wtp 0.17.0.20130212-1821
Eclipse Web Developer Tools Version: 3.4.2.v201211061806-7O7MFu3EMkBK01NbrfU9ATE5cdZFz-OoeYjaI4d2

The app was working fine on an older macbook pro on osx 10.6.?. When the machine was replaced (and upgraded to osx 10.8.3) eclipse was copied from the old drive to the new and the problems started.

I have also now tried a few JDK versions (Java 7 latest and Java 6).

The full error from the eclipse log is like so

!ENTRY org.eclipse.wst.server.core 4 0 2013-06-26 09:53:16.077
!MESSAGE Could not publish to the server.
!STACK 0
java.lang.ClassCastException: org.eclipse.wst.common.componentcore.internal.flat.FlatFile cannot be cast to org.eclipse.wst.common.componentcore.internal.flat.IFlatFolder
at org.eclipse.wst.common.componentcore.internal.flat.VirtualComponentFlattenUtility.ensureParentExists(VirtualComponentFlattenUtility.java:216)
at org.eclipse.wst.common.componentcore.internal.flat.VirtualComponentFlattenUtility.addMembers(VirtualComponentFlattenUtility.java:50)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.addNonChildUsedReference(FlatVirtualComponent.java:400)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.addUsedReferences(FlatVirtualComponent.java:306)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.treeWalk(FlatVirtualComponent.java:235)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.cacheResources(FlatVirtualComponent.java:188)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.fetchResources(FlatVirtualComponent.java:118)
at org.eclipse.wst.web.internal.deployables.FlatComponentDeployable.members(FlatComponentDeployable.java:227)
at org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable.members(J2EEFlexProjDeployable.java:267)
at org.eclipse.wst.server.core.internal.ModulePublishInfo.fillCache(ModulePublishInfo.java:294)
at org.eclipse.wst.server.core.internal.ModulePublishInfo.getDelta(ModulePublishInfo.java:376)
at org.eclipse.wst.server.core.internal.ServerPublishInfo.getDelta(ServerPublishInfo.java:366)
at org.eclipse.wst.server.core.internal.Server.getPublishedResourceDelta(Server.java:1574)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.getPublishedResourceDelta(ServerBehaviourDelegate.java:698)
at org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour.getPublishedResourceDelta(TomcatServerBehaviour.java:958)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.computeDelta(ServerBehaviourDelegate.java:874)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:909)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3153)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Re: FlatFile cannot be cast to IFlatFolder [message #1065586 is a reply to message #1065559] Wed, 26 June 2013 15:19 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 4
Registered: August 2011
Junior Member
More interesting notes. I find that if I re-checkout the app to a new directory it will work with the same Eclipse/WTP/etc so the problem has to be with one of the files in the project under the .settings or the .metadata. haven't found the smoking gun yet though
Re: FlatFile cannot be cast to IFlatFolder [message #1129285 is a reply to message #1065586] Tue, 08 October 2013 13:32 Go to previous message
NiS Mising name is currently offline NiS Mising nameFriend
Messages: 2
Registered: July 2009
Location: France
Junior Member
Same problem for me.
My guess is that "something" (maven for eclipse I suppose) changes the file .settings\org.eclipse.wst.common.component

Here is my version that works:
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="beeNotesGallery">
<property name="context-root" value="beeNotesGallery"/>
<wb-resource deploy-path="/" source-path="src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="target/classes"/>
<wb-resource deploy-path="/docs" source-path="/target/site"/>
<property name="java-output-path" value="target/classes"/>
<wb-resource deploy-path="/WEB-INF/lib" source-path="target/beeNotesGallery/WEB-INF/lib"/>
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
</wb-module>
</project-modules>

This working version is automatically changed into the one below that produced the problem in the title:

<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="beeNotesGallery">
<dependent-module archiveName="beeNotesGallery-HTMLHelper-1.0.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/beeNotesGalleryHTMLHelper/beeNotesGalleryHTMLHelper">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="beeNotesGallery-httprequest-1.4.17.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/beeNotesGallery-httprequest/beeNotesGallery-httprequest">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="beeNotesGallery-MQTTHelper-1.0.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/beeNotesGallery-MQTTHelper/beeNotesGallery-MQTTHelper">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="beeNotesGallery-SandboxFilter-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/beeNotesGallery-SandboxFilter/beeNotesGallery-SandboxFilter">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="beeNotesGallery-TagletPackager-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/beeNotesGallery-TagletPackager/beeNotesGallery-TagletPackager">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="beeNotesGallery-utildaw-2.0.2.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/beeNotesGallery-utildaw/beeNotesGallery-utildaw">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module deploy-path="/" handle="module:/overlay/var/M2_REPO/com/digitalairways/beeNotesGallery-Login/1.0-SNAPSHOT/beeNotesGallery-Login-1.0-SNAPSHOT.war?unpackFolder=target/m2e-wtp/overlays&amp;includes=**/**&amp;excludes=META-INF/MANIFEST.MF">
<dependency-type>consumes</dependency-type>
</dependent-module>
<dependent-module deploy-path="/" handle="module:/overlay/slf/?includes=**/**&amp;excludes=META-INF/MANIFEST.MF">
<dependency-type>consumes</dependency-type>
</dependent-module>
<property name="context-root" value="beeNotesGallery"/>
<wb-resource deploy-path="/" source-path="src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="target/classes"/>
<wb-resource deploy-path="/docs" source-path="/target/site"/>
<property name="java-output-path" value="target/classes"/>
<wb-resource deploy-path="/WEB-INF/lib" source-path="target/beeNotesGallery/WEB-INF/lib"/>
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
</wb-module>
</project-modules>

Thanks to BeyondCompare.exe and SVN to help tracking these problems.

This is a workaroung, not a fix. Who has the fix?
Previous Topic:Web Service RunTime
Next Topic:Run on Server isn't copying entire web application
Goto Forum:
  


Current Time: Fri Mar 29 02:10:18 GMT 2024

Powered by FUDForum. Page generated in 0.02612 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top