Dan Allen [https://community.jboss.org/people/dan.j.allen] created the 
discussion

"Re: How do we use JBoss Tools with the JBoss AS 7 Fedora package?"

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

--------------------------------------------------------------
Oh, duh. You're right, it's not m2e. The META-INF/MANIFEST.MF (from 
target/m2e-wtp/web-resources) just happens to be the first file the publisher 
is attempting to copy to the deployment directory.

Anyway, I found the bug. Just as I suspected, somewhere in the 
org.jboss.ide.eclipse.as.core plugin, the custom tempDeployDirectory is not 
being respected. I found it in the worst of places, the generic copyFile() 
method, which is responsible for copying all the web resources to the 
deployment folder. copyFile() calls writeToTempFile(), which calls 
getTempFolder() and that's where the wrong temp folder is choosen.

Here's the offending code in  
http://anonsvn.jboss.org/repos/jbosstools/trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/LocalCopyCallback.java
 org.jboss.ide.eclipse.as.core.server.xpl.LocalCopyCallback:

protected File getTempFolder() {
    File f = null;
    if (tmpDeployRootFolder != null) {
        f = tmpDeployRootFolder.toFile();
    }
    // ^^^ Bad logic
    else if (server != null) {
        String path = 
ServerConverter.getDeployableServer(server).getTempDeployFolder();
        f = new File(path);
    }
    else {
        return tempDir;
    }
    if (!f.exists())
        f.mkdirs();
    return f;
}


Notice that the method +first+ looks to see if the server has a temp deploy 
folder in the installation root (e.g., JBOSS_HOME/standalone/tmp). Of course, 
the JBoss AS 7 installation *does* have this folder, but it +should not+ be 
used if a custom tempDeployDir is specified. Only if this folder is missing 
(which it never will be) does this existing code honor the tempDeployDir 
setting. That's a bug.

That explains why the JBoss Tools server is attempting to write to 
/usr/share/jboss-as/standalone/tmp and thus why the deployment is failing.
--------------------------------------------------------------

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

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