You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by George Stanchev <Gs...@serena.com> on 2006/12/06 22:27:50 UTC

small problem with FileSystemConfigurator

Hi,
 
I checked both the axis2 1.1 tag and the trunk. This file: 
 
org.apache.axis2.deployment.FileSystemConfigurator.FileSystemConfigurator(String, String)
 
has a bug in it right there where the repoLocation is determined if it is valid or not (lines 57-69):
 
       try {
            if (repoLocation != null) {
                File repo = new File(repoLocation);
                if (repo.exists()) {
                    // ok, save it if so
                    this.repoLocation = repo.getAbsolutePath();
                }
            }
        } catch (Exception e) {
            log.info("Couldn't find repository location '" +
                    repoLocation + "'");
            this.repoLocation = null;
        }
 
So if the repo path is invalid, the repo.exists() will be false and
the block will complete gracefully without logging the condition (that
repo location does not exist). The java.io.File.File(String) constructor
will throw an exception only if the argument is null, which in our case
obviously it is not. So that catch() block is a bit pointless unless it is
intended for the SecurityException possibly thrown by File.getAbsolutePath()
but then the message is wrong.
 
FileSystemConfigurator is used by createConfigurationContextFromFileSystem
method which can throw AxisFaults. I think FileSystemConfigurator should
throw an exception if the repoLocation or axis2xlm are not found on the system
instead of merely logging it and falling through the default configuration load.
Otherwise the problem will snowball later on when the default axis2.xml is loaded,
modules fail to engage etc and make the user wonder what is going on, like it was
in my case.
 
At the very least, besides fixing this problem, log it with error() severity. info() is
too low for supplied-but-not-found configuration loading.
 
Let me know if you need a JIRA opened for this.
 
Thanks,
 
George Stanchev

**********************************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.


RE: small problem with FileSystemConfigurator

Posted by George Stanchev <Gs...@serena.com>.
http://issues.apache.org/jira/browse/AXIS2-1839
George Stanchev
________________________________

From: Deepal Jayasinghe [mailto:deepal@opensource.lk]
Sent: Wed 12/6/2006 2:33 PM
To: axis-dev@ws.apache.org
Subject: Re: small problem with FileSystemConfigurator


Hi George ;

Thanks you for finding this , can you do one more step :) , please
create a JIRA.

Thanks
Deepal

> Hi,
> 
> I checked both the axis2 1.1 tag and the trunk. This file:
> 
> org.apache.axis2.deployment.FileSystemConfigurator.FileSystemConfigurator(String,
> String)
> 
> has a bug in it right there where the repoLocation is determined if it
> is valid or not (lines 57-69):
> 
>        try {
>             if (repoLocation != null) {
>                 File repo = new File(repoLocation);
>                 if (repo.exists()) {
>                     // ok, save it if so
>                     this.repoLocation = repo.getAbsolutePath();
>                 }
>             }
>         } catch (Exception e) {
>             log.info("Couldn't find repository location '" +
>                     repoLocation + "'");
>             this.repoLocation = null;
>         }
> 
> So if the repo path is invalid, the repo.exists() will be false and
> the block will complete gracefully without logging the condition (that
> repo location does not exist). The java.io.File.File(String) constructor
> will throw an exception only if the argument is null, which in our case
> obviously it is not. So that catch() block is a bit pointless unless it is
> intended for the SecurityException possibly thrown by
> File.getAbsolutePath()
> but then the message is wrong.
> 
> FileSystemConfigurator is used by createConfigurationContextFromFileSystem
> method which can throw AxisFaults. I think FileSystemConfigurator should
> throw an exception if the repoLocation or axis2xlm are not found on
> the system
> instead of merely logging it and falling through the default
> configuration load.
> Otherwise the problem will snowball later on when the default
> axis2.xml is loaded,
> modules fail to engage etc and make the user wonder what is going on,
> like it was
> in my case.
> 
> At the very least, besides fixing this problem, log it with error()
> severity. info() is
> too low for supplied-but-not-found configuration loading.
> 
> Let me know if you need a JIRA opened for this.
> 
> Thanks,
> 
> George Stanchev
>
> **********************************************************************
>
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the intended recipient,
> please contact the sender by reply e-mail and destroy all copies of
> the original message.
>

--
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org




Re: small problem with FileSystemConfigurator

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi George ;

Thanks you for finding this , can you do one more step :) , please
create a JIRA.

Thanks
Deepal

> Hi,
>  
> I checked both the axis2 1.1 tag and the trunk. This file:
>  
> org.apache.axis2.deployment.FileSystemConfigurator.FileSystemConfigurator(String,
> String)
>  
> has a bug in it right there where the repoLocation is determined if it
> is valid or not (lines 57-69):
>  
>        try {
>             if (repoLocation != null) {
>                 File repo = new File(repoLocation);
>                 if (repo.exists()) {
>                     // ok, save it if so
>                     this.repoLocation = repo.getAbsolutePath();
>                 }
>             }
>         } catch (Exception e) {
>             log.info("Couldn't find repository location '" +
>                     repoLocation + "'");
>             this.repoLocation = null;
>         }
>  
> So if the repo path is invalid, the repo.exists() will be false and
> the block will complete gracefully without logging the condition (that
> repo location does not exist). The java.io.File.File(String) constructor
> will throw an exception only if the argument is null, which in our case
> obviously it is not. So that catch() block is a bit pointless unless it is
> intended for the SecurityException possibly thrown by
> File.getAbsolutePath()
> but then the message is wrong.
>  
> FileSystemConfigurator is used by createConfigurationContextFromFileSystem
> method which can throw AxisFaults. I think FileSystemConfigurator should
> throw an exception if the repoLocation or axis2xlm are not found on
> the system
> instead of merely logging it and falling through the default
> configuration load.
> Otherwise the problem will snowball later on when the default
> axis2.xml is loaded,
> modules fail to engage etc and make the user wonder what is going on,
> like it was
> in my case.
>  
> At the very least, besides fixing this problem, log it with error()
> severity. info() is
> too low for supplied-but-not-found configuration loading.
>  
> Let me know if you need a JIRA opened for this.
>  
> Thanks,
>  
> George Stanchev
>
> **********************************************************************
>
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the intended recipient,
> please contact the sender by reply e-mail and destroy all copies of
> the original message.
>

-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org