Win a copy of Svelte and Sapper in Action this week in the JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

problem with jpa+spring

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am working a project with jpa+spring+maven+flex
i have this exception in a popup when my application runs :

in the console i have :
i attach to the subject persistence.xml and springconfiguration.xml please help me
 
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cannot see: persistence.xml and springconfiguration.xml. Please, attach them.
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is applicationContext.xml

this is persistence.xml
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the code that tries to open hibernate session.
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is a problem of configuration not in the code no?
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try if you can create DB connection with plain JDBC:
http://www.mkyong.com/jdbc/how-do-connect-to-postgresql-with-jdbc-driver-java/

Please, include the whole stacktrace, not just selected pieces.
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but i should work with jpa
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I know, but we have to examine if there is any problem in the lower layer.

Please, include the whole stacktrace, not just selected pieces.
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the result
1111111111.png
[Thumbnail for 1111111111.png]
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
result
22222222222222222.png
[Thumbnail for 22222222222222222.png]
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have executed it incorrectly. You should give the name of the Main class:

C:\test>java -cp c:\test\postgresql-8.3-603.jdbc4.jar;c:\test JDBCExample

Where JDBCExample is the class with main method.
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes i excute it with the name of the class of the main
12.png
[Thumbnail for 12.png]
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, because you do not have space between your classpath and Main class. You have just specified classpath.
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have made the space because i followed the tuto ,it doesn't workkkkkk :\
oooooooooooooooooo.png
[Thumbnail for oooooooooooooooooo.png]
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should try this:
C:\test>java -cp c:\test\postgresql-8.1-404.jdbc3.jar;c:\test JDBCExample

NOT
C:\test>java -cp c:\test\postgresql-8.1-404.jdbc3.jar;c:\test\JDBCExample.java
AND NOT
C:\test>java -cp c:\test\postgresql-8.1-404.jdbc3.jar;c:\test\JDBCExample
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks i have this result
looooooooooooooooooooooooooooooooo.png
[Thumbnail for looooooooooooooooooooooooooooooooo.png]
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have typed BAD command once again. Please, stay focused and type:

java -cp c:\test\postgresql-8.1-404.jdbc3.jar;c:\test JDBCExample

Pay attention to every single sign and space!
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it doesn't work please what is the error now ?
cccccccccccccccccccccccc.png
[Thumbnail for cccccccccccccccccccccccc.png]
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have typed:

java -cp c:\test\postgresql-8.1-404.jdbc3.jar;c:\testJDBCExample

You SHOULD type:

java -cp c:\test\postgresql-8.1-404.jdbc3.jar;c:\test JDBCExample


 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it didn't work also :\ :\
naaaaaaaaaaaaaa.png
[Thumbnail for naaaaaaaaaaaaaa.png]
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have :-------- PostgreSQL JDBC Connection Testing ------------
PostgreSQL JDBC Driver Registered!
You made it, take control your database now!
 
hana jenhani
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how i can be sure that the problem is not from mey server?
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, we are sure that your DB is accessible from the code.

You gave us the exception:
org.springframework.transaction.CannotCreateTransactionException : Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
null

Please paste the full stack trace despite the fact that it can be very long.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic