This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getting a JDBC connection through JNDI on JBoss 6.x  RSS feed

Erico Teixeira
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application using JSF (primefaces 4) + JPA on Jboss 6.1

All my DB mapping is made through annotation and my DAOs extend a generic DAO configured by a Factory Producer
In my Factory Producer I declare my Entity Manager that will be injected in the my DAOs
I need to call a procedure and leave the app free turning it back to the screen
For that I have used an async ajax call in JSF along with Thread . In my Thread I am trying to call the procedure call through run method

My problem is this .. My Thread is used as follows :

Doing this I leave JSF scope ... and all my annotations injections stop working
So I don´t get a valid Entity Manager ... etc ...
I am trying to get a valid java.sql.Connection pointing to my app persistence.xml

For this I have tried the following :

It is not working . The connection is instantiated but it is not ok ... It that the table from the query doesn´t exist ( it does ... it is working properly )
My app persitence.xml file content :

My jboss standalone.xml file content :

I am stuck on this for the all week googling for codes but with out success
I am posting this question here because all the samples that I have got on the web are related to JNDI and JDBC but again none worked
So I thought that some one that uses JBoss 6.x would give some help on the setting code according to my environment

Thks !!
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!