I cloned the beersample-java2 app from GitHub, but I can’t get it to run. It seems to build OK. Hoping someone else has encountered this problem already.
OS X 10.10 (Yosemite).
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'viewResolver' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafViewResolverConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.thymeleaf.spring4.SpringTemplateEngine org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafViewResolverConfiguration.templateEngine; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafDefaultConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private final java.util.Collection org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafDefaultConfiguration.templateResolvers; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$DefaultTemplateResolverConfiguration': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot find template location: class path resource [templates/] (please add some templates or check your Thymeleaf configuration)
beersample-java2 and tutorial need a makeover. The problem arises because the templates directory is not found in the classpath. Thing is, this is a Maven project without a maven structure, so it kind of make sense .
I will push a refactor of this branch to have a correct Maven structure, hopefully importing it to the IDE and running the Application will correctly work after that (I know it does in IntelliJ).
Unfortunately I know nothing about Maven which probably doesn’t help.
I am really just wanting to know how to build a program in Java which works with Couchbase, I’m not looking to build a web application, just a simple program (akin to a batch program) which will massage data in a Couchbase server. Maybe it’s worth me trying to create something from scratch? It’s not the coding that I find a challenge, it’s the project setup/configuration.
latest version on master should now work better out-of-the-box. if you previously managed to get the error, restarting from scratch with same steps should now work I think (or maybe refreshing the project in NetBeans after a git pull)
If you want, also have a look at the work in progress branch rxexample, at this point there’s no GUI but if you’re interested in RxJava this is more relevant (eg look at beers and breweries controllers).
I want to write a Java program that will grab a set of docs from Couchbase, calculate some stats from those docs and update other docs accordingly. I intend to use views/MapReduce to calculate the stats. The Java program will just coordinate things and update the docs.
The updated docs in the Couchbase database/server will be used by an iOS app I am developing.
The Java program will act like a batch job and run at regular intervals; I will run it from the command line. Will see how I go tomorrow. Thanks for your help @daschl
FYI, I’m using NetBeans 8 on OS X 10.10 (Yosemite).