HTTP错误:503原因:服务不可用由码头提供支持

时间:2014-11-18 09:43:01

标签: java mysql maven-jetty-plugin broadleaf-commerce

我正在尝试使用java开发Web应用程序。我正在关注broadleaf commerce的教程 [http://www.broadleafcommerce.com/docs/core/current/getting-started]

一开始我可以运行我的演示站点。但是在遵循切换到MySql的文档之后[http://www.broadleafcommerce.com/docs/core/current/tutorials/getting-started-tutorials/switch-to-mysql-tutorial],I无法运行该站点。

我在浏览器中出现以下错误

HTTP错误:503

访问/的问题。原因是:

Service Unavailable

由Jetty提供://

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 SelectChannelConnector@0.0.0.0: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 SslSelectChannelConnector@0.0.0.0: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 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>

1 个答案:

答案 0 :(得分:1)

看起来它无法连接到MySQL。仔细检查您的MySQL连接设置以及MySQL服务是否真正启动。