• 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
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Unable to locate persistence units

 
Ranch Hand
Posts: 333
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to create a jpa page but I'm getting error in my persistence file.
My persistence:

Error log:

Thanks in advanced.
 
Cezar Apulchro
Ranch Hand
Posts: 333
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My pom:

Thanks.
 
Saloon Keeper
Posts: 23882
162
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stack Trace wrote:
Caused by: javax.persistence.PersistenceException: Invalid persistence.xml



It's really not necessary to post your POM for every problem. Generally you only need to do so if there's a problem locating classes.
 
Cezar Apulchro
Ranch Hand
Posts: 333
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Last version of persistence:

Thanks.
 
Saloon Keeper
Posts: 7031
164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Start with this:

Attribute 'value' must appear on element 'property'.


All "property" elements must have a "value" attribute - in this file, that's not the case.
 
Cezar Apulchro
Ranch Hand
Posts: 333
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand my persistence file was generated by Netbeans. I have compared with others persistence file in web and I not saw difference I know that this error "Unable to locate persistence units" are in my persistence file but I can't see where.

What is this:
 
Cezar Apulchro
Ranch Hand
Posts: 333
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I changed my persistence to version=2.0 and error now is:
 
Tim Moores
Saloon Keeper
Posts: 7031
164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the file is corrupt, who knows what can happen. I seriously doubt that the version attribute has anything to do with this. But as long as the file doesn't even parse (see line 17), there's really no point in speculating.
 
Cezar Apulchro
Ranch Hand
Posts: 333
3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is be solved.
Solution:

Thanks.
 
Tim Moores
Saloon Keeper
Posts: 7031
164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great! So it was indeed the property with the missing value attribute?
 
Ranch Hand
Posts: 92
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:The problem is be solved.
Solution:

Thanks.



A little information, you mustn't declare dialect class when you using Hibernate, it can automatically detect
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic