I started
java -Xmx512M -jar /home/ec2-user/OpenTripPlanner/otp-0.20.0-20160422.165451-50-shaded.jar --basePath /home/ec2-user/OpenTripPlanner --server
I have this in the base path
[ec2-user#ip-172-31-31-88 OpenTripPlanner]$ ls -R graphs/
graphs/:
Graph.obj r1
graphs/1:
Graph.obj gtfs_8.zip
When I hit the URL,
[ec2-user#ip-172-31-31-88 OpenTripPlanner]$ curl http://localhost:8080/otp/routers
{"routerInfo":[]}
What needs to be done to register the routers?
I'm using version 1.0.0 of OpenTripPlanner, and I had to add a "--autoScan" for OTP to pick up the graphs, (with a "graphs" folder in the "." folder):
java -Xmx8G -jar otp-1_0_0.jar --autoReload --autoScan --basePath . --server
Related
I'm trying to Dockerize an old sbt build that needs access to a private nexus repo. I've previously been using a local credentials file referenced from the build.sbt, but that doesn't really fit my use currently since I want to bootstrap everything from a Dockerfile build. I rather not have to output stuff to a file and then copy it into my docker build container but rather just pass it as docker ARG's.
Under
https://www.scala-sbt.org/1.0/docs/Publishing.html
I read I can pass it like so:
credentials += Credentials("Some Nexus Repository Manager",
"my.artifact.repo.net", "admin", "admin123")
So therefore I figured I could do something like:
ARG REPO_USER
ARG REPO_PWD
RUN sbt ";credentials += Credentials(\"Some Nexus Repository Manager\", \"repo.host.com\", ${REPO_USER}, ${REPO_PWD}) ;package"
and then run
docker build . --build-arg REPO_USER=foobar --build-arg REPO_PWD=*****
in my Dockerfile but that didn't work. I still get:
Unable to find credentials for [Sonatype Nexus Repository Manager # repo.host.com]
Is there any nice way to pass repo credentials to sbt from cli?
Update:
I tried a a file approach but that didn't solve the problem so I guess I might be on the wrong track on what's actually wrong here.
RUN echo "realm=Sonatype Nexus Repository Manager" >> .credentials && \
echo "host=repo.host.se" >> .credentials && \
echo "user=$REPO_USER" >> .credentials && \
echo "password=$REPO_PWD" >> .credentials && \
export SBT_CREDENTIALS=.credentials && \
sbt package
Update 2
I think this is no longer a Docker question at all since I've debugged it in the docker container sbt simply wouldn't pick my creds up any way I passed it according to the sbt docs.
I'll answer my own question.
You can use environment variables. You can set them in dockerfile either straight or from args. Something like this:
ARG REPO_USR
ARG REPO_PWD
ENV REPO_USR = ${REPO_USR}
ENV REPO_PWD = ${REPO_PWD}
Then you can use the environment variables in sbt:
val repoUser = sys.env.get("REPO_USR").getOrElse("")
val repoPass = sys.env.get("REPO_PWS").getOrElse("")
credentials += Credentials("Repo Realm", "repo.url.com", repoUser, repoPass)
Then you can basically pass args to docker build and they will be passed on to sbt.
The sbt docs are misleading at best or simply just wrong. After debugging this to bits in the docker container I found that there was no way I could pass the creds cli so they got picked up. The SBT_CREDENTIALS variable just doesn't work either.
This comment finally saved me: SBT is unable to find credentials when attempting to download from an Artifactory virtual repo
The least intrusive way I've got working is to add an sbt config file in the docker image's home dir:
RUN mkdir .sbt/0.13/plugins && \
echo "credentials += Credentials(\"Sonatype Nexus Repository Manager\", \"repo.host.se\", \"$REPO_USER\", \"$REPO_PWD\")" >> .sbt/0.13/plugins/creds.sbt
RUN sbt package
I'm trying to install Spark on my local machine. I have been following this guide. I have installed JDK-7 (also have JDK-8) and Scala 2.11.7. A problem occurs when I try to use sbt to build Spark 1.4.1. I get the following exception.
NOTE: The sbt/sbt script has been relocated to build/sbt.
Please update references to point to the new location.
Invoking 'build/sbt assembly' now ...
Attempting to fetch sbt
Launching sbt from build/sbt-launch-0.13.7.jar
Error: Invalid or corrupt jarfile build/sbt-launch-0.13.7.jar
I have searched for a solution to this problem. I have found a nice guide https://stackoverflow.com/a/31597283/2771315 which uses a pre-built version. Other than using the pre-built version, is there a way to install Spark using sbt? Further, is there a reason as to why the Invalid or corrupt jarfile error occurs?
I met the same problem. I have fixed it now.
This probably because sbt-launch-0.13.7.jar has a unsuccessful download, although you can see the file is exist, but it's not correct file. The file is about 1.2MB in size. If less than that, you can get into the build/ , use "vim sbt-launch-0.13.7.jar" or other tools to open sbt-launch-0.13.7.jar file.
If the file have the content like this:
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
It implys that sbt-launch-0.13.7.jar is not downloaded.
Then open sbt-launch-lib.bash in the same directory,check the line 41 and 42, it gives two urls. Open it to check if they work well.
If url1 doesn't work,download the sbt-launch.jar manually(you can use url2, it may works,or you can download from sbt official website), put it in the same directory, rename it to sbt-launch-0.13.7.jar, then you shoud comment lines in relation to the downloading(may be between line 47 and 68), avoid the script download it again. Like this:
acquire_sbt_jar () {
SBT_VERSION=`awk -F "=" '/sbt\.version/ {print $2}' ./project/build.properties`
URL1=http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/${SBT_VERSION}/sbt-launch.jar
URL2=http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/${SBT_VERSION}/sbt-launch.jar
JAR=build/sbt-launch-${SBT_VERSION}.jar
sbt_jar=$JAR
# if [[ ! -f "$sbt_jar" ]]; then
# # Download sbt launch jar if it hasn't been downloaded yet
# if [ ! -f "${JAR}" ]; then
# # Download
# printf "Attempting to fetch sbt\n"
# JAR_DL="${JAR}.part"
# if [ $(command -v curl) ]; then
# (curl --silent ${URL1} > "${JAR_DL}" || curl --silent ${URL2} > "${JAR_DL}") && mv "${JAR_DL}" "${JAR}"
# elif [ $(command -v wget) ]; then
# (wget --quiet ${URL1} -O "${JAR_DL}" || wget --quiet ${URL2} -O "${JAR_DL}") && mv "${JAR_DL}" "${JAR}"
# else
# printf "You do not have curl or wget installed, please install sbt manually from http://www.scala-sbt.org/\n"
# exit -1
# fi
# fi
# if [ ! -f "${JAR}" ]; then
# # We failed to download
# printf "Our attempt to download sbt locally to ${JAR} failed. Please install sbt manually from http://www.scala-sbt.org/\n"
# exit -1
# fi
# printf "Launching sbt from ${JAR}\n"
# fi
}
Then use "build/sbt assembly" to build the spark again.
Hope you will succeed.
If I didn't express clearly, the following links may be helpful.
https://www.mail-archive.com/user#spark.apache.org/msg34358.html
Error: Invalid or corrupt jarfile sbt/sbt-launch-0.13.5.jar the answer by prabeesh
https://groups.google.com/forum/#!topic/predictionio-user/fllCh8n-0d4
Download the sbt-launch.jar file manually (you can use url2, it may work, or you can download from the sbt official website), put it in the same directory, rename it to sbt-launch-0.13.7.jar, then run the sbt/sbt assembly command.
I have a netbeans project with a directory tree like this:
<source folder>
|
|---> gui <web root folder>
| |
| L---> datos.php
|
L---> index.php
datos.php changes the working directory to .. (source folder) and includes index.php like this:
chdir('..');
require 'index.php';
If I put a breakpoint inside datos.php, the debugger breaks on it correctly, but when putting one in index.php it ignores it.
The strange thing is 6 months ago I had the same problem and I was able to fix it. Now I don't know why it stopped working and what I did back then to fix it.
More info:
xdebug log shows the following command for breakpoint setting:
breakpoint_set -i 315 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php -n 51
breakpoint_set -i 316 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/gui/datos.php -n 39
In both cases xdebug responds with state="enabled"
And if I debug manually, I can use the following command to set the breakpoint, which works:
breakpoint_set -i 315 -t line -s enabled -f file:///../index.php -n 51
But I don't know how could I make netbeans issue the breakpoint_set command with the same file:///../index.php argument and not file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php or any other way I can make this work.
Thanks in advance for any help!
You always can try using xdebug_break();
For example :
<?php
for ( $i=1, $j=0; $i<10; $i++) {
xdebug_break();
echo "<br>Line $i"; // will stop here
}
?>
will add a breakpoint in the following line.
Hope that helps a little...
Breakpoints are working again. I don't have any clues to why they didn't worked before but now they do. I can't remember doing any changes in xdebug or Netbeans either.
xdebug.log shows me the same as before, but now it stops at the setted breakpoint:
<- breakpoint_set -i 4 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php -n 51
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="4" state="enabled" id="14290001"></response>
<- run -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="5" status="break" reason="ok"><xdebug:message filename="file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php" lineno="51"></xdebug:message></response>
However, if anyone knows why this could had happend, sharing it could be helpful either way: probably me or someone else will be able to avoid having similar troubles in the future.
This issue is more specific to people who are using remote servers for their web apps.
I had the same problem. Xdebug ignores breakpoints really helped me however i have given solution more specific to netbeans, but the essence is the same, which ever IDE you are using. Just map your local project path with your remote server path.
My environment is WINDOWS 7 and website is hosted on UBUNTU VM. I am using NETBEANS from Windows 7 and has setup a remote project.
My xdebug logs
<- breakpoint_set -i 4 -t line -s enabled -f file:///C:/Users/ali/Documents/NetBeansProjects/test.com.au/cgen/src/Acme/TestBundle/Controller/CreateController.php -n 39
->
The real problem was the project path in netbeans [C:/Users/ali/Documents/NetBeansProjects/test.com.au] and the project path on the webserver. /home/ali/sites/test.com.au
Fix: In Netbeans click on your project > properties > Run Configuration > Advanced > Just put the appropriate server path and equivalent project path. It will work fine.
Same problem was solved by commenting xdebug.extended_info = 0. Also one may switch it to 1.
To get it to work again i changedxdebug.remote_host=127.0.0.1 to xdebug.remote_host=localhost in php.ini
below is my config for xdebuga
xdebug.remote_enable=1
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_autostart = 1
xdebug.show_local_vars = 1
xdebug.profiler_enable = 1
output_buffering=off
xdebug.idekey=netbeans-xdebug
I'm using Eclim to develop Java Application, whenever I run command :Validate in MacVim to validate Java Source, it raise exception message:
`java.lang.IllegalArgumentException: Path must include project and resource name: <Project>
while executing command (port: 9091): -editor vim -command java_src_update -p "<Project>" -f "src/mobile/railsvideos/LoginActivity.java" -v`
Any help is appreciated?
I simply could not get it to work not matter what. The only thing it does is that it lists the help. that's all. Any help, example is appreciated. Thanks much.
I installed the Debian package (then the prerequisite package daemon to get it to finish installing), then got the jarfile from the warfile according to instructions, and it works for me:
jcomeau#intrepid:~$ java -jar /usr/local/bin/hudson-cli.jar -s http://localhost:8080/ version
2.0.1
jcomeau#intrepid:~$ java -jar /usr/local/bin/hudson-cli.jar -s http://localhost:8080/ list-changes
Argument "JOB" is required
java -jar hudson-cli.jar list-changes args...
Dumps the changelog for the specified build(s)
JOB : Name of the job to build
RANGE : Range of the build records to delete. 'N-M',
'N,M', or 'N'
-format [XML | CSV | PLAIN] : Controls how the output from this command is
printed.