[英]Java Spring Hibernate Schema-Validation: Missing Table
Having a very weird issue here. 这里有一个非常奇怪的问题。 I have a list of environments built for dev/test/qa/prod.
我有一个为dev / test / qa / prod构建的环境列表。 Each connects to a different database, one corresponding to each environment.
每个数据库连接到不同的数据库,一个数据库对应于每个环 When I run the code in dev, everything is great, when I run it in any other environment, I get
当我在dev中运行代码时,一切都很棒,当我在任何其他环境中运行它时,我得到了
Factory method 'sessionFactory' threw exception; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [dbo.Cause_Code]
I would like to now note that this for test/qa/prod, the code is deployed to servers and WORKS. 我想现在注意这个用于test / qa / prod,代码部署到服务器和WORKS。 No errors, but running it locally gives me that missing table.
没有错误,但在本地运行它给了我丢失的表。 That table definately exists and dev/test/qa/prod databases are in the exact same schema state.
该表肯定存在,dev / test / qa / prod数据库处于完全相同的模式状态。
You can see here that the table is in the QA database and the IDE sees that: 您可以在此处看到该表位于QA数据库中,IDE将看到:
Adding schema="dbo" to table annotation does nothing, changing hibernate.hbm2ddl.auto to none allows it to build, but all calls fail for the same reason. 将schema =“dbo”添加到表注释什么都不做,将hibernate.hbm2ddl.auto更改为none允许它构建,但所有调用都因同样的原因而失败。
I should note that I have tested that is not the environments I built. 我应该注意到,我测试的不是我建立的环境。 Dev works, I changed the database connection for that environment to QA and it failed.
开发工作,我将该环境的数据库连接更改为QA,但失败了。 I also tried adding in the data source directly to hibernate persistance window and that did nothing.
我也尝试将数据源直接添加到hibernate persistance窗口,但没有做任何事情。
Can someone tell me why the IDE thinks the tabble doesn't exist, but the deployed code works great and the table definitely exists? 有人能告诉我为什么IDE认为tabble不存在,但部署的代码工作得很好并且表肯定存在? I have to be missing a simple setting somewhere.
我必须在某个地方错过一个简单的设置。
Well, I got tired of trying different things over the last 6 hours and re-installed the IDE. 好吧,我厌倦了在过去的6个小时内尝试不同的东西并重新安装了IDE。 Imported the project which had the shared environment configs already set up.
导入已设置共享环境配置的项目。 Made no changes and just ran the QA build, worked first try.
没有做任何更改,只是运行QA构建,首先尝试。 I guess there was something messed up in the install.
我猜安装中有些东西搞砸了。 No idea why it only affected every environment but dev though.
不知道为什么它只会影响每个环境但是开发者。 I tried everything form restarting the entire computer to disabling everything to creating an empty project and only the re-install fixed it.
我尝试了所有形式重新启动整个计算机以禁用所有内容创建一个空项目,只有重新安装修复它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.