I am a new to Spring boot so I apologize if this is a easily resolved issue.
I am seeing a problem running springboot after I added a #Transient final variable to my entity. Essentially I need a constant variable in my class that stores a string that I do not want stored in the database.
Adding in just this variable causes no issues with spring and the program runs as expected however, if I add a getter for this variable Springboot raises the exception:
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 javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
Here is my code causing the issue (I am not even calling the getter yet and it's causing this issue):
#ApiModel(description = "This class represents a device with its basic information.")
#Entity
#Table(name = "device")
public class Device {
#Transient
private final String invisibleName = "Jwfqp4bbqiFzRLcFVV3qf";
#Id
#ApiModelProperty(notes = "A UUID number to identify the device in the system.")
private String deviceId;
#ApiModelProperty(notes = "The device IP address of the device, this is also a unique identifier.")
private String ipAddress;
public Device() {
}
#Id
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceUuid) {
this.deviceId = deviceUuid;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public String getInvisibleName(){
return invisibleName;
}
}
Here is my pom
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.7</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>project-name</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<name>projectName</name>
<description>Project Name</description>
<properties>
<java.version>1.8</java.version>
<log4j2.version>2.16.0</log4j2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
One important thing that I've noticed is that I can resolve the building issue by adding a useless parameter to the the getter such as:
public String getInvisibleName(int temp){
return invisibleName;
}
but If possible I would like to get to the bottom of this issue so I don't have useless parameters in my getter.
Let me know if I need to provide any additional information.
Thanks
Thank you all for your help. I removed the extraneous #Id on the 'getDeviceId' and moved the #Transient to the getter. I also noticed that apparently Spring had created an 'invisibleName' entry in the database causing a mismatch with my #Entity class. I removed the field from the database and that resolved the issue.
You should move the #Transient annotation above the getInvisibleName() method.
Related
This question already has answers here:
Why is my Spring #Autowired field null?
(21 answers)
What is a NullPointerException, and how do I fix it?
(12 answers)
Closed 5 months ago.
I have an entity:
#Entity
public class User {
#Id
#GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
private String login;
private String password;
public User() {
}
public User(String login, String password) {
this.login = login;
this.password = password;
}
public String getLogin() {
return login;
}
public String getPassword() {
return password;
}
}
And i created an interface with annotation #Repository, which looks like:
#Repository
public interface UserRepository extends JpaRepository<User, Integer> {
}
So, i need to save in my database new users. But, if i use #Autowired UserRepository in my #Service class and call "save" method, it throws me an error 505 with description: HTTP Status 500 – Internal Server Error
Type Exception Report
Message Cannot invoke "com.example.testservletjsp.repository.UserRepository.save(Object)" because "this.userRepository" is null
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
java.lang.NullPointerException: Cannot invoke "com.example.testservletjsp.repository.UserRepository.save(Object)" because "this.userRepository" is null
com.example.testservletjsp.account.UserService.saveUser(UserService.java:28)
com.example.testservletjsp.servlets.ExplorerServlet.doPost(ExplorerServlet.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:682)
javax.servlet.http.HttpServlet.service(HttpServlet.java:765)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.
My pom.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<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
https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>test-servlet-jsp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>test-servlet-jsp</name>
<description>test-servlet-jsp</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.30</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.2.8.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</build>
What should i do..?
As I don't have the entirety of your project I cannot see if there are some miss-configured classes, but you can always visit this (https://spring.io/guides/gs/accessing-data-mysql/) spring guide that teaches you all the details you have to keep in mind in order to get that project working.
I am trying to start my Spring server but keep getting this error:
Description:
Parameter 0 of constructor in com.rm.awsimageupload.filestore.FileStore required a bean of type 'com.amazonaws.services.s3.AmazonS3' that could not be found.
Action:
Consider defining a bean of type 'com.amazonaws.services.s3.AmazonS3' in your configuration.
I have tried:
pasting in the keys as strings right into the BasicAWSCredentials
putting the keys into application.properties and then using #Value to access them. With this approach, I get this error:
Error creating bean with name 'amazonConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'local.AWS_ACCESS_KEY_ID' in value "${local.AWS_ACCESS_KEY_ID}"
application.properties
AWS_ACCESS_KEY_ID=NOTAREALKEY
AWS_SECRET_ACCESS_KEY=NOTAREALSECRET
FileStore.java
#Configuration
public class AmazonConfig {
#Value("${application.AWS_ACCESS_KEY_ID}")
private String AWS_ACCESS_KEY_ID;
#Value("${application.AWS_SECRET_ACCESS_KEY}")
private String AWS_SECRET_ACCESS_KEY;
public AmazonS3 S3() {
AWSCredentials awsCredentials = new BasicAWSCredentials(
AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY
);
return AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).withRegion(Regions.SA_EAST_1).build();
}
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.rm</groupId>
<artifactId>aws-image-upload</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>aws-image-upload</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.787</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Not exactly sure what to do... I am following a tutorial on how to do this and my config pretty much matches this instructor's. Any suggestions?
Your are missing #Bean annotation on public AmazonS3 S3()
#Bean
public AmazonS3 S3() {
AWSCredentials awsCredentials = new BasicAWSCredentials(
AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY
);
return AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).withRegion(Regions.SA_EAST_1).build();
}
Regarding the 2nd issue for properties values, not sure if this the typo here
local.AWS_ACCESS_KEY_ID in logs vs application.AWS_ACCESS_KEY_ID in code sample.
You need to use the same keys name as in your properties file
So you config class should be having
#Value("${AWS_ACCESS_KEY_ID}")
private String AWS_ACCESS_KEY_ID;
#Value("${AWS_SECRET_ACCESS_KEY}")
private String AWS_SECRET_ACCESS_KEY;
I try to create a Spring Boot REST application with GraphQL and MongoeDB (I start from that article https://medium.com/oril/spring-boot-graphql-mongodb-8733002b728a). The application start but I got 404 error when I try to post something to a endpoint.
I read also that #PostConstruct is not supported anymore with 2.2.0 (it's another problem I'll try to figure out later, I try to preload the database during startup).
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.tsoai-api</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<lombok.version>1.18.10</lombok.version>
<commons-io.version>2.5</commons-io.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-spring-boot-starter</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java-tools</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphiql-spring-boot-starter</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
My main application file look like this (nothing very special!):
#SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
MainController.java
#RestController
#RequestMapping(path = "/query")
public class MainController {
private GraphQL graphQL;
private GraphQlUtility graphQlUtility;
#Autowired
MainController(GraphQlUtility graphQlUtility) throws IOException {
this.graphQlUtility = graphQlUtility;
graphQL = graphQlUtility.createGraphQlObject();
}
#PostMapping(path= "/")
public ResponseEntity query(#RequestBody String query){
ExecutionResult result = graphQL.execute(query);
System.out.println("errors: "+result.getErrors());
return ResponseEntity.ok(result.getData());
}
}
When I post on http://localhost:8080/query, I got this error:
{
"timestamp": "2019-10-19T16:10:19.136+0000",
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/query"
}
It will match /query/ only but not /query . If you want to match both /query and /query/ , you can just leave path of the #PostMapping in the query method as the default.
#RestController
#RequestMapping(path = "/query")
public class MainController {
#PostMapping
public ResponseEntity query(#RequestBody String query){
}
}
There could be a reason for this error that Spring boot is not scanning this class. Please try to add ComponentScan annotation on Spring boot main class with the package where you keep your controllers as given below.
#ComponentScan(basePackages= {"com.example"})
Check the port on which your Spring Server is running, According to the medium post they have configured it to run on :8000 while you're hitting on :8080.
The error states the same that it cannot find any controller mapped to this api-endpoint.
http://localhost:8000/query/
`
I am getting the following stack trace when trying to start an app using Spring Boot Devtools.
2019-03-15T08:20:26,929 WARN o.s.c.a.AnnotationConfigApplicationContext:557 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'optionalLiveReloadServer' defined in class path resource [org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration$LiveReloadConfiguration.class]: Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: No Scope registered for scope name 'restart'
Exception in thread "restartedMain"
....
Here is the pom file in use to reproduce the problem.
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dispatch</groupId>
<artifactId>dispatch-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>dispatch-java</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath />
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Begin Spring Boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
I can find issues where people are having similar issues but none with the 'restart' scope name.
I will answer with what I figured out the problem was.
It seems that loading the ApplicationContext in the main() method of the Spring Boot app was the cause of this trouble.
I had to change
...
private static ApplicationContext context;
public static void main(final String[] args) {
context = new AnnotationConfigApplicationContext(DispatcherConfiguration.class);
SpringApplication.run(DispatcherApplication.class, args);
}
public static ApplicationContext getApplicationContext() {
return context;
}
and once I stopped setting context Spring Boot started fine with Dev Tools.
Check whether #ComponentScan is used only for once. In my case I used #ComponentScan in SpringMainApplication.java (where main method is there) and also in BeanDecleration.java file. After removing #ComponentScan from the BeanDecleration.java file, the error is resolved.
In my Spring boot application i should show a date string on html. I using this code to get a time jason:
spring:
jackson:
date-format: HH:mm:ss.SSSSSS
joda-date-time-format: HH:mm:ss.SSSSSS
it can be word when i run with IDEA, but it can't work when i use maven to packet a jar and run this jar.
there is exception message :
beans.factory.BeanCreationException: Error creating bean with name 'jacksonObjectMapperBuilder' defined in class path resource [org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration$Jac
ksonObjectMapperBuilderConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframe
work.http.converter.json.Jackson2ObjectMapperBuilder]: Factory method 'jacksonObjectMapperBuilder' threw exception; nested exception is java.lang.IllegalArgumentException: name
how should do to get a jason time String?
here is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<thymeleaf.version>3.0.0.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.0.0</thymeleaf-layout-dialect.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
and my table class is that:
#Entity
public class TimeData {
#Id
#GeneratedValue(strategy = GenerationType.AUTO)
private long id;
#Temporal(TemporalType.TIME)
#JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "HH:mm:ss.SSSSSS",timezone = "GMT+8")
private Date curingTime;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getCuringTime() {
return curingTime;
}
public void setCuringTime(Date curingTime) {
this.curingTime = curingTime;
}
}
in my spring boot application i should to return a jason String with TimeData.
it can be get well run with IDEA ,but couldn't run with jar .
This smells like a classpath issue. Your stacktrace also has nothing to do with your actual code. I think you may be pulling in incompatible versions of the same library somehow. Ensure you actually need all those dependencies and see what you can remove and try rerunning your jar.