Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 272 Vote(s) - 3.63 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error creating bean with name 'entityManagerFactory' defined in class path resource : Invocation of init method failed

#11
If you use JDK 1.8.0_201 or latest try it with older JDK.

I have same issue with JDK1.8.0_201, however it works with JDK1.8.0_101 without any code change.
Reply

#12

In my case, deleting any of the below annotations cause the error message 'entityManagerFactory' to show, for example.

@Id
@GeneratedValue(strategy=GenerationType.AUTO)


or

@ManyToMany(targetEntity=listOfObject_x.class)


The error message disappears after adding the missing annotation(s).



package mypackage_unameit;
import javax.persistence.PrePersist;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import lombok.Data;

@Data
@Entity
public class Someclasss {

@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;

@NotNull
@Size(min=5, message="Name must be at least 5 characters long")
private String name;

private Date createdAt;

@ManyToMany(targetEntity=listOfObject_x.class)
@Size(min=1, message="You must choose at least 1 ingredient")
private List<listOfObject_x> = new ArrayList<>();

@PrePersist
void createdAt() {
this.createdAt = new Date();
}
}

Reply

#13
I resolved this issue by Adding implements Serializable in the Model.



@Entity
@Table(name="Model_Rest")
@IdClass(Model_Rest.class)
public class Model_Rest implements Serializable {

/**
*
*/
private static final long serialVersionUID = 1L;
/**
*
*/
//@GeneratedValue(strategy = GenerationType.AUTO)
//@Column(columnDefinition="id")

@Id
private String login;
@Id
private String password;




@Autowired
public String getLogin() {
return login;
}

@Autowired
public void setLogin(String login) {
this.login = login;
}

@Autowired
public String getPassword() {
return password;
}

@Autowired
public void setPassword(String password) {
this.password = password;
}

public Model_Rest() {
// TODO Auto-generated constructor stub
}

public Model_Rest(String login, String password) {
this.login = login;
this.password = password;
}

@Override
public String toString() {
return "Model_Rest [login=" + login + ", password=" + password + "]";
}
}
Reply

#14
This error may be also related to the fact that you have an error in your "spring.datasource.url" when you gave a wrong db name for example
Reply

#15
For me, it was a result of another error

> org.postgresql.util.PSQLException: FATAL: password authentication failed for user

Which means you just need to review your authentication credentials
Reply

#16
My error was solved after adding this dependency.

<!--

[To see links please register here]

-->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.16.Final</version>
</dependency>
Reply

#17
I solved mine by updating spring dependencies versions from 2.0.4 to 2.1.6
```xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
```
to
```xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
```

Reply

#18
For my case it was due to Intellij IDEA by default set Java 11 as default project SDK, but project was implemented in Java 8.
I've changed "Project SDK" in File -> Project Structure -> Project (in Project Settings)
Reply

#19
I've jdk-12.0.2.jdk, 've found solution to the problem, add dependencies to pom.xml:

<!--

[To see links please register here]

-->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<!--

[To see links please register here]

-->
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.25.0-GA</version>
</dependency>
Reply

#20
Try changing spring version. I had the same issue and that worked for me
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through