IntelliJ Idea Bug in 2016.1.2

I hit a bug in Idea 2016.1.2 that I wanted to share in case anyone else is hitting the same issue. I was trying to stand up a new Spring Boot project last week and when I what try to launch the app through the IDE the embedded tomcat server would throw an exception.

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133) ~[spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at com.chooseenergy.auth.AuthApplication.main(AuthApplication.java:14) [classes/:na]Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:185) ~[spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:158) ~[spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130) ~[spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
... 8 common frames omitted

The weird thing was if I ran the maven spring-boot:run plugin the app ran perfectly. I did all sorts of things with no luck to work around it. I starting worrying about it, thinking if I can’t find a solution to this, it is going to be hard to sell using Spring Boot for our Microservices in my new role as we can’t even properly debug them. Finally after no luck I opened a bug against Idea over here. As is often the case, just the simple act of reporting the bug gets me thinking about possibilities and I solved the issue before I heard back from JetBrains. It turns out that the provided scope is broken in Idea and by default the spring-boot-starter-tomcat is marked scope provided in the generated maven pom file from the Spring Boot Initializer. As soon as I removed the provided scope Idea got happy. Jetbrains later updated the ticket as a duplicate of a bug with provided scope not working. So if you see that stack trace in Idea try removing the provided scope to work around it.

And now for something completely different

I need to apologize for the lack of posts for the month of May. It has been a hectic month or so. In April several interesting opportunities were presented to me and I decided to make a change and go back to working for a startup company. It is no secret to anyone that I really enjoy startup work, but it is always hard to make a change like this, as I was very fond of the people I worked with, and had an amazing boss and loved the project I worked on. One of the things I love about working for smaller companies is that you have this amazing opportunity to have a huge impact. You can make the difference between no revenue coming in and the company prospering down the line. When you find yourself part of a 13,000 employee organization that brings in say 3 Billion a year no matter how great your efforts you can never really move the needle and for me shipping something that really impacts the company is immensely rewarding.

When I joined my previous role I was employee 90. They were post startup so you didn’t have runway concerns, but they were still hungry and chasing revenue to give you that startup feel. It was definitely more corporate than a startup, but it still had that great energy. It ended up being an amazing role for me in my career as well, I worked with some brilliant people who really helped me grow as a developer and help me improve my technical leadership skills. I will be forever grateful for that opportunity. While I was there they company grew from 90 to about 150 people and we shipped more larger and far reaching projects than any role I have held to date. It is really amazing what being a part of an organization like that can do for your own personal growth. After we were acquired by a company of 13,000+ employees spread all over the world it is hard for the energy not to change. There were still some great opportunities in the new organization, but the things that really energize me and excite me about going to work started to change. That being said I had an amazing role, and I got to work in the most interesting parts of our system and had so much creative control over my work I wasn’t ready to immediately make a change. I decided I would try out the larger corporation and see how it went. After doing that for a year I finally decided in January of 2015 that if an interesting opportunity came along I would pursue it, but I didn’t opt to actively look for a new role, cause I really liked what I was doing and my coworkers.

Throughout 2015 I think I saw 2 interesting opportunities the entire year. One seemed like a great fit but I was unwilling to do the commute. It was close to what I wanted but still seemed like a larger company that is ideal for my personality so I opted not to interview with them. A second opportunity came along in a startup that was at 90 employees and super close to my house. They were trying to bring in a lead developer like I was at the time. The problem there was the tech stack was something I had never done. They were a Python shop doing Django, but I figured since they were interested in me I would interview and if I liked the place I would be willing to learn the Python stack. Why not the software industry is all about learning and if you can get into an exciting place to work and it would be close enough that I could go home for lunch, I had to check it out. The interviews there went really well, and I even ended up interviewing with their new CTO on his 4th day on the job. In the end they didn’t extend me an offer (probably because I was above their band for the position and I didn’t do Python, but I still got a lot out of doing the interview and meeting with them.)

Fast forward to this year, I was thinking if I went a whole year and only saw two interesting positions out there that says a lot for how great my role was. And it really helped me appreciate how many bad positions their are out there. It is always nice to be in a place where you can be grateful for everything you have and that year of being open to new things really did that for me. Everything was going along great in 2016, I implemented a bunch of improvements to our Cassandra data layer for my first project of the year and then was working on a major restructuring of our app to move off of JBoss and from an Ear deployment to a War deployment. That got me to dive way deep into the guts of Java Transaction Management. I learned a crazy amount of how spring integrates with JTA and where Spring’s local transactions really fall apart. I had just gotten to the point where I had the standalone Narayana transaction layer working in our application when a recruiter dropped a very interesting opportunity for a startup company in my lap. I got the details and the commute appeared to be slightly worse than what I had, but the job sounded great so I sent over my info. I had a good first phone interview and got through a second phone interview when it stalled out. In the mean time another opportunity came along. This one had a great location (downtown), wasn’t quite as good size wise as it was about 250 people vs 50 people, but still sounded amazing as far as the role. I made it through the first round phone screen there and setup the second round phone screen. About this time the first company came back and wanted to do an in person interview so we scheduled that. I ended up interviewing at the first company and the interviews went great. I got home and a 3rd opportunity fell into my lap. I sent a resume off that way as it was a startup company doing mobile security and it sounded interesting. About an hour later I heard back from the first company and they wanted to move forward with an offer, so we started discussing that. In the meantime the following business day I had a call with company number 2. It turns out for that role they would need me to fly to Portland at least every 6 weeks which doesn’t really work for me with my kids being so young. So I opted not to move forward with that role about about that time a verbal agreement was reached with the first company so I called off moving forward with company number 3.

April was a whirlwind for me, but I am happy to say I am back in startup land and loving it. In my new role I was expecting to be working on their older code fixing issues and things like that a bit to learn the code base, but instead of that we are starting off the first 2 sprints standing up a brand new Spring Boot based Micro-service. I have to say I am living the dream as this is exactly the type of work I have been wanting to get involved with for the last year and now that is the first thing I am doing in my new role. In the new company we are about 50 people with about 40 of them in San Francisco and 10 of us in the Dallas area. I am looking forward to taking a trip out to San Francisco to meet the rest of my coworkers, but based on how my June is looking I don’t think I will make it over there till July. Going forward I am going to try to get back on track and post at least once a week, but if I am missing it is because there are too many new things to learn. Here’s to an amazing 2016, it has already been a great year, can’t imagine what else is in store for me.