Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate 邮递员@GET';我没有得到任何回应,并且大摇大摆地@get请求已经终止_Hibernate_Rest_Spring Boot_Swagger_Postman - Fatal编程技术网

Hibernate 邮递员@GET';我没有得到任何回应,并且大摇大摆地@get请求已经终止

Hibernate 邮递员@GET';我没有得到任何回应,并且大摇大摆地@get请求已经终止,hibernate,rest,spring-boot,swagger,postman,Hibernate,Rest,Spring Boot,Swagger,Postman,@得到 我的控制器 @RestController @RequestMapping(path = "/batchConfig") public class BatchJobConfigController { @Autowired private BatchJobConfigRepository repository; /* * Mapping url exmaple:http://localhost:8080/batchConfig/findConfigs

@得到

我的控制器

@RestController
@RequestMapping(path = "/batchConfig")
public class BatchJobConfigController {
    @Autowired
    private BatchJobConfigRepository repository;

    /*
     * Mapping url exmaple:http://localhost:8080/batchConfig/findConfigs
     */

    @GetMapping(value = "/findConfigs", consumes = MediaType.ALL_VALUE)
    List<BatchJobConfig> findAll() {
        return repository.findAll();
    }

    /*
     * http://localhost:8080/batchConfig/findConfigs?configId=1
     */
    @GetMapping(value = "/findConfigs/{configId}", consumes = MediaType.ALL_VALUE)
    BatchJobConfig findOneBatchJobConfig(@PathVariable Long id) {
        return repository.findById(id).orElseThrow(() -> new BatchJobConfigNotFoundException(id));
    }
}
模型

log4j.properties

logging.level.org.springframework=INFO
logging.level.root=ERROR
server.error.include-stacktrace=never
spring.profiles.active=demo
#spring.main.banner-mode=off
# Automatically update the database
spring.jpa.hibernate.ddl-auto=update

spring.datasource.driver-class-name=com.ibm.db2.jcc.DB2Driver

# The database connection URL
spring.datasource.url=jdbc:db2://tetet:50002/testt

# Username
spring.datasource.username=tyyy

# Password
spring.datasource.password=rrrrr

# Define the database platform
spring.jpa.database-platform=org.hibernate.dialect.DB2Dialect

# Define the naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy

# Define the default schema
spring.jpa.properties.hibernate.default_schema=schema
# Root logger option
log4j.rootLogger=INFO, file

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender

#Redirect to Tomcat logs folder
#log4j.appender.file.File=${catalina.home}/logs/logging.log

log4j.appender.file.File=C:\\logigng.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.logger.org.hibernate.util.JDBCExceptionReporter=ERROR


log4j.logger.org.hibernate.engine.jdbc.spi.SqlExceptionHelper=ERROR 
log4j.logger.org.hibernate=ERROR
错误的可能原因:

网络错误:无法访问主机 证书问题:指定了https,但服务使用的是自签名、过期或其他有问题的证书 CORS错误:请求的服务不允许来自其他域的请求。请尝试在chrome中添加Swagger Inspector扩展,因为它可以解决此问题。
可能会禁用招摇过市检查器扩展。请尝试通过转到以下位置启用它:chrome://extensions.

我通过关闭所有打开的命令行窗口,而不是关闭我用于此应用程序的端口,解决了此问题。

在spring boot应用程序启动过程中出现任何异常或错误?不,没有异常。我通过关闭所有打开的命令行窗口来修复它。当时我打开了3-4个CMD,我正在关闭我在本例中使用的端口8080,而不是关闭并重新打开CMD窗口。
@Repository
public interface BatchJobConfigRepository extends JpaRepository<BatchJobConfig, Long> {

}
logging.level.org.springframework=INFO
logging.level.root=ERROR
server.error.include-stacktrace=never
spring.profiles.active=demo
#spring.main.banner-mode=off
# Automatically update the database
spring.jpa.hibernate.ddl-auto=update

spring.datasource.driver-class-name=com.ibm.db2.jcc.DB2Driver

# The database connection URL
spring.datasource.url=jdbc:db2://tetet:50002/testt

# Username
spring.datasource.username=tyyy

# Password
spring.datasource.password=rrrrr

# Define the database platform
spring.jpa.database-platform=org.hibernate.dialect.DB2Dialect

# Define the naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy

# Define the default schema
spring.jpa.properties.hibernate.default_schema=schema
# Root logger option
log4j.rootLogger=INFO, file

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender

#Redirect to Tomcat logs folder
#log4j.appender.file.File=${catalina.home}/logs/logging.log

log4j.appender.file.File=C:\\logigng.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
log4j.logger.org.hibernate.util.JDBCExceptionReporter=ERROR


log4j.logger.org.hibernate.engine.jdbc.spi.SqlExceptionHelper=ERROR 
log4j.logger.org.hibernate=ERROR