Google Groups

Re: Windows command line problem


Dan Grabowski Apr 30, 2012 8:05 AM
Posted in group: Datomic
You could also remove the quotes from the right side of the assignments on lines 14 and 18 in transactor.cmd (build 3065). With the quotes, it appears that the value of JAVA_ARGS is treated as a single argument when passed to the java executable.

I updated my transactor.cmd to address this issue and allow overriding the default initial and max heap settings, similar to what is support in the bash version of the transactor script. It looks like the following:

@echo off
setlocal enableextensions

if "%1" == "" (
  echo "Usage: %0 properties-file-or-uri"
  goto end
)

set XMS=-Xms96m
set XMX=-Xmx1024m

call bin\classpath.cmd

set JAVA_ARGS=-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -cp %CP_LIST%

:arg-loop
if "%2" == "" goto continue
set arg=%1
if "%arg:~0,4%" == "-Xmx" (
  set XMX=%arg%
) else if "%arg:~0,4%" == "-Xms" (
  set XMS=%arg%
) else (
  set JAVA_ARGS=%JAVA_ARGS% %arg%
)
shift
goto arg-loop

:continue

java -server %XMX% %XMS% %JAVA_ARGS% clojure.main --main datomic.launcher %1

:end
endlocal

On Monday, April 30, 2012 1:12:52 AM UTC-4, john wrote:
what helped me was to inline the JAVA_ARGS in transactor.cmd line 24:
java -server %XMX% %XMS% -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -cp %CP_LIST% clojure.main --main datomic.launcher %1

Am Sonntag, 29. April 2012 22:35:59 UTC+2 schrieb devorb:

Hi Guys,
I'm trying to run datomic on windows7. I see there are all the windows cmd files there, so somebody must have tested this, when he wrote it, so what am I doing wrong ?

d:\datomic\datomic-0.1.3065>bin\transactor config\samples\dev-transactor.properties
Invalid maximum heap size: -Xmx1024m -Xms96m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -cp bin;resources;.\datomic-transactor.jar;lib\woodstox-core-asl-4.1.1.jar;lib\tools.namespace-0.1.1.jar;li
b\tomcat-juli-7.0.27.jar;lib\tomcat-jdbc-7.0.27.jar;lib\test.generative-0.1.4.jar;lib\stax2-api-3.1.1.jar;lib\slf4j-api-1.6.4.jar;lib\servlet-api-2.5.jar;lib\servlet-api-2.5-20081211.jar;lib\ring-serv
let-1.0.1.jar;lib\ring-jetty-adapter-1.0.1.jar;lib\ring-core-1.0.1.jar;lib\rhq-pluginAnnotations-3.0.4.jar;lib\postgresql-9.1-901.jdbc4.jar;lib\netty-3.2.4.Final.jar;lib\lucene-core-3.3.0.jar;lib\logb
ack-core-1.0.1.jar;lib\logback-classic-1.0.1.jar;lib\log4j-over-slf4j-1.6.4.jar;lib\jul-to-slf4j-1.6.4.jar;lib\jline-win-1.0.jar;lib\jline-0.9.9.jar;lib\jgroups-2.12.0.Final.jar;lib\jetty-util-6.1.25.
jar;lib\jetty-6.1.25.jar;lib\jets3t-0.8.1.jar;lib\jcl-over-slf4j-1.6.4.jar;lib\jboss-transaction-api_1.1_spec-1.0.0.Final.jar;lib\jboss-marshalling-river-1.3.6.GA.jar;lib\jboss-marshalling-1.3.6.GA.ja
r;lib\jboss-logging-3.1.0.CR2.jar;lib\java.jdbc-0.1.3.jar;lib\java.classpath-0.1.1.jar;lib\java-xmlbuilder-0.4.jar;lib\jackson-core-asl-1.8.0.jar;lib\infinispan-core-5.1.2.FINAL.jar;lib\infinispan-cli
ent-hotrod-5.1.2.FINAL.jar;lib\httpcore-4.2-alpha2.jar;lib\httpclient-4.2-alpha1.jar;lib\hornetq-core-2.2.2.Final.jar;lib\h2-1.3.165.jar;lib\guava-r09.jar;lib\data.json-0.1.2.jar;lib\commons-pool-1.5.
6.jar;lib\commons-io-1.4.jar;lib\commons-httpclient-3.1.jar;lib\commons-fileupload-1.2.1.jar;lib\commons-compiler-jdk-2.6.1.jar;lib\commons-compiler-2.6.1.jar;lib\commons-codec-1.4.jar;lib\clojure-1.4
.0.jar;lib\bsh-2.1b5.jar;lib\aws-java-sdk-1.3.0.jar;
Could not create the Java virtual machine.

 If I remove all the java options in transactor.cmd, then I get another error message:
