使用 Google Cloud SQL 的 Maven GAE 插件

发布于 2025-01-08 18:44:37 字数 1544 浏览 5 评论 0原文

早上好,

我正在尝试本地测试我的网络应用程序,该应用程序使用:

  • Spring(核心+ MVC)
  • Google AppEngine
  • Google Cloud SQL
  • Hibernate

在此页面 https://developers.google.com/cloud-sql/docs/developers_guide_java Google 解释了如何让 hello world 运行,没错。 我部署到 AppEngine 没有任何问题。

下一个需要是使用本地标准 mysql 实例在本地系统上进行测试,该文档将在解释中继续。您可以通过命令行或 Google Eclipse 插件提供本地访问凭据。

但我使用 Maven GAE 插件 http://www.kindleit.net/maven_gae_plugin/ 并且简单mvn gae:run 最终出现以下错误:

Cannot resolve reference to bean 'mySessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: System property rdbms.driver must be set.:
java.lang.IllegalStateException: System property rdbms.driver must be set.
    at com.google.appengine.api.rdbms.dev.LocalRdbmsServiceLocalDriver.registerDriver(LocalRdbmsServiceLocalDriver.java:80)

这是一个非常具有描述性的错误,所以我拼命尝试:

mvn gae:run -Drdbms.server=local -Drdbms.driver=com.mysql.jdbc.Driver -Drdbms.url=jdbc:mysql://localhost:3306/prova?user=root&password=pass

...没有结果! :-(

救命!哦

Good morning,

I am trying to local test my web application, which makes use of:

  • Spring (core + MVC)
  • Google AppEngine
  • Google Cloud SQL
  • Hibernate

In this page https://developers.google.com/cloud-sql/docs/developers_guide_java Google explains how to make the hello world run, and that's right.
I deploy to AppEngine with no problems.

The next need is testing on the local system, with a local standard mysql instance and that document goes ahead in the explanation. You can give your local access credentials by command-line or by Google Eclipse Plugin.

But I am using the Maven GAE Plugin http://www.kindleit.net/maven_gae_plugin/ and simple mvn gae:run ends up with this error:

Cannot resolve reference to bean 'mySessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: System property rdbms.driver must be set.:
java.lang.IllegalStateException: System property rdbms.driver must be set.
    at com.google.appengine.api.rdbms.dev.LocalRdbmsServiceLocalDriver.registerDriver(LocalRdbmsServiceLocalDriver.java:80)

That's a pretty descriptive error, so I desperately tried:

mvn gae:run -Drdbms.server=local -Drdbms.driver=com.mysql.jdbc.Driver -Drdbms.url=jdbc:mysql://localhost:3306/prova?user=root&password=pass

... with no result! :-(

Help! O.O

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纵性 2025-01-15 18:44:37

使用插件的jvmFlags解决

Solved using plugin's jvmFlags

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文