<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Pleasant Programmer (lets-debug)</title><link>http://pleasantprogrammer.com/</link><description></description><atom:link rel="self" type="application/rss+xml" href="http://pleasantprogrammer.com/categories/lets-debug.xml"></atom:link><language>en</language><lastBuildDate>Thu, 24 Dec 2015 07:49:10 GMT</lastBuildDate><generator>https://getnikola.com/</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>GTFS Editor</title><link>http://pleasantprogrammer.com/posts/gtfs-editor.html</link><dc:creator>Thomas Dy</dc:creator><description>&lt;div&gt;&lt;p&gt;Link: &lt;a href="https://github.com/conveyal/gtfs-editor"&gt;https://github.com/conveyal/gtfs-editor&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; they really meant under development&lt;/p&gt;
&lt;p&gt;When I first saw the source of GTFS Editor, I was ecstatic. They used &lt;a href="http://playframework.com/"&gt;Play framework&lt;/a&gt;!!! Not only that, they're targeting PostgreSQL as the main database. Those are our favorite tools for building webapps at By Implication. I was a bit sad though, when I saw it was on the 1.x release of Play though. I did have some experience with that release, but not as much compared to 2.x.&lt;/p&gt;
&lt;p&gt;Getting it to actually run though, wasn't very pleasant. The initial setup was easy enough. Get &lt;a href="http://www.playframework.com/download"&gt;Play 1.2.5&lt;/a&gt;, install Postgres with PostGIS, clone the repo and create backing database in Postgres. Some minor additional steps you need are to create the PostGIS extension on the database. The schema is automatically generated and applied by Play so that should be all that's necessary. Wonderful. Then, run play, open a browser, go to &lt;a href="http://localhost:9000"&gt;http://localhost:9000&lt;/a&gt;, compilation error. Fantastic.&lt;/p&gt;
&lt;p&gt;If you don't want to go through the technical details, you can just jump to the &lt;a href="http://pleasantprogrammer.com/posts/gtfs-editor.html#conclusion"&gt;conclusion&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Let's Debug!&lt;/h3&gt;
&lt;p&gt;I'll be splitting the next section up into 2 parts. In the first pass, I'll talk about what I did to just get the app to run but I won't try hard to fix any bugs. This generally is what I do when I try to get apps to run. I'll also be dropping enough information so that you can actually figure out what the real problem is. In the second pass, I'll explain what the problems were and how I fixed them.&lt;/p&gt;
&lt;h4&gt;First Pass&lt;/h4&gt;
&lt;p&gt;A thing to note about Play (and one of the reasons it's a lovely Java framework) is that you don't need to do manual compilation. Just edit some source files, refresh your browser and it will automatically do the compilation for you. One less argument for using PHP. It even shows you (in the browser!) the source and which line of code caused the compilation error. So that's what I saw, &lt;code&gt;Error: type Check already defined&lt;/code&gt;&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nd"&gt;@Retention&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;RetentionPolicy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;RUNTIME&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nd"&gt;@Target&lt;/span&gt;&lt;span class="o"&gt;({&lt;/span&gt;&lt;span class="n"&gt;ElementType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;METHOD&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElementType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;TYPE&lt;/span&gt;&lt;span class="o"&gt;})&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nd"&gt;@interface&lt;/span&gt; &lt;span class="n"&gt;Check&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// error here&lt;/span&gt;

    &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="nf"&gt;value&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;You also know that typical behavior among programmers where your program doesn't compile, but you keep trying to compile it anyway hoping that it will magically just work. That's what I did, and it actually ran. I couldn't really just let this pass, so I decided to try deleting &lt;code&gt;Check.java&lt;/code&gt;. I got another compilation error, &lt;code&gt;Error: type Secure already defined&lt;/code&gt;&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Secure&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;Controller&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// error here&lt;/span&gt;

    &lt;span class="nd"&gt;@Before&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;unless&lt;/span&gt;&lt;span class="o"&gt;={&lt;/span&gt;&lt;span class="s"&gt;"login"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"authenticate"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"logout"&lt;/span&gt;&lt;span class="o"&gt;})&lt;/span&gt;

    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;checkAccess&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;Throwable&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;At that point, I just decided to just debug it later. It works by just forcing it anyway. So I put &lt;code&gt;Check.java&lt;/code&gt; back in and proceeded to just refresh until it compiled and ran.&lt;/p&gt;
