java HTTP 错误:503 原因:由码头提供支持的服务不可用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26991057/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
HTTP ERROR: 503 Reason: Service Unavailable powered by jetty
提问by sanil sathyan
I am trying to develop a web application using java. I am following broadleaf commerce's tutorials [http://www.broadleafcommerce.com/docs/core/current/getting-started].
我正在尝试使用 java 开发一个 web 应用程序。我正在关注阔叶商业的教程 [ http://www.broadleafcommerce.com/docs/core/current/getting-started]。
At the beginning I am able to run my demo site. But after following the documentation for switching to MySql[http://www.broadleafcommerce.com/docs/core/current/tutorials/getting-started-tutorials/switch-to-mysql-tutorial],Iwas not able to run the site.
一开始我可以运行我的演示站点。但是在遵循切换到 MySql[ http://www.broadleafcommerce.com/docs/core/current/tutorials/getting-started-tutorials/switch-to-mysql-tutorial]的文档之后,我无法运行地点。
I got the following error in the browser
我在浏览器中收到以下错误
HTTP ERROR: 503
HTTP 错误:503
Problem accessing /. Reason:
访问 / 时出现问题 原因:
Service Unavailable
Powered by Jetty://
由 Jetty 提供支持://
Progress at Eclipse console:
Eclipse 控制台的进度:
[artifact:mvn] [ERROR] 14:59:03 ContextLoader - Context initialization failed
[artifact:mvn] org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
[artifact:mvn] 2014-11-18 14:59:03.673:INFO:oejs.AbstractConnector:Started [email protected]:8080
[artifact:mvn] 2014-11-18 14:59:03.939:INFO:oejus.SslContextFactory:Enabled Protocols [SSLv2Hello, SSLv3, TLSv1] of [SSLv2Hello, SSLv3, TLSv1]
....
...
[artifact:mvn] [INFO] Started Jetty Server
[artifact:mvn] 2014-11-18 14:59:03.950:INFO:oejs.AbstractConnector:Started [email protected]:8443
[artifact:mvn] [ WARN] 14:59:08 SqlExceptionHelper - SQL Error: 0, SQLState: null
[artifact:mvn] [ERROR] 14:59:08 SqlExceptionHelper - Cannot create PoolableConnectionFactory (Communications link failure
[artifact:mvn] The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
[artifact:mvn] [ERROR] 14:59:08 JobRunShell - Job DEFAULT.rebuildIndexJobDetail threw an unhandled Exception:
[artifact:mvn] org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'rebuildIndex' on target class [class org.broadleafcommerce.core.search.service.solr.SolrSearchServiceImpl] failed; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
web.xml
网页.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID">
<servlet>
<servlet-name>heatclinic</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/applicationContext-servlet-cms-contentClient.xml
/WEB-INF/applicationContext-servlet.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>heatclinic</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>RESTApiServlet</servlet-name>
<url-pattern>/api/v1/*</url-pattern>
</servlet-mapping>
</web-app>
回答by phillipuniverse
Looks like it could not connect to MySQL. Double-check your MySQL connection settings and that the MySQL service is actually started.
看起来它无法连接到 MySQL。仔细检查您的 MySQL 连接设置并确认 MySQL 服务已实际启动。