- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 SpringMVC、Hibernate、Maven 和 MySQL 数据库编写一个简单的数据库配置应用程序。
我在本地使用Eclipse IDE和Tomcat 8.5。
这个相同的代码在本地(PC)上运行良好。所以我尝试在 OpenShift 中部署它,这些是我面临的错误,我的容器经常崩溃(不知道为什么?) 我已经被这些错误困扰了一个多星期了)。请阐明它,这可能对像我这样的许多人有用。已经谢谢了! :)
部署 登录 OpenShift:
Running jboss-webserver-3/webserver30-tomcat8-openshift image, version 1.1-7
I> No access restrictor found, access to all MBean is allowed
Jolokia: Agent started with URL http://127.0.0.1:8778/jolokia/
2018-03-19 14:14:02,260 [main] INFO org.apache.catalina.startup.Catalina- Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
2018-03-19 14:14:02,261 [main] INFO org.apache.catalina.startup.Catalina- Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
2018-03-19 14:14:03,159 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Server version: Apache Tomcat/8.0.18
2018-03-19 14:14:03,159 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Server built: Aug 11 2015 14:53:16 UTC
2018-03-19 14:14:03,159 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Server number: 8.0.18-25_patch_00.ep7.el7.-patch-00
2018-03-19 14:14:03,159 [main] INFO org.apache.catalina.startup.VersionLoggerListener- OS Name: Linux
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- OS Version: 3.10.0-693.15.2.el7.x86_64
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Architecture: amd64
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Java Home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51-1.b16.el7_1.x86_64/jre
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- JVM Version: 1.8.0_51-b16
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- JVM Vendor: Oracle Corporation
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- CATALINA_BASE: /opt/webserver
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- CATALINA_HOME: /opt/webserver
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Command line argument: -Dnop
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Command line argument: -Djava.library.path=/opt/webserver/lib
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Command line argument: -Djava.security.egd=file:/dev/./urandom
2018-03-19 14:14:03,160 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Command line argument: -javaagent:/opt/webserver/lib/jolokia.jar=port=8778,host=127.0.0.1,discoveryEnabled=false
2018-03-19 14:14:03,161 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Command line argument: -Djava.endorsed.dirs=/opt/webserver/endorsed
2018-03-19 14:14:03,161 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Command line argument: -Dcatalina.base=/opt/webserver
2018-03-19 14:14:03,161 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Command line argument: -Dcatalina.home=/opt/webserver
2018-03-19 14:14:03,161 [main] INFO org.apache.catalina.startup.VersionLoggerListener- Command line argument: -Djava.io.tmpdir=/opt/webserver/temp
2018-03-19 14:14:03,161 [main] INFO org.apache.catalina.core.AprLifecycleListener- Loaded APR based Apache Tomcat Native library 1.1.32 using APR version 1.4.8.
2018-03-19 14:14:03,161 [main] INFO org.apache.catalina.core.AprLifecycleListener- APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2018-03-19 14:14:03,188 [main] INFO org.apache.catalina.core.AprLifecycleListener- OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013)
2018-03-19 14:14:03,344 [main] INFO org.apache.coyote.http11.Http11AprProtocol- Initializing ProtocolHandler ["http-apr-8080"]
2018-03-19 14:14:03,355 [main] INFO org.apache.catalina.startup.Catalina- Initialization processed in 1137 ms
2018-03-19 14:14:03,374 [main] INFO org.apache.catalina.core.StandardService- Starting service Catalina
2018-03-19 14:14:03,374 [main] INFO org.apache.catalina.core.StandardEngine- Starting Servlet Engine: Apache Tomcat/8.0.18
2018-03-19 14:14:03,401 [localhost-startStop-1] INFO org.apache.catalina.startup.HostConfig- Deploying web application archive /deployments/ROOT.war
2018-03-19 14:14:08,856 [localhost-startStop-1] INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/]- No Spring WebApplicationInitializer types detected on classpath
2018-03-19 14:14:08,947 [localhost-startStop-1] INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/]- Initializing Spring root WebApplicationContext
2018-03-19 14:14:08,947 [localhost-startStop-1] INFO org.springframework.web.context.ContextLoader- Root WebApplicationContext: initialization started
2018-03-19 14:14:09,061 [localhost-startStop-1] INFO org.springframework.web.context.support.XmlWebApplicationContext- Refreshing Root WebApplicationContext: startup date [Mon Mar 19 14:14:09 EDT 2018]; root of context hierarchy
2018-03-19 14:14:09,253 [localhost-startStop-1] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader- Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
2018-03-19 14:14:10,942 [localhost-startStop-1] INFO org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor- JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-03-19 14:14:13,458 [localhost-startStop-1] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping- Mapped "{[/ || /home],methods=[GET]}" onto public org.springframework.web.servlet.ModelAndView com.redhat.api.controller.ControllerClass.goHome()
2018-03-19 14:14:13,459 [localhost-startStop-1] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping- Mapped "{[/check],methods=[GET]}" onto public org.springframework.web.servlet.ModelAndView com.redhat.api.controller.ControllerClass.goCheck()
2018-03-19 14:14:13,857 [localhost-startStop-1] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter- Looking for @ControllerAdvice: Root WebApplicationContext: startup date [Mon Mar 19 14:14:09 EDT 2018]; root of context hierarchy
2018-03-19 14:14:14,143 [localhost-startStop-1] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter- Looking for @ControllerAdvice: Root WebApplicationContext: startup date [Mon Mar 19 14:14:09 EDT 2018]; root of context hierarchy
2018-03-19 14:14:14,654 [localhost-startStop-1] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping- Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
2018-03-19 14:14:14,854 [localhost-startStop-1] INFO org.springframework.jdbc.datasource.DriverManagerDataSource- Loaded JDBC driver: com.mysql.jdbc.Driver
DataBase Connection Established
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2018-03-19 14:14:15,462 [localhost-startStop-1] INFO org.hibernate.Version- HHH000412: Hibernate Core {5.2.5.Final}
2018-03-19 14:14:15,464 [localhost-startStop-1] INFO org.hibernate.cfg.Environment- HHH000206: hibernate.properties not found
2018-03-19 14:14:15,746 [localhost-startStop-1] INFO org.hibernate.annotations.common.Version- HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
Mon Mar 19 14:14:16 EDT 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2018-03-19 14:14:17,958 [localhost-startStop-1] INFO org.hibernate.dialect.Dialect- HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
Mon Mar 19 14:14:20 EDT 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Session Factory Block Crossed
2018-03-19 14:14:20,662 [localhost-startStop-1] INFO org.springframework.orm.hibernate5.HibernateTransactionManager- Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@65868c29] of Hibernate SessionFactory for HibernateTransactionManager
Transaction Done
2018-03-19 14:14:20,944 [localhost-startStop-1] INFO org.springframework.web.context.ContextLoader- Root WebApplicationContext: initialization completed in 11997 ms
2018-03-19 14:14:20,962 [localhost-startStop-1] INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/]- Initializing Spring FrameworkServlet 'dispatcher'
2018-03-19 14:14:20,962 [localhost-startStop-1] INFO org.springframework.web.servlet.DispatcherServlet- FrameworkServlet 'dispatcher': initialization started
2018-03-19 14:14:20,964 [localhost-startStop-1] INFO org.springframework.web.context.support.XmlWebApplicationContext- Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Mon Mar 19 14:14:20 EDT 2018]; parent: Root WebApplicationContext
2018-03-19 14:14:20,964 [localhost-startStop-1] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader- Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
2018-03-19 14:14:21,344 [localhost-startStop-1] INFO org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor- JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-03-19 14:14:21,540 [localhost-startStop-1] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping- Mapped "{[/ || /home],methods=[GET]}" onto public org.springframework.web.servlet.ModelAndView com.redhat.api.controller.ControllerClass.goHome()
2018-03-19 14:14:21,541 [localhost-startStop-1] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping- Mapped "{[/check],methods=[GET]}" onto public org.springframework.web.servlet.ModelAndView com.redhat.api.controller.ControllerClass.goCheck()
2018-03-19 14:14:21,645 [localhost-startStop-1] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter- Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Mon Mar 19 14:14:20 EDT 2018]; parent: Root WebApplicationContext
2018-03-19 14:14:21,657 [localhost-startStop-1] INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter- Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Mon Mar 19 14:14:20 EDT 2018]; parent: Root WebApplicationContext
2018-03-19 14:14:21,863 [localhost-startStop-1] INFO org.springframework.web.servlet.handler.SimpleUrlHandlerMapping- Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
2018-03-19 14:14:21,945 [localhost-startStop-1] INFO org.springframework.jdbc.datasource.DriverManagerDataSource- Loaded JDBC driver: com.mysql.jdbc.Driver
DataBase Connection Established
Mon Mar 19 14:14:22 EDT 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2018-03-19 14:14:22,144 [localhost-startStop-1] INFO org.hibernate.dialect.Dialect- HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
Mon Mar 19 14:14:22 EDT 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Session Factory Block Crossed
2018-03-19 14:14:22,448 [localhost-startStop-1] INFO org.springframework.orm.hibernate5.HibernateTransactionManager- Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@5b82fb3a] of Hibernate SessionFactory for HibernateTransactionManager
Transaction Done
2018-03-19 14:14:22,640 [localhost-startStop-1] INFO org.springframework.web.servlet.DispatcherServlet- FrameworkServlet 'dispatcher': initialization completed in 1678 ms
2018-03-19 14:14:22,654 [localhost-startStop-1] INFO org.apache.catalina.startup.HostConfig- Deployment of web application archive /deployments/ROOT.war has finished in 19,251 ms
2018-03-19 14:14:22,655 [localhost-startStop-1] INFO org.apache.catalina.startup.HostConfig- Deploying web application directory /deployments/manager
2018-03-19 14:14:23,746 [localhost-startStop-1] INFO org.apache.jasper.servlet.TldScanner- At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2018-03-19 14:14:23,751 [localhost-startStop-1] INFO org.apache.catalina.startup.HostConfig- Deployment of web application directory /deployments/manager has finished in 1,096 ms
2018-03-19 14:14:23,751 [localhost-startStop-1] INFO org.apache.catalina.startup.HostConfig- Deploying web application directory /deployments/docs
2018-03-19 14:14:24,449 [localhost-startStop-1] INFO org.apache.jasper.servlet.TldScanner- At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2018-03-19 14:14:24,451 [localhost-startStop-1] INFO org.apache.catalina.startup.HostConfig- Deployment of web application directory /deployments/docs has finished in 700 ms
2018-03-19 14:14:24,451 [localhost-startStop-1] INFO org.apache.catalina.startup.HostConfig- Deploying web application directory /deployments/examples
OpenShift Container Crash Image
我的 .java 配置文件
package com.redhat.api.config;
/* Username: userCWJ Password: TGYMNnYI6iohkPfF Database Name: sampledb Connection URL: mysql://mysql:3306/*/
import java.util.Properties;
import javax.sql.DataSource;
import org.hibernate.SessionFactory;
import org.springframework.beans.BeanInstantiationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.hibernate5.HibernateTransactionManager;
import org.springframework.orm.hibernate5.LocalSessionFactoryBuilder;
import org.springframework.stereotype.Component;
import com.redhat.api.entity.EntityClass;
@Component
@ComponentScan
@Configuration
public class ConfigClass{
@Autowired
@Bean(name = "dataSource")
public DataSource getMySQLDataSource() throws BeanInstantiationException, BeanDefinitionParsingException {
DriverManagerDataSource driverMgrDataSource = new DriverManagerDataSource();
driverMgrDataSource.setDriverClassName("com.mysql.jdbc.Driver");
driverMgrDataSource.setUrl("jdbc:mysql://mysql:3306/sampledb");
driverMgrDataSource.setUsername("userCWJ");
driverMgrDataSource.setPassword("TGYMNnYI6iohkPfF");
System.out.println("DataBase Connection Established");
return driverMgrDataSource;
}
@Autowired
@Bean(name = "sessionFactory")
public SessionFactory getSessionFactory() {
Properties hibernateProperties = new Properties();
hibernateProperties.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
hibernateProperties.setProperty("hibernate.show_sql", "true");
hibernateProperties.setProperty("hibernate.format_sql", "true");
hibernateProperties.setProperty("hibernate.hbm2ddl.auto", "update");
LocalSessionFactoryBuilder localSessionFacBuilder = new LocalSessionFactoryBuilder(getMySQLDataSource());
localSessionFacBuilder.addProperties(hibernateProperties);
localSessionFacBuilder.addAnnotatedClass(EntityClass.class);
try {
SessionFactory sessionFactory = localSessionFacBuilder.buildSessionFactory();
return sessionFactory;
}
catch (ExceptionInInitializerError ex) {
System.out.println(ex.getMessage());
}
finally {
System.out.println("Session Factory Block Crossed");
}
System.out.println("SessionFactory Created");
return null;
}
@Autowired
@Bean(name = "transactionManager")
public HibernateTransactionManager getHibernateTransactionManager(SessionFactory sessionFactory)
throws BeanInstantiationException, BeanDefinitionParsingException {
HibernateTransactionManager hibernateTranMgr = new HibernateTransactionManager(sessionFactory);
System.out.println("Transaction Done");
return hibernateTranMgr;
}}
我的 Pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.redhat</groupId>
<artifactId>api</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>api Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.12.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.12.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.12.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.12.RELEASE</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.6</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.5.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.3.11.Final</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
<build>
<finalName>ROOT</finalName>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
据我所知,我猜,该错误应该是由于 pom.xml 中的某些依赖项引起的,但我无法解决。
最佳答案
在pom.xml中,我们只需添加必需的依赖项。我猜这就是我的代码中的问题,我做了这个更改和一些小更改,例如从数据源中删除 @Autowire 注释等。现在它工作正常,我的应用程序托管在 OpenShift 中。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.redhat</groupId>
<artifactId>api</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>api Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.12.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.12.RELEASE</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.6</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.5.Final</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<build>
<finalName>ROOT</finalName>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
关于java - OpenShift 部署 : Container Crash. - SpringMVC+Hibernate+Maven+MySQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49370829/
我试图理解 Maven 模块和 Maven 项目之间的区别。哪一个是什么以及我应该在哪里?谢谢 最佳答案 maven 模块就像一个 maven“子项目”。一个 Maven 项目包含 1 个或多个模块。
我们目前没有自己的存储库。因此,当我们使用 Maven 构建时,它会在当前用户的主目录中创建 .m2 存储库。 现在有两个在 Maven Central 中找不到的第三方 jar。假设其中之一是 ha
我有 Maven 项目,但在其中一台服务器上我必须在没有 Maven 的情况下构建它。 可以使用标准 JDK 命令。在哪里可以看到 Maven 在构建项目时向 JDK 发送了哪些命令? 最佳答案 Ma
我打算将 ImageJ 用于 web 应用程序,但似乎 ImageJ maven 依赖项不在中央 maven 存储库中。 我说得对吗? 当 ImageJ 2.x 发布时,这会改变吗? 最佳答案 您可以
我可以有多个 Maven 实例吗,即 Mave 2.2.1 和 Maven 3 都指向同一个本地存储库? 我的意思是我知道我可以在技术上将每个 settings.xml 指向同一个文件夹,但从长远来看
我有两个项目,项目 A 依赖于项目 B,所以通常,我的 projectA/pom.xml 中有以下部分: projectB blabla version1 我想要实现的目标非常简
在网上的许多地方,我看到它讨论了要使 maven 构建可重现,明确指定所有使用的插件的版本号很重要,这样更新的插件就不会破坏构建。推荐的方法似乎是使用 enforcer 插件。下面是我在网上找到的复制
有没有办法暂停 Maven 执行流程以提供命令提示符,以便用户可以输入文本。 然后我希望将提供的文本存储在 Maven 属性中。 如果用户输入可以被屏蔽,那将是一个奖励。 这对于避免在 pom.xml
我正在尝试使用 maven 插件将 maven java 项目的源文件夹添加到 Eclipse。 尝试使用 org.codehaus.mojo 插件时,我收到以下错误 无法在项目应用程序框架上执行目标
我有两个几乎相同的配置文件。我不想在每个配置文件中复制配置,而是希望一个配置文件从另一个配置文件“继承”,但我没有看到使用 maven 3 执行此操作的明显方法。 在 Maven 中是否可以继承配置文
我是 Maven 新手,花了大约 3 天的时间使用程序集插件生成 zip 文件,引用 http://www.petrikainulainen.net/programming/tips-and-tric
想象一下这种情况。我有一个使用 Maven 管理的开源项目,它依赖于一个不在 Maven 存储库中的知名库(例如 jpathwatch)。我怎样才能让它发挥作用? 直接的方法是将 jpathwatch
我将 Neo4j 和 MongoDB 与 Grails 一起使用,我想知道 Maven Neo4j 插件是否也为我的构建提供了 Neo4j 依赖项。 MongoDB 也是如此。 我很困惑。我应该使用什
我正在尝试同时发布多个 Maven 项目,将它们部署到 oss.sonatype.org,然后将它们发布到 Maven Central。 我有一个构建 pom,用于一起构建多个多模块项目。构建 pom
我有一个带有 maven pom.xml 的项目 4.0.0 Minimal-J Minimal-J 0.1-SNAPSHOT Minimal-J
我需要制作一个下载maven项目并打印其依赖项的小程序 像这样: MavenArtifactRepository repository = new MavenArtifactRepository("t
我有一个关于 maven 在构建过程中如何计算类路径的问题。具体来说,控制何时使用“目标/类”以及何时使用来自存储库(本地/远程)的“jar”。 我有一个版本为 1.0.0-SNAPSHOT 的项目,
我有一个 maven 项目,需要在命令行(-Dmy.property=val)设置一个属性。 我需要做的是将该字符串转换为所有大写,因为该属性是 用于通过 maven-resources-plugin
引用和转义如何对传递给 Maven 插件的参数起作用? 例如,我想将多个文件名作为参数传递给 Maven Exec 插件运行的应用程序: mvnDebug exec:java -Dexec.mainC
我在父 pom 的导入的 dependencyManagement 部分中指定了一个库版本。我确认我的有效 pom 只有一次出现这种依赖。它在依赖管理部分: org.jav
我是一名优秀的程序员,十分优秀!