&lt;p&gt;The next problem is a sort of common thing most webapp developers have to solve one way or another. How do you set up the initial admin account? Phrased a different way, how do I login to this thing? The first thing I tried was just add a user into the &lt;code&gt;account&lt;/code&gt; table directly. One problem though was how to set the password correctly. Plaintext obviously wouldn't work.&lt;/p&gt;
&lt;p&gt;Another note regarding Play 1.x, it provides the &lt;a href="http://www.playframework.com/documentation/1.2.5/secure"&gt;secure module&lt;/a&gt; which handles logins and keeping state, you simply need to implement the method &lt;code&gt;boolean authenticate(String username, String password)&lt;/code&gt;. It leaves the actual process of verifying the login to the programmer. This can be exploited by just making the method return &lt;code&gt;true&lt;/code&gt; and then any login would work. No need to actually set the password. Excellent.&lt;/p&gt;
&lt;p&gt;And we're logged in, just in time to encounter a runtime exception. This also works much like compilation errors in Play. It shows a page with the error and the relevant source lines. Now we get, &lt;code&gt;IndexOutOfBoundsException occured : Index: 0, Size: 0&lt;/code&gt;&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"agencyId"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="n"&gt;Agency&lt;/span&gt; &lt;span class="n"&gt;agency&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;agencies&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// error here&lt;/span&gt;

    &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;put&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"agencyId"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agency&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;put&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"agencyName"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;agency&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Apparently, we need to have an agency. That's generally simple enough. You just manually insert an agency into the &lt;code&gt;agency&lt;/code&gt; table. After that's done, we finally have a view of the actual application. It's very Bootstrap-y, but that's just fine. The workflow though, is not perfectly intuitive, but I'll talk about that some other day.&lt;/p&gt;
&lt;p&gt;That's not the end of it though, we still have to fix these bugs. The developer obviously didn't have to put up with this when they were working, so what happened? Also, the log is showing some weird things,&lt;/p&gt;
&lt;pre class="code literal-block"&gt;~        _            _
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/
~
~ play! 1.2.5, http://www.playframework.org
~
~ Ctrl+C to stop
~
CompilerOracle: exclude jregex/Pretokenizer.next
Listening for transport dt_socket at address: 8000
23:32:14,943 INFO  ~ Starting /Users/thomas/Workspace/maps/gtfs-editor
23:32:14,948 WARN  ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.secure)
23:32:14,948 INFO  ~ Module secure is available (/Users/thomas/.root/opt/play-1.2.5/modules/secure)
23:32:15,830 WARN  ~ You're running Play! in DEV mode
23:32:15,952 INFO  ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
23:32:28,792 ERROR ~

@6f02fa9dd
Internal Server Error (500) for request GET /

Compilation error (In /app/controllers/Check.java around line 10)
The file /app/controllers/Check.java could not be compiled. Error raised is : The type Check is already defined

play.exceptions.CompilationException: The type Check is already defined
    at play.classloading.ApplicationCompiler$2.acceptResult(ApplicationCompiler.java:246)
    at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:672)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:516)
    at play.classloading.ApplicationCompiler.compile(ApplicationCompiler.java:282)
    at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:426)
    at play.Play.start(Play.java:516)
    at play.Play.detectChanges(Play.java:630)
    at play.Invoker$Invocation.init(Invoker.java:198)
    at Invocation.HTTP Request(Play!)
