• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

JPA starter  RSS feed

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried to add JPA to existing project in intelij.
i add JPA through Faces.
then i added next dependencies (want to connect sql server :


and created db and class based on example i found
also the persistance.xml i created manully and put it under : src\main\resources\META-INF\persistence.xml
this is the xml


when i run this code i get error :


maybe i should use different version in the dependency?
 
Sheriff
Posts: 21719
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be good there. Table.indexes has been added in JPA 2.1. You're using both JPA 2.2 and Hibernate 5.4.2. While that could be asking for trouble if there is a compatibility mismatch, https://hibernate.org/orm/releases/ shows that Hibernate 5.4 should be JPA 2.2 compatible.

If you remove the JPA dependency and only use the Hibernate one, can you then still compile your code with Table.indexes?
 
Peter Benda
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
removed and got this error
 
Rob Spoor
Sheriff
Posts: 21719
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you deploy your application? Because I've downloaded your MSSQL server driver from mvnrepository.com and it contains the class that is reported as missing.
 
Peter Benda
Ranch Hand
Posts: 61
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem was in the persistance.xml file

com.microsoft.sqlserver.jdbc.SQLServerDriver


SQLServerDriver - was written not correctly
 
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!