web3jをspring-mvcで立ち上げようとしたらこんなのでた

Etherum Web3j coreを使おうとして spring-boot と spring-mvcをうまく混在させたくて
設定してましたが以下のようなエラーが出てました

Caused by: java.lang.IllegalStateException: No SpringApplication sources have been defined. Either override the configure method or add an @Configuration annotation
at org.springframework.util.Assert.state(Assert.java:73)
at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:127)
at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:87)
at com.sharebaseinc.web.WebInitializer.onStartup(WebInitializer.java:13)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5245)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more

初期化クラスのWebInitializerを@SpringBootApplicationとして設定すると以下のようなエラーになり

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sharecoin-web]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
... 6 more
Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.helpers.NOPLoggerFactory loaded from file:/home/kouichi/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/sharecoin-web/WEB-INF/lib/slf4j-api-1.7.25.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.helpers.NOPLoggerFactory
at org.springframework.util.Assert.instanceCheckFailed(Assert.java:637)
at org.springframework.util.Assert.isInstanceOf(Assert.java:537)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:274)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:98)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:230)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:209)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:69)
at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:292)
at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:154)
at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:134)
at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:87)
at com.sharebaseinc.web.WebInitializer.onStartup(WebInitializer.java:13)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5245)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more

これをsl4jが依存複数しているみたいなので、web3jの設定から産sy等しているsprinbgootを外します。


org.web3j
web3j-spring-boot-starter
1.6.0


org.springframework.boot
spring-boot-starter-logging



そこからSpring-MVCの設定クラス*1と初期化クラス*2を以下を参考に書き換えます
書き換えると行っても、Annotationを記載するのと継承クラスを変えただけ。

https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html

  • WebMvcConfigurer

@Configuration
@EnableWebMvc
public class ShareBaseWebConfig implements WebMvcConfigurer

  • WebInitializer

public class WebInitializer implements WebApplicationInitializer {

とりあえず起動しました。
他のところでエラーになるかもしれないですが一旦ここまで

*1:ShareBaseWebConfig implements WebMvcConfigurer

*2:WebApplicationInitilizer

1週間たったので少し食べてみました。

一週間立ったので、トマトピクルスをつくったので
食べてみました。

しかしなぜかフラグ感が半端ないです。*1

味は、米酢とローレルでつけたシンプルなやつだったので、
米酢の味でした・・・
ラストワン賞(゚∀゚)

インスタ映、ねらったはずが、ツイッター

*1:※お昼すぎに食べてお腹いたくなっていないので大丈夫でした

トマトピクルスを作ろうプロジェクト

会社の同僚の笹本さんの弟さんが農家のかたで、
ハウスのトマト栽培を始めるということで、
間引きする青トマトをピクルスにして売れないか。
自分のプロダクトを作りたい、すこしでも美味しくいただいてしまいたい*1と思いはじめました。
この日で来たのはこんな感じです。*2


※僕の持っている青トマトのピクルスのイメージは、

  • 実家でつくっていたミニトマトの浅漬
  • 昔おしゃれスーパのなかにあったワインのお店で瓶詰めになって売っていたもの。*3

(´・ω・`)青トマトは市場にでないし、農家の人がつくる郷土の料理だとおもうので、なかなか表には出てこないのだと思います。

まずは、みんなで作って、食べたりして、家庭菜園で青トマトが作れる人は、試して欲しいし。
クラフトビールと合わせて食べるピクルス好きな人はぜひ試してもらいたいなと思っています。

プロジェクト的にsharebase.InCのみんなでワイワイやっています。
部屋の雰囲気は↓みたいな感じです。((いい写真があったのでちょっと使いますた。(*´∀`*)))

この日はとりあえず、赤いトマトも来たので、食べたり、青トマトを漬ける準備をしました。

フレッシュなトマトはそのまま


潰れちゃった奴は火を通すような料理にして食べました。

  • トマトのチーズ焼き(内木さん作)

  • 鶏肉のトマト煮(僕作です(*´∀`*))


いろいろ美味しかったっす。ヾ(。>﹏<。)ノ゙✧*。
(*´∀`*)ではまたー

*1:実家の青トマトの浅漬はほんと美味しいです。ヾ(。>﹏<。)ノ゙✧*。

*2:まだ7月22日現在は漬けているところです。

*3:ちょっと探してみたら海外のamazonでは売っているみたいですね。https://www.amazon.com/Jake-Amos-Pickled-Green-Tomatoes/dp/B008DZ02OI

チョー間空いたけれど、久しぶりにブログ書くよ

いろいろ勉強したりして、プロジェクトも内外でやったりしたけれど、
やっぱり何か形にしたいとおもって
今やっていることとかを書いていきたいと思います。

もうちょっと事情もあって、今の会社も、関わっているプロジェクトも
ブログ書く場所がないので、とりあえずここでって感じです。

結果がでて、儲かったらwordpressぐらい入れてもらいたいものです。
そして、僕も業務時間とかでやりたいものです。

では〜ヾ(。>﹏<。)ノ゙✧*。またよろしくです。

会社の有志でAIの勉強会をしてきました。7月分

会社はこちら*1ですが。
今回は、あまり会社とは関係なくやってますw.*2

先月に引き続いて、
会社の有志でAIの勉強をしてます。場所はいつものsharebase*3です。

サブリーダの安立さん。手に持っているのがRaspberyPIとトラ技3月号のスマートスピーカの追加デバイス
*4

スマートスピーカを組み立ててWatsonとNTTのセバスチャンにつなげて見てました。*5

普通はこんな感じでスマホで使うみたいです。

API経由でアクセスしたらこんな感じだったみたいです。

イマイチ内容が薄いですね(゚∀゚)
技術バリな話できたらと思います。

*1:http://www.trinitas.co.jp/

*2:CodeRetreatは協賛してもらっていますので、CodeRetreat@Geekbarではぜひ参加してね

*3:http://www.sharebaseinc.com/

*4:追加デバイス自体は、5月の連休中にDustinさんと作成しました。ここで手に持っているのは、完成品のやつ

*5:写真にでているサブリーダの安立さんが、自社で話題のあったNTTセバスチャンとの接続をしてみたかったみたいです。