简体   繁体   English

Java EE Glassfish错误编译不存在的命名查询

[英]Java EE Glassfish error compiling non existing named query

My problem is following: 我的问题如下:

In one entity class I have added NamedQuery that didn't compile well at the time of application deployment to server. 在一个实体类中,我添加了NamedQuery,该应用在将应用程序部署到服务器时无法很好地编译。 The problem was that I was using wrong entity name in it's JPQL statement, so I've decided to remove that problematic NamedQuery for the time being, while I consider some alternative. 问题是我在JPQL语句中使用了错误的实体名称,因此我决定暂时删除有问题的NamedQuery,同时考虑其他选择。

So, everything went on normal, the application was working fine, when all of the sudden, I started getting the same error I've got when I tried to deploy entity bean with afore-mentioned problematic NamedQuery. 因此,一切正常,应用程序运行正常,突然之间,当我尝试使用上述有问题的NamedQuery部署实体bean时,我开始遇到相同的错误。 Funny thing is that such NamedQuery does not exist anywhere in my code - I've removed all references to it, so there's no way it could still get deployed to server, but somehow it does. 有趣的是,这样的NamedQuery在我的代码中不存在-我已经删除了对它的所有引用,因此仍然无法将其部署到服务器,但是以某种方式可以做到。 It's like the Glassfish holds it's own copy of those entity beans and keeps deploying them, although they were modified in the meantime. 就像Glassfish拥有这些实体bean的副本一样,并继续部署它们,尽管在此期间它们已被修改。

Feel free to ask me for any additional info regarding this problem. 随时询问我有关此问题的其他信息。

I've managed to resolve the issue by simply restarting Windows. 我已经设法通过简单地重新启动Windows来解决此问题。

Did try undeploying and deploying the application numerous times, did many glassfish server restarts but none of that gave me the results. 尝试多次取消部署和部署应用程序,是否重启了许多glassfish服务器,但没有任何结果。 Looks like glassfish had some kind of it's own cache where it stored the old versions of those entity classes and for some unknown reason refused to deploy new classes. 看起来glassfish拥有某种自己的缓存,用于存储那些实体类的旧版本,并且由于某些未知原因而拒绝部署新类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM