• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic