You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Nilesh (Polyglot.Network) (Jira)" <ji...@apache.org> on 2020/12/25 04:19:00 UTC

[jira] [Commented] (TINKERPOP-2489) Server doesn't start if folder has spaces

    [ https://issues.apache.org/jira/browse/TINKERPOP-2489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17254732#comment-17254732 ] 

Nilesh (Polyglot.Network) commented on TINKERPOP-2489:
------------------------------------------------------

On Mac OS 10.15.6 with Java 15.0.1, I get slightly different behavior. I named the folder to {{apache-tinkerpop-gremlin-server-3.4.9 test}}:

The server starts fine without the YAML config file:


{{INKACTXM162:apache-tinkerpop-gremlin-server-3.4.9 test nilesh$ ./bin/gremlin-server.sh start}}
{{Server started 71007.}}

 

But fails when YAML is specified:

{{INKACTXM162:apache-tinkerpop-gremlin-server-3.4.9 test nileshtrivedi$ ./bin/gremlin-server.sh conf/gremlin-server-modern.yaml}}
{{Error: Could not find or load main class test.conf.log4j-server.properties}}
{{Caused by: java.lang.ClassNotFoundException: test.conf.log4j-server.properties}}

 

I think, there are at least two separate problems in the launch script {{bin/gremlin-server.sh}}.
 * 
Line #83 has {{LOG4J_CONF="file:$GREMLIN_HOME/conf/log4j-server.properties"}}. This will need to replace spaces with %20 which can be done by adding {{{color:#24292e}LOG4J_CONF=$\{LOG4J_CONF{color}{color:#d73a49}//{color} {color:#d73a49}/%{color}{color:#24292e}20}{color}}}
 
 * {color:#24292e}{color:#24292e}Later, while building CLASSPATH, we have this line: {color}{color}{{{color:#24292e}CP={color}{color:#032f62}"{color}{color:#24292e}$CP{color}{color:#032f62}"{color}{color:#24292e}:{color}{color:#032f62}$( {color}{color:#005cc5}echo{color} {color:#24292e}$GREMLIN_HOME{color}{color:#032f62}/lib/{color}{color:#d73a49}*{color}{color:#032f62}.jar {color}{color:#005cc5}.{color} {color:#d73a49}|{color}{color:#032f62} sed 's/ /:/g'){color}}}
 
 * 
This is attempting to interpret space as a different classpath entry and therefore replacing it with colon as the classpath separator which would conflict if $GREMLIN_HOME itself has spaces in it. It seems to be that we should not rely on shell's globbing to get paths of all JARs in lib/.

{color:#032f62}IMHO, instead of putting in these ad-hoc fixes, we should find and use some standard shell functions to build classpath and other variables. I'm not aware of any such projects though.{color}

> Server doesn't start if folder has spaces
> -----------------------------------------
>
>                 Key: TINKERPOP-2489
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2489
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.4.8, 3.4.9
>            Reporter: Divij Vaidya
>            Priority: Major
>
> Repro steps:
> 1. Download the server zip.
> 2. Unzip the binary.
> 3. Rename the unzipped folder and add a space, e.g. 
> {code:java}
> apache-tinkerpop-gremlin-server-3.4.9 my{code}
> 4. Start the server 
> {code:java}
> ./bin/gremlin-server.sh start{code}
> 5. The server will fail to start (check status) with the error "Error: Could not find or load main class my.conf.log4j-server.properties"
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)