OBP-API icon indicating copy to clipboard operation
OBP-API copied to clipboard

Running the API in Production Mode (Ubuntu 16)

Open PiotrFerenc opened this issue 7 years ago • 3 comments

clone from master and after command mvn package i had errors.

Plz help me :) ` Discovery completed in 10 seconds, 822 milliseconds. Run starting. Expected test count is: 9 AuthUserTest: code.model.AuthUserTest *** ABORTED *** java.lang.RuntimeException: Unable to load a Suite class that was discovered in the runpath: code.model.AuthUserTest at org.scalatest.tools.DiscoverySuite$.getSuiteInstance(DiscoverySuite.scala:81) at org.scalatest.tools.DiscoverySuite$$anonfun$1.apply(DiscoverySuite.scala:38) at org.scalatest.tools.DiscoverySuite$$anonfun$1.apply(DiscoverySuite.scala:37) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234) at scala.collection.Iterator$class.foreach(Iterator.scala:893) at scala.collection.AbstractIterator.foreach(Iterator.scala:1336) at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) at scala.collection.AbstractIterable.foreach(Iterable.scala:54) at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)

Cause: java.lang.ExceptionInInitializerError: at bootstrap.liftweb.Boot$$anonfun$boot$12.apply(Boot.scala:214) at bootstrap.liftweb.Boot$$anonfun$boot$12.apply(Boot.scala:214) at net.liftweb.common.Logger$class.info(Logging.scala:231) at net.liftweb.common.WrappedLogger.info(Logging.scala:285) at bootstrap.liftweb.Boot.boot(Boot.scala:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply(ClassHelpers.scala:357)

Cause: java.lang.NullPointerException: An Empty Box was opened. The justification for allowing the openOrThrowException was OBP-00001: Hostname not specified. Could not get hostname from Props. Please edit your props file. Here are some example settings: hostname=http://127.0.0.1:8080 or hostname=https://www.example.com at net.liftweb.common.EmptyBox.openOrThrowException(Box.scala:867) at net.liftweb.common.EmptyBox.openOrThrowException(Box.scala:862) at code.api.Constant$.(constant.scala:12) at code.api.Constant$.(constant.scala) at bootstrap.liftweb.Boot$$anonfun$boot$12.apply(Boot.scala:214) at bootstrap.liftweb.Boot$$anonfun$boot$12.apply(Boot.scala:214) at net.liftweb.common.Logger$class.info(Logging.scala:231) at net.liftweb.common.WrappedLogger.info(Logging.scala:285) at bootstrap.liftweb.Boot.boot(Boot.scala:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

*** RUN ABORTED *** java.lang.ExceptionInInitializerError: at bootstrap.liftweb.Boot$$anonfun$boot$12.apply(Boot.scala:214) at bootstrap.liftweb.Boot$$anonfun$boot$12.apply(Boot.scala:214) at net.liftweb.common.Logger$class.info(Logging.scala:231) at net.liftweb.common.WrappedLogger.info(Logging.scala:285) at bootstrap.liftweb.Boot.boot(Boot.scala:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.liftweb.util.ClassHelpers$$anonfun$createInvoker$1.apply(ClassHelpers.scala:357)

Cause: java.lang.NullPointerException: An Empty Box was opened. The justification for allowing the openOrThrowException was OBP-00001: Hostname not specified. Could not get hostname from Props. Please edit your props file. Here are some example settings: hostname=http://127.0.0.1:8080 or hostname=https://www.example.com at net.liftweb.common.EmptyBox.openOrThrowException(Box.scala:867) at net.liftweb.common.EmptyBox.openOrThrowException(Box.scala:862) at code.api.Constant$.(constant.scala:12) at code.api.Constant$.(constant.scala) at bootstrap.liftweb.Boot$$anonfun$boot$12.apply(Boot.scala:214) at bootstrap.liftweb.Boot$$anonfun$boot$12.apply(Boot.scala:214) at net.liftweb.common.Logger$class.info(Logging.scala:231) at net.liftweb.common.WrappedLogger.info(Logging.scala:285) at bootstrap.liftweb.Boot.boot(Boot.scala:214) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:55 min [INFO] Finished at: 2018-03-07T18:51:02+01:00 [INFO] Final Memory: 81M/739M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.scalatest:scalatest-maven-plugin:1.0:test (test) on project OBP-API: There are test failures -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException `

PiotrFerenc avatar Mar 07 '18 18:03 PiotrFerenc

What looks like from the log error is that you props file is missing the hostname , would be great if you can share your props file and please dont forget to obscure password.

maektwain avatar Mar 27 '18 02:03 maektwain

src/main/resources/props/test.default.props connector=mapped

src/main/resources/props/default.props connector=mapped

src/main/resources/props/production.default.props connector=mapped

PiotrFerenc avatar Mar 27 '18 07:03 PiotrFerenc

Well, if you are saying that you have only connector = maped inside the props then you need to add this also

## You can use a no config needed h2 database by setting db.driver=org.h2.Driver and not including db.url
db.driver=org.h2.Driver
db.url=jdbc:h2:./lift_proto.db;DB_CLOSE_ON_EXIT=FALSE


## Our own remotely accessible URL
## This is needed for oauth to work. it's important to access the api over this url, e.g.
## If this is 127.0.0.1 do NOT use localhost to access it.
## (this needs to be a URL)
hostname=http://127.0.0.1:8080

## This is only useful for running the api locally via RunWebApp
## If you use it, make sure this matches your hostname port!
## If you want to change the port when running via the command line, use "mvn -Djetty.port=8080 jetty:run" instead
dev.port=8080

Please check this file for reference https://github.com/OpenBankProject/OBP-API/blob/develop/src/main/resources/props/sample.props.template

maektwain avatar Mar 27 '18 08:03 maektwain