关于我以前的问题,我在Linux上运行企业级web应用程序时遇到了一些问题。在投资一台真正的登台机之前,我想我应该在Raspbery Pi上试一试,但现在,我们在一台真正的Debian计算机上运行该应用程序。
这个问题和我前面的问题一样。
起初,我认为这更像是tomcat的问题,但现在,我认为这是一个 <罢工> 覆盆子皮 Linux问题。
<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="false" privileged="true" cookies="true">
<Resource name="stagingDS" auth="Container" type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/preview"
username="root" password="root" />
</Context>
我将Spring bean定义为;
<bean id="velocityConfig"
class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="velocityProperties">
<map>
<entry key="resource.loader" value="ds" />
<entry key="ds.resource.loader.class"
value="com.simplestack.velocity.config.SimpleStackDataSourceResourceLoader" />
<entry key="ds.resource.loader.resource.table" value="Catalog" />
<entry key="ds.resource.loader.resource.keycolumn" value="name" />
<entry key="ds.resource.loader.resource.templatecolumn" value="html" />
<entry key="ds.resource.loader.resource.defaultVendorId"
value="1" />
<entry key="ds.resource.loader.resource.defaultSiteId" value="20160109144" />
<entry key="ds.resource.loader.resource.datasource" value="java:comp/env/stagingDS" />
<entry key="ds.resource.loader.resource.timestampcolumn"
value="lastmod" />
</map>
</property>
</bean>
它给了我namingconventionexception
,说明stagingds
没有定义。
我正在调用此方法来创建会话工厂
protected static SessionFactory buildSessionFactory(File cfgfile, File[] hbmfiles, String dburl, String dbuser, String dbpassword, String dbdriver, String treecacheConfigFile)
throws Exception{
logger.info("Hibernate Configuration File Path:"+cfgfile.getPath());
for (int i=0; i<hbmfiles.length; i++)
logger.info("Hibernate Mapping File Path:"+hbmfiles[i].getPath());
logger.info("Hibernate Using JDBC, dburl:"+dburl+" dbuser:"+dbuser+" dbdriver:"+dbdriver);
Configuration hibernateConfig = new Configuration();
for (int i=0; i<hbmfiles.length; i++)
hibernateConfig = addHbmFile(hibernateConfig, hbmfiles[i]);
// TODO: Add the audit interceptors
// AuditInterceptor auditInterceptor = new AuditInterceptor();
// addDefaultInterceptor(hibernateConfig, auditInterceptor);
// addEventListeners(hibernateConfig);
hibernateConfig.configure(cfgfile);
logger.info("Configfile:"+cfgfile);
if (treecacheConfigFile != null){
hibernateConfig.setProperty("hibernate.cache.configuration_file", treecacheConfigFile);
logger.info("hibernate.cache.configuration_file:"+treecacheConfigFile);
}
hibernateConfig.setProperty("hibernate.connection.url", dburl);
hibernateConfig.setProperty("hibernate.connection.username", dbuser);
hibernateConfig.setProperty("hibernate.connection.password", dbpassword);
hibernateConfig.setProperty("hibernate.connection.driver_class", dbdriver);
SessionFactory sessionFactory = hibernateConfig.buildSessionFactory();
//TODO:set a separate session factory
// auditInterceptor.setSessionFactory(sessionFactory);
return sessionFactory;
}
2016-06-15 08:04:54,504 INFO [com.simplestack.SessionFactoryPool] Building Hibernate STAGING Session Factory...
2016-06-15 08:04:54,504 INFO [com.simplestack.SessionFactoryPool] Hibernate Configuration File Path:/SimpleStack/tomcat/webapps/staging/WEB-INF/hibernatecfg/hibernate_mysql.cfg.xml
2016-06-15 08:04:54,505 INFO [com.simplestack.SessionFactoryPool] Hibernate Mapping File Path:/SimpleStack/tomcat/webapps/staging/WEB-INF/hibernate
2016-06-15 08:04:54,505 INFO [com.simplestack.SessionFactoryPool] Hibernate Using JDBC, dburl:jdbc:mysql://localhost:3306/preview dbuser:root dbdriver:com.mysql.jdbc.Driver
2016-06-15 08:04:55,173 WARN [org.hibernate.internal.util.xml.DTDEntityResolver] HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2016-06-15 08:04:55,284 WARN [org.hibernate.internal.util.xml.DTDEntityResolver] HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2016-06-15 08:04:55,327 WARN [org.hibernate.internal.util.xml.DTDEntityResolver] HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2016-06-15 08:04:55,380 WARN [org.hibernate.internal.util.xml.DTDEntityResolver] HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2016-06-15 08:04:55,408 WARN [org.hibernate.internal.util.xml.DTDEntityResolver] HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2016-06-15 08:04:55,434 WARN [org.hibernate.internal.util.xml.DTDEntityResolver] HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2016-06-15 08:04:55,459 WARN [org.hibernate.internal.util.xml.DTDEntityResolver] HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2016-06-15 08:04:55,483 WARN [org.hibernate.internal.util.xml.DTDEntityResolver] HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2016-06-15 08:04:55,505 WARN [org.hibernate.internal.util.xml.DTDEntityResolver] HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
2016-06-15 08:04:55,514 INFO [com.simplestack.SessionFactoryPool] Configfile:/SimpleStack/tomcat/webapps/staging/WEB-INF/hibernatecfg/hibernate_mysql.cfg.xml
2016-06-15 08:04:55,882 WARN [org.hibernate.mapping.RootClass] HHH000038: Composite-id class does not override equals(): com.simplestack.hibernate.domainmodel.Siteproperty
2016-06-15 08:04:55,883 WARN [org.hibernate.mapping.RootClass] HHH000039: Composite-id class does not override hashCode(): com.simplestack.hibernate.domainmodel.Siteproperty
2016-06-15 08:04:55,928 WARN [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] HHH000022: c3p0 properties were encountered, but the org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider provider class was not found on the classpath; these properties are going to be ignored.
2016-06-15 08:04:56,466 WARN [org.hibernate.engine.jdbc.internal.JdbcServicesImpl] HHH000342: Could not obtain connection to query metadata : Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
我们仍然对它是什么感到非常困惑...我做错什么了吗?
这不是数据库连接问题。
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
通常意味着您的数据库服务器已关闭或位于不是本地主机的IP/主机名中。
我正在开发一个简单的应用程序,它使用泽西作为框架来构建API,并使用Jackson来处理JSON。 当我部署应用程序时,通过复制 我很确定这个问题不在java代码中,因为它曾经与*一起工作。jar包含方法。但我厌倦了这一点,希望将其迁移到maven体系结构。 我不会发布我的全部代码,但你可以在这里看到。 为了简化操作,下面列出了我使用的依赖项: jersey json v1.19 什么会导致此错误
在中,上下文xml下有: 在我的spring mvc中是:
我无法在Tomcat 6上部署Grails 2.2.4应用程序。我尝试了新安装的tomcat,甚至我的应用程序的旧版本(以前运行过)。 此异常在一分钟后引发。在tomcat启动后: 我真的不知道从哪里开始修理它-/
我试图将spring boot应用程序部署到外部tomcat,在catalina.log文件中出现如下异常。 war文件名为:com#myapp.war。
我在spring boot(v1.5.9.release)中开发了应用程序,该应用程序与Tomcatv7.0一起工作 如何解决此问题?因为我不知道是哪个特定的依赖项导致了这个问题,我需要在哪里添加排除。请帮帮忙。