【发布时间】:2016-03-16 20:14:00
【问题描述】:
我一直在学习 Heroku (https://devcenter.heroku.com/articles/java-webapp-runner) 的教程,学习如何使用 webapp-runner.jar 运行 war 文件。现在我想在 heroku 上运行 cbioportal (https://github.com/cbioportal/cbioportal)。我已经设法将 webapp-runner.jar 添加为依赖项,请参阅:https://github.com/inodb/cbioportal/tree/heroku。
当我从 repo 目录运行以下命令时:
java -Djava.naming.factory.initial=org.apache.naming.java.javaURLContextFactory \
-jar portal/target/dependency/webapp-runner.jar --port 9099 portal/target/portal
我收到这样的错误:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityMapper' defined in class path resource [applicationContext-business.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext-business.xml]: Cannot resolve reference to bean 'businessDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'businessDataSource' defined in class path resource [applicationContext-business.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [java:comp/env/jdbc/mydb] is not bound in this Context. Unable to find [java:comp].
我尝试传递本地 Tomcat 安装的 context.xml 并直接在文件中设置 mysql 连接字符串,但无济于事。
【问题讨论】:
标签: java maven tomcat heroku jndi