You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "david lee (JIRA)" <ji...@apache.org> on 2011/03/25 05:09:05 UTC

[jira] [Created] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

cassandra.bat does not handle folder names with space characters on windows
---------------------------------------------------------------------------

                 Key: CASSANDRA-2383
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
             Project: Cassandra
          Issue Type: Bug
          Components: Tools
    Affects Versions: 0.7.4
         Environment: OS : windows
java : 1.6.0.23
            Reporter: david lee
            Priority: Minor


when cassandra home folder is placed inside a folder which has space characters in its name,
log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055726#comment-13055726 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

In cassandra.bat, change:

 -Dlog4j.configuration=log4j-server.properties^

to:

 -Dlog4j.configuration="file:///%CASSANDRA_HOME%/conf/log4j-server.properties"^

I'm hopeful there's a less ugly way, but this seems to work.

> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056794#comment-13056794 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

OK, have gone around in circles a bit on this!

-Dlog4j.defaultInitOverride enables AbstractCassandraDaemon to take charge of the log4j configuration in order to make it dynamic (you can change the log4j config file, and it should be updated using the log4j PropertyConfigurator every 10 seconds).

The default value of log4j.configuration in the code and in the batch file is "log4j-server.properties", which is not a valid URL, so we drop into:

{noformat} 
configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);
{noformat} 

as you said before. This *does* detect the correct file from CASSANDRA_HOME/conf, since log4j logs the *full path* even though we only supply the filename "log4j-server.properties":

{noformat} 
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
{noformat} 

getResource() returns a URL. Converting this to a file using getFile() works fine when there are no spaces, and you can verify that the file exists. If there are spaces, then this conversion produces a filename that includes the %20 encoding for spaces - this is an incorrect filename.

We need instead to convert using:

{noformat} 
new File(configLocation.toURI());
{noformat} 

(with appropriate exception handling for URISyntaxException) which produces a filename with spaces rather than %20.


> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055782#comment-13055782 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

Another solution that seems to work regardless of working directory is leave the original log4j.configuration line, but remove the line:

-Dlog4j.defaultInitOverride=true^

This gets the classloader to find the config file as a resource, rather than supplying a file reference directly.

However, I'm unsure why the defaultInitOverride was there in the first place...

> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis reassigned CASSANDRA-2383:
-----------------------------------------

    Assignee: Benjamin Coverston

> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.5
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Issue Comment Edited] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056794#comment-13056794 ] 

David Allsopp edited comment on CASSANDRA-2383 at 6/28/11 9:24 PM:
-------------------------------------------------------------------

OK, have gone around in circles a bit on this!

-Dlog4j.defaultInitOverride enables AbstractCassandraDaemon to take charge of the log4j configuration in order to make it dynamic (you can change the log4j config file, and it should be updated using the log4j PropertyConfigurator every 10 seconds).

The default value of log4j.configuration in the code and in the batch file is "log4j-server.properties", which is not a valid URL, so we drop into:

{noformat} configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);{noformat} 

as you said before. This *does* detect the correct file from CASSANDRA_HOME/conf, since log4j logs the *full path* even though we only supply the filename "log4j-server.properties":

{noformat} log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.{noformat} 

getResource() returns a URL. Converting this to a file using getFile() works fine when there are no spaces; one can verify that the file exists (File.exists() == true). If there are spaces, then this conversion produces a filename that includes the %20 encoding for spaces - this is an incorrect filename.

We need instead to convert using:

{noformat} new File(configLocation.toURI());{noformat} 

(with appropriate exception handling for URISyntaxException) which produces a filename with spaces rather than %20.


      was (Author: dallsopp):
    OK, have gone around in circles a bit on this!

-Dlog4j.defaultInitOverride enables AbstractCassandraDaemon to take charge of the log4j configuration in order to make it dynamic (you can change the log4j config file, and it should be updated using the log4j PropertyConfigurator every 10 seconds).

The default value of log4j.configuration in the code and in the batch file is "log4j-server.properties", which is not a valid URL, so we drop into:

{noformat} 
configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);
{noformat} 

as you said before. This *does* detect the correct file from CASSANDRA_HOME/conf, since log4j logs the *full path* even though we only supply the filename "log4j-server.properties":

{noformat} 
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
{noformat} 

getResource() returns a URL. Converting this to a file using getFile() works fine when there are no spaces, and you can verify that the file exists. If there are spaces, then this conversion produces a filename that includes the %20 encoding for spaces - this is an incorrect filename.

We need instead to convert using:

{noformat} 
new File(configLocation.toURI());
{noformat} 

(with appropriate exception handling for URISyntaxException) which produces a filename with spaces rather than %20.

  
> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis reassigned CASSANDRA-2383:
-----------------------------------------

    Assignee: T Jake Luciani  (was: Benjamin Coverston)

> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056826#comment-13056826 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

Suggested fix for AbstractCassandraDaemon static initializer (apologies - haven't got a suitable version of diff on this windows box yet). Untested on linux as yet.

{noformat}
    //Initialize logging in such a way that it checks for config changes every 10 seconds.
    static
    {
        String config = System.getProperty("log4j.configuration", "log4j-server.properties");
        String configFileName = null;
        URL configLocation = null;
        try 
        {
            // try loading from a physical location first.
            configLocation = new URL(config);
        }
        catch (MalformedURLException ex) 
        {
            // load from the classpath.
            configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);
            if (configLocation == null)
                throw new RuntimeException("Couldn't figure out log4j configuration.");
			try
			{
				configFileName = new File(configLocation.toURI()).getCanonicalPath();
			} 
			catch (Exception e)
			{
				throw new RuntimeException("Couldn't convert log4j configuration location to a valid file.", e);
			} 
        }
        PropertyConfigurator.configureAndWatch(configFileName, 10000);
        org.apache.log4j.Logger.getLogger(AbstractCassandraDaemon.class).info("Logging initialized");
    }
{noformat}

> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057223#comment-13057223 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

Yes, that'll teach me to post code late at night :-(

> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055792#comment-13055792 ] 

David Allsopp edited comment on CASSANDRA-2383 at 6/27/11 10:04 PM:
--------------------------------------------------------------------

@Jonathan - yes, I thought so too, but it doesn't. The default init process for log4j is described at http://logging.apache.org/log4j/1.2/manual.html, but it doesn't really explain what happens if defaultInitOverride is set!

With  -Dlog4j.debug=true and the original batch file, i.e.

 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I see:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

If I remove the defaultInitOverride, I get:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties
[etc...]

Finally, with:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I get this, if current directory is CASSANDRA_HOME:

Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]

But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):

Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.


      was (Author: dallsopp):
    @Jonathan - yes, I thought so too, but it doesn't.  With  -Dlog4j.debug=true and the original batch file, i.e.

 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I see:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

If I remove the defaultInitOverride, I get:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties
[etc...]

Finally, with:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I get this, if current directory is CASSANDRA_HOME:

Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]

But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):

Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

  
> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055792#comment-13055792 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

@Jonathan - yes, I thought so too, but it doesn't.  With  -Dlog4j.debug=true and the original batch file, i.e.

 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I see:

Starting Cassandra Server
log4j: [/C:/Users/David/Documents/Work/Coding/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does no
t exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

If I remove the defaultInitOverride, I get:

Starting Cassandra Server
log4j: [/C:/Users/David/Documents/Work/Coding/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does no
t exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Documents/Work/Coding/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.prop
erties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Documents/Work/Coding/Key%20Value/apache-cassandra-0.7.6-2/co
nf/log4j-server.properties
[etc...]

Finally, with:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I get this, if current directory is CASSANDRA_HOME:

Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]

But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):

Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.


> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056826#comment-13056826 ] 

David Allsopp edited comment on CASSANDRA-2383 at 7/2/11 10:22 AM:
-------------------------------------------------------------------

Suggested fix for AbstractCassandraDaemon static initializer (apologies - haven't got a suitable version of diff on this windows box yet). Untested on linux as yet.

{noformat}
    //Initialize logging in such a way that it checks for config changes every 10 seconds.
    static
    {
        String config = System.getProperty("log4j.configuration", "log4j-server.properties");
        URL configLocation = null;
        try 
        {
            // try loading from a physical location first.
            configLocation = new URL(config);
        }
        catch (MalformedURLException ex) 
        {
            // then try loading from the classpath.
            configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);
        }
        
        if (configLocation == null)
            throw new RuntimeException("Couldn't figure out log4j configuration: "+config);
        
        // Now convert URL to a filename
        String configFileName = null;
		try
		{
			// first try URL.getFile() which works for opaque URLs (file:foo) and paths without spaces
			configFileName = configLocation.getFile();
			File configFile = new File(configFileName);
			// then try alternative approach which works for all hierarchical URLs with or without spaces
			if(!configFile.exists())
			{
				configFileName = new File(configLocation.toURI()).getCanonicalPath();
			}
		} 
		catch (Exception e)
		{
			throw new RuntimeException("Couldn't convert log4j configuration location to a valid file.", e);
		} 
        PropertyConfigurator.configureAndWatch(configFileName, 10000);
        org.apache.log4j.Logger.getLogger(AbstractCassandraDaemon.class).info("Logging initialized");
    }
{noformat}

      was (Author: dallsopp):
    Suggested fix for AbstractCassandraDaemon static initializer (apologies - haven't got a suitable version of diff on this windows box yet). Untested on linux as yet.

{noformat}
    //Initialize logging in such a way that it checks for config changes every 10 seconds.
    static
    {
        String config = System.getProperty("log4j.configuration", "log4j-server.properties");
        URL configLocation = null;
        try 
        {
            // try loading from a physical location first.
            configLocation = new URL(config);
        }
        catch (MalformedURLException ex) 
        {
            // load from the classpath.
            configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);
        }
        
        if (configLocation == null)
            throw new RuntimeException("Couldn't figure out log4j configuration: "+config);
        
        String configFileName = null;
		try
		{
			configFileName = new File(configLocation.toURI()).getCanonicalPath();
		} 
		catch (Exception e)
		{
			throw new RuntimeException("Couldn't convert log4j configuration location to a valid file.", e);
		} 
        PropertyConfigurator.configureAndWatch(configFileName, 10000);
        org.apache.log4j.Logger.getLogger(AbstractCassandraDaemon.class).info("Logging initialized");
    }
{noformat}
  
> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055792#comment-13055792 ] 

David Allsopp edited comment on CASSANDRA-2383 at 6/27/11 10:13 PM:
--------------------------------------------------------------------

@Jonathan - yes, I thought so too, but it doesn't. The default init process for log4j is described at http://logging.apache.org/log4j/1.2/manual.html, but it doesn't really explain what happens if defaultInitOverride is set!

With  -Dlog4j.debug=true and the original batch file, i.e.

{quote}
 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^}}
{quote}
I see:
{quote}
Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
{quote}
If I remove the defaultInitOverride, I get:
{quote}
Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties
[etc...]
{quote}
Finally, with:
{quote}
 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^
{quote}
I get this, if current directory is CASSANDRA_HOME:
{quote}
Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]
{quote}
But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):
{quote}
Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
{quote}

      was (Author: dallsopp):
    @Jonathan - yes, I thought so too, but it doesn't. The default init process for log4j is described at http://logging.apache.org/log4j/1.2/manual.html, but it doesn't really explain what happens if defaultInitOverride is set!

With  -Dlog4j.debug=true and the original batch file, i.e.

 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I see:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

If I remove the defaultInitOverride, I get:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties
[etc...]

Finally, with:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I get this, if current directory is CASSANDRA_HOME:

Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]

But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):

Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

  
> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055792#comment-13055792 ] 

David Allsopp edited comment on CASSANDRA-2383 at 6/27/11 9:59 PM:
-------------------------------------------------------------------

@Jonathan - yes, I thought so too, but it doesn't.  With  -Dlog4j.debug=true and the original batch file, i.e.

 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I see:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does no
t exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

If I remove the defaultInitOverride, I get:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does no
t exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.prop
erties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/co
nf/log4j-server.properties
[etc...]

Finally, with:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I get this, if current directory is CASSANDRA_HOME:

Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]

But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):

Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.


      was (Author: dallsopp):
    @Jonathan - yes, I thought so too, but it doesn't.  With  -Dlog4j.debug=true and the original batch file, i.e.

 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I see:

Starting Cassandra Server
log4j: [/C:/Users/David/Documents/Work/Coding/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does no
t exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

If I remove the defaultInitOverride, I get:

Starting Cassandra Server
log4j: [/C:/Users/David/Documents/Work/Coding/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does no
t exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Documents/Work/Coding/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.prop
erties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Documents/Work/Coding/Key%20Value/apache-cassandra-0.7.6-2/co
nf/log4j-server.properties
[etc...]

Finally, with:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I get this, if current directory is CASSANDRA_HOME:

Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]

But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):

Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

  
> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064324#comment-13064324 ] 

Hudson commented on CASSANDRA-2383:
-----------------------------------

Integrated in Cassandra-0.7 #527 (See [https://builds.apache.org/job/Cassandra-0.7/527/])
    support spaces in path to log4j configuration
patch by David Allsopp; reviewed by jbellis for CASSANDRA-2383

jbellis : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1145849
Files : 
* /cassandra/branches/cassandra-0.7/CHANGES.txt
* /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
* /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java


> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.6
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: David Allsopp
>            Priority: Minor
>             Fix For: 0.7.8
>
>         Attachments: cassandra-0.7.6-2-2383.diff
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Allsopp updated CASSANDRA-2383:
-------------------------------------

    Attachment: cassandra-0.7.6-2-2383.diff

> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>         Attachments: cassandra-0.7.6-2-2383.diff
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056929#comment-13056929 ] 

Jonathan Ellis commented on CASSANDRA-2383:
-------------------------------------------

Looks like this breaks "configuration parameter is a well-formed url?"  configLocation is never used if "new URL" succeeds.

> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055792#comment-13055792 ] 

David Allsopp edited comment on CASSANDRA-2383 at 6/27/11 10:00 PM:
--------------------------------------------------------------------

@Jonathan - yes, I thought so too, but it doesn't.  With  -Dlog4j.debug=true and the original batch file, i.e.

 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I see:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

If I remove the defaultInitOverride, I get:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.prop
erties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/co
nf/log4j-server.properties
[etc...]

Finally, with:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I get this, if current directory is CASSANDRA_HOME:

Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]

But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):

Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.


      was (Author: dallsopp):
    @Jonathan - yes, I thought so too, but it doesn't.  With  -Dlog4j.debug=true and the original batch file, i.e.

 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I see:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does no
t exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

If I remove the defaultInitOverride, I get:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does no
t exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.prop
erties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/co
nf/log4j-server.properties
[etc...]

Finally, with:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I get this, if current directory is CASSANDRA_HOME:

Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]

But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):

Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

  
> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055734#comment-13055734 ] 

David Allsopp edited comment on CASSANDRA-2383 at 6/27/11 8:39 PM:
-------------------------------------------------------------------

OK, simpler solution is:

 -Dlog4j.configuration=file:conf/log4j-server.properties^

But note that this only works if the current directory is CASSANDRA_HOME, so double-clicking on the batch file won't work, whereas the previous solution will work from the 'bin' directory, so double-clicking is OK.

      was (Author: dallsopp):
    OK, simpler solution is:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
  
> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055792#comment-13055792 ] 

David Allsopp edited comment on CASSANDRA-2383 at 6/27/11 10:00 PM:
--------------------------------------------------------------------

@Jonathan - yes, I thought so too, but it doesn't.  With  -Dlog4j.debug=true and the original batch file, i.e.

 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I see:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

If I remove the defaultInitOverride, I get:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties
[etc...]

Finally, with:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I get this, if current directory is CASSANDRA_HOME:

Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]

But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):

Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.


      was (Author: dallsopp):
    @Jonathan - yes, I thought so too, but it doesn't.  With  -Dlog4j.debug=true and the original batch file, i.e.

 -Dlog4j.configuration=log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I see:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

If I remove the defaultInitOverride, I get:

Starting Cassandra Server
log4j: [/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.properties] does not exist.
log4j: Trying to find [log4j-server.properties] using context classloader sun.misc.Launcher$AppClassLoader@1a45a877.
log4j: Using URL [file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/conf/log4j-server.prop
erties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Users/David/Key%20Value/apache-cassandra-0.7.6-2/co
nf/log4j-server.properties
[etc...]

Finally, with:

 -Dlog4j.configuration=file:conf/log4j-server.properties^
 -Dlog4j.defaultInitOverride=true^

I get this, if current directory is CASSANDRA_HOME:

Starting Cassandra Server
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
[etc...]

But this, if current directory is CASSANDRA_HOME/bin (e.g. if double-clicking the batch file):

Starting Cassandra Server
log4j: [conf/log4j-server.properties] does not exist.
log4j: Default initialization of overridden by log4j.defaultInitOverrideproperty.
log4j:WARN No appenders could be found for logger (org.apache.cassandra.service.AbstractCassandraDaemon).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

  
> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059014#comment-13059014 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

OK, third time lucky I hope. The edited version above now tries the original getFile() approach, then falls back on the new File(url.toURI()) approach if the file doesn't exist.

This seems to work with classpath names, opaque URIs *and* hierarchical URIs

> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055797#comment-13055797 ] 

Jonathan Ellis commented on CASSANDRA-2383:
-------------------------------------------

Weird.  Could you dig into the code in AbstractCassandraDaemon a little?  Here's what's trying to do load by classpath:

{code}
            // load from the classpath.
            configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);
            if (configLocation == null)
                throw new RuntimeException("Couldn't figure out log4j configuration.");
{code}


> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059011#comment-13059011 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

The above code seems to work for full hierarchical URIs:

-Dlog4j.configuration="file:///C:/conf%20space/log4j-server.properties"

and for classpath locations:

-Dlog4j.configuration=log4j-server.properties

(on windows, with a space in the file path)

It does not work for opaque URIs such as file:log4j-server.properties because you can't construct a File directly from these (you get java.lang.IllegalArgumentException: URI is not hierarchical)

> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2383:
--------------------------------------

    Summary: log4j unable to load properties file from classpath  (was: cassandra.bat does not handle folder names with space characters on windows)

> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055807#comment-13055807 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

@Jonathan - will try to take a look soon. The getResource() stuff might perhaps be affected by the classes being within a jarfile.

> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056826#comment-13056826 ] 

David Allsopp edited comment on CASSANDRA-2383 at 7/2/11 9:27 AM:
------------------------------------------------------------------

Suggested fix for AbstractCassandraDaemon static initializer (apologies - haven't got a suitable version of diff on this windows box yet). Untested on linux as yet.

{noformat}
    //Initialize logging in such a way that it checks for config changes every 10 seconds.
    static
    {
        String config = System.getProperty("log4j.configuration", "log4j-server.properties");
        URL configLocation = null;
        try 
        {
            // try loading from a physical location first.
            configLocation = new URL(config);
        }
        catch (MalformedURLException ex) 
        {
            // load from the classpath.
            configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);
        }
        
        if (configLocation == null)
            throw new RuntimeException("Couldn't figure out log4j configuration: "+config);
        
        String configFileName = null;
		try
		{
			configFileName = new File(configLocation.toURI()).getCanonicalPath();
		} 
		catch (Exception e)
		{
			throw new RuntimeException("Couldn't convert log4j configuration location to a valid file.", e);
		} 
        PropertyConfigurator.configureAndWatch(configFileName, 10000);
        org.apache.log4j.Logger.getLogger(AbstractCassandraDaemon.class).info("Logging initialized");
    }
{noformat}

      was (Author: dallsopp):
    Suggested fix for AbstractCassandraDaemon static initializer (apologies - haven't got a suitable version of diff on this windows box yet). Untested on linux as yet.

{noformat}
    //Initialize logging in such a way that it checks for config changes every 10 seconds.
    static
    {
        String config = System.getProperty("log4j.configuration", "log4j-server.properties");
        String configFileName = null;
        URL configLocation = null;
        try 
        {
            // try loading from a physical location first.
            configLocation = new URL(config);
        }
        catch (MalformedURLException ex) 
        {
            // load from the classpath.
            configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);
            if (configLocation == null)
                throw new RuntimeException("Couldn't figure out log4j configuration.");
			try
			{
				configFileName = new File(configLocation.toURI()).getCanonicalPath();
			} 
			catch (Exception e)
			{
				throw new RuntimeException("Couldn't convert log4j configuration location to a valid file.", e);
			} 
        }
        PropertyConfigurator.configureAndWatch(configFileName, 10000);
        org.apache.log4j.Logger.getLogger(AbstractCassandraDaemon.class).info("Logging initialized");
    }
{noformat}
  
> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-2383:
--------------------------------------

    Fix Version/s: 0.7.5

> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.5
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055800#comment-13055800 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

http://www.vipan.com/htdocs/log4jhelp.html has the following:

log4j.configuration=app_config.properties: 

First call to Category.getRoot() or Category.getInstance(...) method makes Log4j go through an initialization process. (You can watch that happening by setting "log4j.debug=true".) 

During this process, Log4j looks in the application's classpath for a "log4j.properties" file *or the properties file you specify* via the this property key. 

However, you need to set this as a system property, for example by running your program with java -Dlog4j.configuration=app_config.properties .... This is because, if you set it in the configuration file, it is too late. Log4j would have already started to read the log4j.properties file by default, if available!

> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) log4j unable to load properties file from classpath

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059008#comment-13059008 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

OK, have edited the code snippet above to hopefully fix the obvious broken-ness! 

Still struggling to get Cassandra building properly on Windows/Eclipse so haven't yet been able to test properly though (need to work through http://wiki.apache.org/cassandra/RunningCassandraInEclipse again from scratch as it didn't seem to work first time round...)

> log4j unable to load properties file from classpath
> ---------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: T Jake Luciani
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055778#comment-13055778 ] 

Jonathan Ellis commented on CASSANDRA-2383:
-------------------------------------------

log4j should already find it because of

set CLASSPATH="%CASSANDRA_HOME%\conf"


> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-2383) cassandra.bat does not handle folder names with space characters on windows

Posted by "David Allsopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-2383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055734#comment-13055734 ] 

David Allsopp commented on CASSANDRA-2383:
------------------------------------------

OK, simpler solution is:

 -Dlog4j.configuration=file:conf/log4j-server.properties^

> cassandra.bat does not handle folder names with space characters on windows
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-2383
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2383
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.7.4
>         Environment: OS : windows
> java : 1.6.0.23
>            Reporter: david lee
>            Assignee: Benjamin Coverston
>            Priority: Minor
>             Fix For: 0.7.7
>
>
> when cassandra home folder is placed inside a folder which has space characters in its name,
> log4j settings are not properly loaded and warning messages are shown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira