1 2 Previous Next 22 Replies Latest reply: Jun 4, 2012 1:06 PM by Dan Allen Go to original post RSS
  • 15. Re: How do we use JBoss Tools with the JBoss AS 7 Fedora package?
    Dan Allen Master

    I figured out the problem. The Maven Integration for Eclipse plugin is attempting to write a file to the JBOSS_HOME/standalone/tmp directory, even when the temporary deploy directory is specified elsewhere. I caught it trying to write this file:

     

    /var/cache/jboss-as/standalone/tmp/tmp3463101666163615035.MF

    Manifest-Version: 1.0
    Built-By: fedora
    Build-Jdk: 1.7.0_b147-icedtea
    Created-By: Maven Integration for Eclipse
    

     

    If I change the ownership of the tmp directory to the current user, the deployment succeeds (all the files are copied into the specified deploy directory).

     

    A quickfix for this problem is to make this tmp directory world writable (i.e., chmod 777) or to add the current user to the jboss-as group, since the directory is currently setup as:

     

    drwxrwxr-x. 5 fedora jboss-as 4096 /var/cache/jboss-as/standalone/tmp
    

     

    So now we know. Look for the code that writes this temporary file.

  • 16. Re: How do we use JBoss Tools with the JBoss AS 7 Fedora package?
    Dan Allen Master

    Btw, I think solving this problem would also solve the problem where Eclipse can't rename a file across a file system boundary (as described in this forum thread: 'Publishing to JBoss 7.1 Runtime Server...' has encountered a problem). Eclipse should not be touching the root file system where JBoss AS is installed, so there would be no file system crossing. It should only be writing to the deploy locations specified in the user's home directory.

  • 17. Re: How do we use JBoss Tools with the JBoss AS 7 Fedora package?
    Max Rydahl Andersen Master

    m2e eclipse aint writing to any JBoss installation - at least not intentionally The file is just what m2e will create in your project and we copy over when generated.

     

    What does happen is that JBoss Tools writes to the temporary directory it is told to write to under the deployment folder - can you triple check that this directory is actually set to a place where JBoss Tools can and should be able to write to ?

  • 18. Re: How do we use JBoss Tools with the JBoss AS 7 Fedora package?
    Dan Allen Master

    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 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.

  • 19. Re: How do we use JBoss Tools with the JBoss AS 7 Fedora package?
    Max Rydahl Andersen Master

    Kudos for looking at the code

     

    But I believe your intepretation of it is wrong - tmpDeployRootFolder refer to the root of the tmp deploy folder configured in the UI  - it is the tempdeployDir, not the server root. It is only in case this directory does not exist we attempt usig the server's temporary deploy folder.

     

    But problem is then AS7's getTempDeployFolder is bogus - so that bug is now found and Rob is working on it

     

    ....but this also means that if you actually go and set the temp deploy directory this should just work! Are you 1000% sure you have set the temp deploy directory?

  • 20. Re: How do we use JBoss Tools with the JBoss AS 7 Fedora package?
    Rob Stryker Master

    I have traced it even further back, howerver, and discovered the problem lives in JBoss71Server...  That's the class where it should be returning different values for metadata vs server vs custom deployment location, and that's the file where it wasn't doing it.  The class you mention is functioning exactly as desired, but JBoss71Server was the one ignoring what should be happening.

     

    https://issues.jboss.org/browse/JBIDE-12090 tracks the bug, and its progress

  • 21. Re: How do we use JBoss Tools with the JBoss AS 7 Fedora package?
    Max Rydahl Andersen Master

    Dan, thanks for hunting this down - turned out as Rob says AS7 server forced this tmp folder all the time.

     

    been fixed and will be in CR1 release.

     

    Until then - workaround is that you have write access to that tmp folder for your AS7 installation.

  • 22. Re: How do we use JBoss Tools with the JBoss AS 7 Fedora package?
    Dan Allen Master

    Hooray!!!!!! Mission accomplished. Great job hunting this down Rob and Max. This is a nice win. I'm definitely going to showcase this integration at JAX.

1 2 Previous Next