• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA/Hibernate: Rename entity, change all references, no class found error

 
Aaron Wilt
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, not sure if you can help but I hope you try! :-) This is a very weird problem.

I decided to rename one of my entity objects from ProductSearchCriteria to ProductFilterCriteria. In my local tomcat/eclipse environment everything works great, however when I put my code up on the prod server I get this weird exception:



I've searched many times in my code base, xml files, everywhere for my old class name "ProductSearchCriteria" but it appears NO WHERE. The error occurs when the entity manager is trying to be created. In my persistence.xml I have



so there are no <class> tags that are referencing my old entity name.

I've tried restarting tomcat, restarting the actual box... nothing. Do these entity names get cached somewhere? Any idea what could be going on? I'm at my wits end.

Thank you so much for reading.

Aaron
[ November 30, 2007: Message edited by: Aaron Wilt ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does look like it is cached somewhere, or it is still in some file. I'd be careful of assuming that Windows search accurately searched the contents of you files, I have had it report false negatives before. I usually use my IDE's search functionality to find that sting value.

Good Luck, I can only say try the IDE search, since you already said you rebooted everything that was on the production server including the server itself.

Mark
 
Aaron Wilt
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,

Yeah I've used eclipse to do the search locally, and our prod servers are on linux and we've used the standard linux search to inspect all the files. the only place it found a reference to the old file was in subversion, our source control system.

Surely there's no way tomcat could be finding an old version of the file in subversion somehow right ?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most likely not. But it seems that you old stuff still seems to be in production. So it could be in a jar or some archive? In cache, in some file that your not seeing. Unfortunately I can't help much after my last post.

Good Luck

Mark
 
Aaron Wilt
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So we figured out the problem. apparently the tomcat wasn't clearing out old .class files in the work directory when we deployed a new war... so the annotations process was going through trying to autodetect and it ran into the old class file for the entity that got renamed, and apparently that's what was causing the problem. When we deleted everything out of tomcat's work directory everything was fine.

now that i blew 6 hours on that problem i guess i can do something productive!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic