Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

JPA starter

 
Ranch Hand
Posts: 79
  • 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: 21941
106
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: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
removed and got this error
 
Rob Spoor
Sheriff
Posts: 21941
106
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: 79
  • 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
 
What are you doing? You are supposed to be reading this tiny ad!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic