我已经使用Spring Boot框架创建了一个项目。
我在服务器上进行部署后遇到了此错误,但是在localhost上运行良好。
白标错误页面
此应用程序没有针对/ error的显式映射,因此您将其视为后备。
星期四2020年4月30日19:14:00
发生意外错误(类型=未找到,状态= 404)。
/WEB-INF/view/sign-in.jsp
这是我的application.properties文件
spring.mvc.view.prefix=/WEB-INF/view/
spring.mvc.view.suffix=.jsp
spring.thymeleaf.view-names=html/*
logging.level.org.hibernate.SQL=debug
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.resources.chain.strategy.content.enabled=true
spring.resources.chain.strategy.content.paths=/**
答案 0 :(得分:0)
按medTech的建议在项目中添加# By the way, I am assuming there is more to this class than a query
# method; otherwise, there should probably just be a regular function
# that takes the db, hierarchic, and sku as arguments.
@dataclass
class DataQuery:
hierarchic: str
sku: bool
pred_length: int
def query(self, db):
result = None
if self.hierarchic == 'store' and self.sku:
result = db.aggregate(...)
return QueryResult(result)
class QueryResult:
def __init__(self, result):
self.result = result
def export_json(self, file):
if self.result is None:
return
with open(f'/home/Documents/dataset/{file}', 'w') as fp:
for i in x:
json.dump(i, fp)
fp.write('\n')
data.query(db).export_json('abc.json')
来创建war文件时,问题就解决了。