d:\datomic\datomic-0.1.3065>bin\transactor config\samples\dev-transactor.properties  
Exception in thread "main" java.lang.NoClassDefFoundError: -cp bin;resources;/\datomic-transactor/jar;lib\woodstox-core-asl-4/1/1/jar;lib\tools/namespace-0/1/1/jar;lib\tomcat-juli-7/0/27/jar;lib\tomc
at-jdbc-7/0/27/jar;lib\test/generative-0/1/4/jar;lib\stax2-api-3/1/1/jar;lib\slf4j-api-1/6/4/jar;lib\servlet-api-2/5/jar;lib\servlet-api-2/5-20081211/jar;lib\ring-servlet-1/0/1/jar;lib\ring-jetty-adap
ter-1/0/1/jar;lib\ring-core-1/0/1/jar;lib\rhq-pluginAnnotations-3/0/4/jar;lib\postgresql-9/1-901/jdbc4/jar;lib\netty-3/2/4/Final/jar;lib\lucene-core-3/3/0/jar;lib\logback-core-1/0/1/jar;lib\logback-cl
assic-1/0/1/jar;lib\log4j-over-slf4j-1/6/4/jar;lib\jul-to-slf4j-1/6/4/jar;lib\jline-win-1/0/jar;lib\jline-0/9/9/jar;lib\jgroups-2/12/0/Final/jar;lib\jetty-util-6/1/25/jar;lib\jetty-6/1/25/jar;lib\jets
3t-0/8/1/jar;lib\jcl-over-slf4j-1/6/4/jar;lib\jboss-transaction-api_1/1_spec-1/0/0/Final/jar;lib\jboss-marshalling-river-1/3/6/GA/jar;lib\jboss-marshalling-1/3/6/GA/jar;lib\jboss-logging-3/1/0/CR2/jar
;lib\java/jdbc-0/1/3/jar;lib\java/classpath-0/1/1/jar;lib\java-xmlbuilder-0/4/jar;lib\jackson-core-asl-1/8/0/jar;lib\infinispan-core-5/1/2/FINAL/jar;lib\infinispan-client-hotrod-5/1/2/FINAL/jar;lib\ht
tpcore-4/2-alpha2/jar;lib\httpclient-4/2-alpha1/jar;lib\hornetq-core-2/2/2/Final/jar;lib\h2-1/3/165/jar;lib\guava-r09/jar;lib\data/json-0/1/2/jar;lib\commons-pool-1/5/6/jar;lib\commons-io-1/4/jar;lib\
commons-httpclient-3/1/jar;lib\commons-fileupload-1/2/1/jar;lib\commons-compiler-jdk-2/6/1/jar;lib\commons-compiler-2/6/1/jar;lib\commons-codec-1/4/jar;lib\clojure-1/4/0/jar;lib\bsh-2/1b5/jar;lib\aws-
java-sdk-1/3/0/jar;
Caused by: java.lang.ClassNotFoundException: -cp bin;resources;.\datomic-transactor.jar;lib\woodstox-core-asl-4.1.1.jar;lib\tools.namespace-0.1.1.jar;lib\tomcat-juli-7.0.27.jar;lib\tomcat-jdbc-7.0.27
.jar;lib\test.generative-0.1.4.jar;lib\stax2-api-3.1.1.jar;lib\slf4j-api-1.6.4.jar;lib\servlet-api-2.5.jar;lib\servlet-api-2.5-20081211.jar;lib\ring-servlet-1.0.1.jar;lib\ring-jetty-adapter-1.0.1.jar;
lib\ring-core-1.0.1.jar;lib\rhq-pluginAnnotations-3.0.4.jar;lib\postgresql-9.1-901.jdbc4.jar;lib\netty-3.2.4.Final.jar;lib\lucene-core-3.3.0.jar;lib\logback-core-1.0.1.jar;lib\logback-classic-1.0.1.ja
r;lib\log4j-over-slf4j-1.6.4.jar;lib\jul-to-slf4j-1.6.4.jar;lib\jline-win-1.0.jar;lib\jline-0.9.9.jar;lib\jgroups-2.12.0.Final.jar;lib\jetty-util-6.1.25.jar;lib\jetty-6.1.25.jar;lib\jets3t-0.8.1.jar;l
ib\jcl-over-slf4j-1.6.4.jar;lib\jboss-transaction-api_1.1_spec-1.0.0.Final.jar;lib\jboss-marshalling-river-1.3.6.GA.jar;lib\jboss-marshalling-1.3.6.GA.jar;lib\jboss-logging-3.1.0.CR2.jar;lib\java.jdbc
-0.1.3.jar;lib\java.classpath-0.1.1.jar;lib\java-xmlbuilder-0.4.jar;lib\jackson-core-asl-1.8.0.jar;lib\infinispan-core-5.1.2.FINAL.jar;lib\infinispan-client-hotrod-5.1.2.FINAL.jar;lib\httpcore-4.2-alp
ha2.jar;lib\httpclient-4.2-alpha1.jar;lib\hornetq-core-2.2.2.Final.jar;lib\h2-1.3.165.jar;lib\guava-r09.jar;lib\data.json-0.1.2.jar;lib\commons-pool-1.5.6.jar;lib\commons-io-1.4.jar;lib\commons-httpcl
ient-3.1.jar;lib\commons-fileupload-1.2.1.jar;lib\commons-compiler-jdk-2.6.1.jar;lib\commons-compiler-2.6.1.jar;lib\commons-codec-1.4.jar;lib\clojure-1.4.0.jar;lib\bsh-2.1b5.jar;lib\aws-java-sdk-1.3.0
.jar;
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: -cp bin;resources;.\datomic-transactor.jar;lib\woodstox-core-asl-4.1.1.jar;lib\tools.namespace-0.1.1.jar;lib\tomcat-juli-7.0.27.jar;lib\tomcat-jdbc-7.0.27.jar;lib\test.
generative-0.1.4.jar;lib\stax2-api-3.1.1.jar;lib\slf4j-api-1.6.4.jar;lib\servlet-api-2.5.jar;lib\servlet-api-2.5-20081211.jar;lib\ring-servlet-1.0.1.jar;lib\ring-jetty-adapter-1.0.1.jar;lib\ring-core-
1.0.1.jar;lib\rhq-pluginAnnotations-3.0.4.jar;lib\postgresql-9.1-901.jdbc4.jar;lib\netty-3.2.4.Final.jar;lib\lucene-core-3.3.0.jar;lib\logback-core-1.0.1.jar;lib\logback-classic-1.0.1.jar;lib\log4j-ov
er-slf4j-1.6.4.jar;lib\jul-to-slf4j-1.6.4.jar;lib\jline-win-1.0.jar;lib\jline-0.9.9.jar;lib\jgroups-2.12.0.Final.jar;lib\jetty-util-6.1.25.jar;lib\jetty-6.1.25.jar;lib\jets3t-0.8.1.jar;lib\jcl-over-sl
f4j-1.6.4.jar;lib\jboss-transaction-api_1.1_spec-1.0.0.Final.jar;lib\jboss-marshalling-river-1.3.6.GA.jar;lib\jboss-marshalling-1.3.6.GA.jar;lib\jboss-logging-3.1.0.CR2.jar;lib\java.jdbc-0.1.3.jar;lib
\java.classpath-0.1.1.jar;lib\java-xmlbuilder-0.4.jar;lib\jackson-core-asl-1.8.0.jar;lib\infinispan-core-5.1.2.FINAL.jar;lib\infinispan-client-hotrod-5.1.2.FINAL.jar;lib\httpcore-4.2-alpha2.jar;lib\ht
tpclient-4.2-alpha1.jar;lib\hornetq-core-2.2.2.Final.jar;lib\h2-1.3.165.jar;lib\guava-r09.jar;lib\data.json-0.1.2.jar;lib\commons-pool-1.5.6.jar;lib\commons-io-1.4.jar;lib\commons-httpclient-3.1.jar;l
ib\commons-fileupload-1.2.1.jar;lib\commons-compiler-jdk-2.6.1.jar;lib\commons-compiler-2.6.1.jar;lib\commons-codec-1.4.jar;lib\clojure-1.4.0.jar;lib\bsh-2.1b5.jar;lib\aws-java-sdk-1.3.0.jar;. Progra
m will exit.