这是在创建时失败的 spring bean 我使用 https://console.run.pivotal.io 的凭据页面提供的 url 值站点,我尝试启动它的地方。
destroy-method="close">
value="jdbc:mysql://name:password@us-cdbr-iron-east-02.cleardb.net:3306/ad_c6046f48484b2d2" />
这里是堆栈
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'hibernate4AnnotatedSessionFactory' defined in
> ServletContext resource
> [/WEB-INF/spring/appServlet/servlet-context.xml]: Invocation of init
> method failed; nested exception is java.lang.NumberFormatException:
> For input string: "password@us-cdbr-iron-east-02.cleardb.net"
您的 JDBC URL 错误。 JDBC URL 格式:jdbc:mysql://:/
Xem cái này liên kết JDBC URL 格式的详细信息。
所以你的正确配置应该是
destroy-method="close">
value="jdbc:mysql://us-cdbr-iron-east-02.cleardb.net:3306/ad_c6046f48484b2d2" />
Để ý:对于用户名和密码,我添加了两个 beans:property。
Tôi là một lập trình viên xuất sắc, rất giỏi!