在我当前的spring项目中,我尝试用浮点数字段从javax.validation.constraints中选择注释模式,方法是:
@Pattern(regexp = "[0-9]{2}.[0-9]{2}")
private Float preco;
但是,当尝试使用此字段插入或更新实体时,我会得到以下错误:
Caused by: javax.validation.UnexpectedTypeException: HV000030: No validator could be found for type: java.lang.Float.
at org.hib
我想强调的是,我已经在寻找这类问题,但无法为我的案件找到解决办法。在我的Spring中,当使用包javax.validation.constraints的@NotEmpty或@NotBlank注释验证bean时,我一直会得到这个错误:
14:04:59,426 ERROR [org.springframework.boot.web.servlet.support.ErrorPageFilter] (default task-33) Forwarding to error page from request [/registrati
on] due to exception [HV000030:
我一直试图从Spring应用程序连接到Azure MySQL数据库。但是它给了我以下错误
com.mysql.cj.jdbc.exceptions.CommunicationsException: 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.
at com.mysql.cj.jdbc.exceptions.SQLErro
我的用户超类:
@MappedSuperclass
public class User implements Serializable {
@ManyToOne(targetEntity = Role.class, fetch = FetchType.EAGER)
@JoinColumn(name = "roleId", referencedColumnName = "id")
private Role role;
other attributes ...
下面是我的角色实体:
@Entity
public class Rol
我有个奇怪的问题。
我刚刚用SpringBoot1.4.0(之前的1.3.4)更新了我的项目。我的项目有大约70个单元测试(junit4)。
当我在maven上运行测试时:
mvn clean install
然后我会遇到很多这样的错误:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework
我有一个settings.xml和一个包含所有依赖项的JFrog应用程序。
当我从cmd行运行:mvn clean install时,我获得了错误:
[ERROR] Failed to execute goal on project karate-demo: Could not resolve dependencies for project com.intuit.karate:karate-demo:jar:0.9.6: Failed to collect dependencies at org.springf
ramework.boot:spring-boot-starter-webso
当我试图验证Scala的Map时,无论是可变的还是不可变的,我得到的异常如下:
javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.Size' validating type 'scala.collection.mutable.Map<java.lang.String, java.lang.String>'. Check configuration for
我目前正在使用JAVA 11将Spring Boot (2.1.5)应用程序升级到gradle版本'5.4.1‘。 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultValidator' defined in class path resource [org/springframework/boot/autoconfigure/validation/ValidationAutoConfiguration.class]: Invoc
我试图用mem数据库中的H2来保存spring 2.6中的地理信息系统点数据。
除了较新的春季引导版本之外,我还按照进行了设置。
我的build.gradle
plugins {
id 'org.springframework.boot' version '2.6.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.nz'
version = '0.0.1-SNA
即使在设置hibernate.dialect属性之后,我也会得到异常。我使用hibernate 5.0.11,spring引导1.4.2,mysql版本5.7
application.properties is like this
# Hibernate
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=validate
pom.xml
<dependency>
<groupId>org.spr
我正在尝试用Intellij创建一个简单的数据库迁移,其中包含一些使用flyway的虚拟表。 我的虚表放在“资源/db/迁移”中,格式为"V1___initial_display.sql“。 它们可能包含以下内容: CREATE TABLE Fake (
ID int,
name varchar(255)
);
CREATE TABLE Persons(
ID int,
name varchar (30)
);
INSERT INTO Persons(ID, name)
VALUES(1,'AXC');
INSERT INTO Person
在运行spring应用程序时,我遇到了以下错误。我只是简单地使用MySQL支持和JPA编译框架Spring Boot项目,它是我使用Spring Initialzr生成的,只是为了看看是否所有的东西都在工作:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jp
我正试图在独立的jetty上部署一个spring引导应用程序war文件。但是当我启动jetty时,我会遇到这样的错误
Caused by: java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;
at org.hibernate.cfg.AnnotationBinder.bindManyToOne(AnnotationBinder.java:2909) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
a
我看了,,没有解决我的问题--这里是我遇到的错误:
2021-01-17 18:49:19.469 WARN 22952 --- [main] o.h.e.j.e.i.JdbcEnvironmentInitiator
: HHH000342: Could not obtain connection to query metadata
org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openCo
尝试在Spring Boot项目中设置Memcache,但不起作用。我甚至尝试设置默认缓存(ConcurrentMapCacheManager),但它不能很好地工作。
我读过的每个教程(即使是Spring官方的)都说这个配置足以设置缓存
缓存配置:
@Configuration
@EnableCaching
public class CacheConfiguration {
@Bean
public CacheManager cacheManager() {
return new ConcurrentMapCacheManager("test_cach
各位,我遇到了这个错误。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is ja