I've been trying to reintroduce myself to Spring MVC @RequestMapping and working with Java in IntelliJ after 5 years away from Java and having primarily used Netbeans for any development. My last experience with Java was with Netbeans helping manage a Maven build.
I had my
@RequestMapping annotations set up, and IntelliJ is launching Tomcat directly (vs. deploying to an already running instance). I created my
*-servlet.xml configurations, and had my
.jsp files placed properly. Everything seemed to be in good shape and compiling fine, but the routes I specified we not showing up with the project was run.
Eventually, I went to Build -> Build Artifacts -> ...:war:exploded -> Edit... and went the Project Settings -> Artifacts tab and noticed "Library 'org.springframework:spring-web:4.3.13-RELEASE' required for module '...' is missing from the artifact". Upon clicking "Fix" and adding the dependency. Some combination of that dependency and 'org.springframework:spring-webmvc:4.3.13-RELEASE' missing prevented the
org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping.registerHandler from processing my
In our Rails databases, we use multiple Postgres schemas. This is partly for partitioning archive data from fresh data. On a new Rails 5 project, I started having tests fail once the models had the "archivable" concern added, which depended on an archive schema existing.
Ultimately, the problem is that the archive schema wasn't being created in the test database, because
rake db:test:prepare performs a
db:test:load which was loading the
db/schema.rb, which is completely ignorant of the Postgres-specific schema concept.
In order to fix this without attempting ugly hacks, the simplest solution was just to switch to using
structure.sql for the Rails schema dump.
config/application.rb, insert the following in your
Application class definition:
config.active_record.schema_format = :sql
If you haven't already added the additional schema(s) to your
schema_search_path in your
You'll need to run
rake db:migrate to force
structure.sql generation before running tests again. Also, be sure to switch from
structure.sql if you're committing this file.
I needed to run an old version of Postgres in order to be supported by the version of Rails I was working with, and I had a new Mac with High Sierra installed. Found out after a bit of "Why doesn't this postgres formula link its executables?" that it was precisely because of the age of the version that it wasn't linking. (In my old Linux days I would have just automatically added the PATH or made the link, but I also would have probably rebuilt the Linux install within a few months, anyway.)