23:32:31,551 INFO  ~ Connected to jdbc:postgresql://127.0.0.1/gtfs_editor
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/thomas/Workspace/maps/gtfs-editor/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/thomas/.root/opt/play-1.2.5/framework/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
23:32:32,490 INFO  ~ Initializing HBSpatialExtension
23:32:32,492 INFO  ~ Attempting to load Hibernate Spatial Provider org.hibernatespatial.postgis.DialectProvider
23:32:32,494 INFO  ~ Checking for default configuration file.
23:32:32,496 INFO  ~ No configuration file hibernate-spatial.cfg.xml on the classpath.
23:32:34,077 INFO  ~ Application 'gtfs-editor' is now started !
23:32:34,151 INFO  ~ Bootstrapping Database...
23:32:34,297 DEBUG ~ select count(*) as col_0_0_ from Agency agency0_ limit ?
play.exceptions.UnexpectedException: Unexpected Error
    at play.vfs.VirtualFile.contentAsString(VirtualFile.java:180)
    at play.templates.TemplateLoader.load(TemplateLoader.java:78)
    at play.test.Fixtures.loadModels(Fixtures.java:174)
    at jobs.BootstrapDatabase.doJob(BootstrapDatabase.java:57)
    at play.jobs.Job.doJobWithResult(Job.java:50)
    at play.jobs.Job.call(Job.java:146)
    at play.jobs.Job.run(Job.java:132)
    at play.jobs.JobsPlugin.afterApplicationStart(JobsPlugin.java:116)
    at play.plugins.PluginCollection.afterApplicationStart(PluginCollection.java:531)
    at play.Play.start(Play.java:547)
    at play.Play.detectChanges(Play.java:630)
    at play.Invoker$Invocation.init(Invoker.java:198)
    at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:189)
    at play.Invoker$Invocation.run(Invoker.java:276)
    at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:229)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:680)
Caused by: play.exceptions.UnexpectedException: Unexpected Error
    at play.vfs.VirtualFile.inputstream(VirtualFile.java:111)
    at play.vfs.VirtualFile.contentAsString(VirtualFile.java:178)
    ... 22 more
Caused by: java.io.FileNotFoundException: /Users/thomas/.root/opt/play-1.2.5/modules/docviewer/app/initial-agencies-data.yml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.&amp;lt;init&amp;gt;(FileInputStream.java:120)
    at play.vfs.VirtualFile.inputstream(VirtualFile.java:109)
    ... 23 more
23:32:34,316 ERROR ~ java.lang.RuntimeException: Cannot load fixture initial-agencies-data.yml: Unexpected Error
23:32:40,989 DEBUG ~ select account0_.id as id15_, account0_.active as active15_, account0_.admin as admin15_, account0_.agency_id as agency9_15_, account0_.email as email15_, account0_.lastLogin as lastLogin15_, account0_.password as password15_, account0_.passwordChangeToken as password7_15_, account0_.username as username15_ from Account account0_ where account0_.username=? limit ?
23:32:40,994 DEBUG ~ select count(*) as col_0_0_ from Account account0_ limit ?
23:32:40,999 DEBUG ~ select nextval ('hibernate_sequence')
23:32:41,051 DEBUG ~ insert into Account (active, admin, agency_id, email, lastLogin, password, passwordChangeToken, username, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?)
23:32:41,061 DEBUG ~ select agency0_.id as id24_, agency0_.color as color24_, agency0_.defaultLat as defaultLat24_, agency0_.defaultLon as defaultLon24_, agency0_.defaultRouteType_id as default12_24_, agency0_.gtfsAgencyId as gtfsAgen5_24_, agency0_.lang as lang24_, agency0_.name as name24_, agency0_.phone as phone24_, agency0_.systemMap as systemMap24_, agency0_.timezone as timezone24_, agency0_.url as url24_ from Agency agency0_ order by agency0_.name
23:32:41,175 ERROR ~

@6f02fa9dg
Internal Server Error (500) for request GET /

Execution exception (In /app/controllers/Application.java around line 57)
IndexOutOfBoundsException occured : Index: 0, Size: 0

play.exceptions.JavaExecutionException: Index: 0, Size: 0
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:237)
    at Invocation.HTTP Request(Play!)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.RangeCheck(ArrayList.java:547)
    at java.util.ArrayList.get(ArrayList.java:322)
    at controllers.Application.initSession(Application.java:57)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:510)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:484)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:479)
    at play.mvc.ActionInvoker.handleBefores(ActionInvoker.java:328)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:142)
    ... 1 more
&lt;/pre&gt;


&lt;p&gt;After &lt;code&gt;23:32:34&lt;/code&gt; is when I get the login page. &lt;code&gt;23:32:40&lt;/code&gt; is after I've logged in.&lt;/p&gt;
&lt;h4&gt;Second Pass&lt;/h4&gt;
&lt;p&gt;So how did you do? First, the error that &lt;code&gt;type Check already defined&lt;/code&gt; usually does mean that &lt;code&gt;Check&lt;/code&gt; was already defined elsewhere. Looking in the app folder though, there was nothing of the sort. It's the only one there that was &lt;code&gt;Check.java&lt;/code&gt;. But remember the secure module? Modules work by providing source files and Play just compiles them all together. Bingo, &lt;code&gt;Check.java&lt;/code&gt;. Doing a diff shows nothing was changed. So the solution really was just simply delete &lt;code&gt;Check.java&lt;/code&gt; and also &lt;code&gt;Secure.java&lt;/code&gt;. No more compilation errors!&lt;/p&gt;
&lt;p&gt;The next question is, how do you get the initial user? There actually is some code that looks like it creates the default admin user,&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Security&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;isConnected&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
    &lt;span class="n"&gt;Account&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;find&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"username = ?"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Security&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;connected&lt;/span&gt;&lt;span class="o"&gt;()).&lt;/span&gt;&lt;span class="na"&gt;first&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Account&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"admin"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"admin"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"admin@test.com"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;save&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;You can actually see this in action at &lt;code&gt;23:32:41,051&lt;/code&gt; in the log. So what's wrong with all of this? The account creation happened after I've already logged in. In fact, &lt;code&gt;Security.isConnected()&lt;/code&gt; checks whether the user is already logged in or not. How does this even make sense?&lt;/p&gt;
&lt;p&gt;Lastly, we have the problem of the agencies. Just by looking at the log, you can safely say we're missing a file called &lt;code&gt;initial-agencies-data.yml&lt;/code&gt;. Ok, apparently it's a &lt;a href="http://www.playframework.com/documentation/1.2.5/test#fixtures"&gt;fixture&lt;/a&gt; like you would use for testing. It's easy enough to infer what the file's contents should be. We just copy it over from the GTFS data.&lt;/p&gt;
&lt;p&gt;But then where do you put the file? If you look at the log, it says &lt;code&gt;/Users/thomas/.root/opt/play-1.2.5/modules/docviewer/app/initial-agencies-data.yml&lt;/code&gt; but that doesn't look right. That's in the Play distribution directory, probably not somewhere something app-specific should go into. Well, a fixture is used for testing, so maybe the &lt;code&gt;test/&lt;/code&gt; directory? No, that doesn't work either since we're not running a test.&lt;/p&gt;
&lt;p&gt;What I ended up doing was just looking at the sources for &lt;code&gt;Fixtures.load&lt;/code&gt;. If you follow the stack trace, you end up finding &lt;code&gt;Play.javaPath&lt;/code&gt; which sort of works like PATH for Fixtures and some other things. So where can we put the file? &lt;code&gt;app/&lt;/code&gt; and &lt;code&gt;conf/&lt;/code&gt;. And with that, we're done.&lt;/p&gt;
&lt;h4 id="conclusion"&gt;Conclusion&lt;/h4&gt;

&lt;p&gt;GTFS Editor is very much in development. Just getting it to run was problematic. There also seem to be a lot of missing issues judging from the Github Issues page. If you want to try it out for yourself, I suggest you clone &lt;a href="https://github.com/thatsmydoing/gtfs-editor"&gt;my branch&lt;/a&gt; as I've fixed the issues discussed earlier. The default login is &lt;code&gt;admin:admin&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Even after getting it to run, it's still not quite usable. Not in the UX sense, but you really can't do much with it. There is no way to import the GTFS data into the webapp. There is something like import from TransitWand but even that is unclear to me. And even if we do get that running as well, we still don't have any data we can play around with. We would need database dumps from the already running tools for these to be of any use right now.&lt;/p&gt;&lt;/div&gt;</description><category>lets-debug</category><category>philippine-transit-app</category><category>programming</category><guid>http://pleasantprogrammer.com/posts/gtfs-editor.html</guid><pubDate>Wed, 10 Jul 2013 03:30:01 GMT</pubDate></item></channel></rss>