This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

JPA starter

 
Ranch Hand
Posts: 67
  • 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: 21803
104
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
removed and got this error
 
Rob Spoor
Sheriff
Posts: 21803
104
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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: 67
  • 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
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!