Tuscany webapps doesn't work with JBoss AS 4.x
----------------------------------------------

                 Key: TUSCANY-2702
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2702
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Core Runtime
    Affects Versions: Java-SCA-1.3.2
         Environment: JBoss AS 4.x
            Reporter: Jose Luis Alba
             Fix For: Java-SCA-1.3.2


After a lot of debugging I've found what's happening with JBoss (versions 4.x, 
on 5 it's solved) and Tuscany.
Here it goes:

1. We are at ContributionServiceImpl of the Tuscany 1.3.2 source, lines 357-369.
2. URL points to the directory of a SCA webapp directory deployed in JBoss.

When running in JBoss the URL.getConnection() returns an instance of 
sun.net.www.protocol.file.FileURLConnection.
The FileUrlConnection when invokes the getInputStream() tries to instantiate a 
FileInputStream.
Here URL points to a directory (calculator-sample-webapp.war for example), then 
FileInputStream throws
a FileNotFoundException (see FileInputStream signature in javadocs). On windows 
machines the
error message is 'Access Denied' (?) and on Unix machines the error message is 
'Is not a Directory'
(more accurate).

After reading all sources of PackageProcessor (the ones using the InputStream 
obtained from
the URLConnection) I've seen that only JarContributionProcessor uses the 
InputStream object.
FolderContributionProcessor, the one who reads directories, don't uses the 
InputStream object.

Then, temporary, I've changed the code to:

        try {
            if (!new File(sourceURL.toURI()).isDirectory()) {
            // lines 357 to 369
            }
        } catch (URISyntaxException ex) {
            ex.printStackTrace();
        }
        
And it worked fine.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to