• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

JPA starter  RSS feed

 
Ranch Hand
Posts: 65
  • 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: 21742
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: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
removed and got this error
 
Rob Spoor
Sheriff
Posts: 21742
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: 65
  • 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
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!