1

I am trying to run my war file using xsbt-web-plugin. My war itself does not contain tomcat-jdbc-pool jar and javax-servlet-api. I tried using container configuration. But sbt complains configuration does not exist. If I use provided configuration, webapp-runner fails.

I am sure I am missing something. But unable to figure it out.

WARNING: Failed to register in JMX: [javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool.DataSourceFactory]]

Rashid Shaikh
  • 395
  • 4
  • 12

1 Answers1

1

What version of xsbt-web-plugin are you using? Can you post the contents of your sbt build configuration?

The Tomcat plugin in xsbt-web-plugin relies on webapp-runner, which does not appear to bundle the tomcat-jdbc library. You can add it via containerLibs in Tomcat:

enablePlugins(TomcatPlugin)

containerLibs in Tomcat += "org.apache.tomcat" % "tomcat-jdbc" % "8.5.15"
earldouglas
  • 13,265
  • 5
  • 41
  • 50
  • Thanks @earldouglas. It worked. I am using version 4.0.1. For some reason I thought containLibs is only for custom containers. Thanks for your help. – Rashid Shaikh Jan 21 '18 at 03:57