Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1048945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:32:13+00:00 2026-05-16T16:32:13+00:00

I am using JPA with hibernate and trying to connect to the a datasource

  • 0

I am using JPA with hibernate and trying to connect to the a datasource to retrive information but when i run the application i get no error as such but no results are displayed when i run the following code.The question arose from a previous post located here when I was setting up the environment to do some testing of JPA with hibernate on Glassfish.

The log file shows this

INFO: Not binding factory to JNDI, no JNDI name configured

My Log File

INFO: Processing PersistenceUnitInfo [
    name: DBAppPU
    ...]
INFO: Binding entity from annotated class: model.VMatterDetails
INFO: Binding Named query: VMatterDetails.findAll => SELECT v FROM VMatterDetails v
INFO: Binding Named query: VMatterDetails.findByMatterInfoStatus => SELECT v FROM VMatterDetails v WHERE v.matterInfoStatus = :matterInfoStatus
INFO: Binding Named query: VMatterDetails.findByMatterInfoRespLwyr => SELECT v FROM VMatterDetails v WHERE v.matterInfoRespLwyr = :matterInfoRespLwyr
INFO: Binding Named query: VMatterDetails.findByMatterID => SELECT v FROM VMatterDetails v WHERE v.matterID = :matterID
INFO: Binding Named query: VMatterDetails.findByMatterInfoMatterNum => SELECT v FROM VMatterDetails v WHERE v.matterInfoMatterNum = :matterInfoMatterNum
INFO: Bind entity model.VMatterDetails on table vMatterDetails
INFO: Hibernate Validator not found: ignoring
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
INFO: Using provided datasource
INFO: RDBMS: Microsoft SQL Server, version: 10.50.1600
INFO: JDBC driver: jTDS Type 4 JDBC Driver for MS SQL Server and Sybase, version: 1.2.5
INFO: Using dialect: org.hibernate.dialect.SQLServerDialect
INFO: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
INFO: Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
INFO: instantiating TransactionManagerLookup: org.hibernate.transaction.SunONETransactionManagerLookup
INFO: instantiated TransactionManagerLookup
INFO: Automatic flush during beforeCompletion(): disabled
INFO: Automatic session close at end of transaction: disabled
INFO: Scrollable result sets: enabled
INFO: JDBC3 getGeneratedKeys(): enabled
INFO: Connection release mode: auto
INFO: Default batch fetch size: 1
INFO: Generate SQL with comments: disabled
INFO: Order SQL updates by primary key: disabled
INFO: Order SQL inserts for batching: disabled
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO: Using ASTQueryTranslatorFactory
INFO: Query language substitutions: {}
INFO: JPA-QL strict compliance: enabled
INFO: Second-level cache: enabled
INFO: Query cache: disabled
INFO: Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
INFO: Optimize cache for minimal puts: disabled
INFO: Structured second-level cache entries: disabled
INFO: Statistics: disabled
INFO: Deleted entity synthetic identifier rollback: disabled
INFO: Default entity-mode: pojo
INFO: Named query checking : enabled
INFO: Check Nullability in Core (should be disabled when Bean Validation is on): disabled
INFO: building session factory
INFO: Not binding factory to JNDI, no JNDI name configured
INFO: Running hbm2ddl schema update
INFO: fetching database metadata
INFO: updating schema
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: table found: DB12248.dbo.vMatterDetails
INFO: columns: [clientinfostrextra1, matterinfobudgetdisbs, addressinfohomefaxphone, addressinfocompany, addressinfoaddrline2, addressinfoaddrline1, addressinfopager, matterinfodestroydate, matterinfolasttrust, matterinfobilledrcpts, addressinfolastname, matterinfoamtquoted, addressinfoattposition, matterinfolastsoadate, matterinfobilledhours, matterinfoextracasenote2, matterinfoextracasenote1, addressinfoaddrgroup, matterinfobilleddisbs, addressinfowebpage, addressinfohomephone, clientinfoextra2, clientinfoextra1, matterinfostatus, matterinfoextracasenote5, matterinfobilladdid2, matterinfoextracasenote6, matterinfoextracasenote3, matterinfoextracasenote4, addressinfomiddle, addressinfointernetaddr, matterinfoactivematter, clientinfomatterext, matterinfosparelong2, matterinfosparelong1, lawyerid, matterinforeferredbytype, matterid, matterinfobilladdid, matterinfosortname, matterinfodefrateamt, matterinfodefratetype, matterinfodocumentpath, matterinfototfees, matterinfoformatfile, addressinfocarphone, addressinfoextra, matterinfocredithold, matterinfocasenotes, matterinfortnrbal, addressinfohomeemail, matterinfofilelocation, matterinfoextracollectnote4, addressinfocity, matterinfochargeint, matterinfoextracollectnote3, matterinfoextracollectnote6, matterinfoextracollectnote5, addressinfosuffix, matterinfoopendate, matterinfobudgetfees, matterinfoflags, clientinfosortname, clientinfoclientdefault, addressinfofirst, matterinfointerestsettings, matterinfoextracollectnote2, clientinfomatterbase, matterinfoextracollectnote1, addressinfocode, matterinfosoaformat, addressinfocountry, matterinfofiledesc, matterinforeflwyr, matterinfousedefintrate, addressinfoaddrtype, matterinfomatternum, matterinforeferredby, matterinfotypeoflaw, addressinfocellphone, matterinfocollectionnotes, clientinfodocumentpath, matterinfobilledfees, matterinfosparestring, matterinfoarbal, matterinfolastbilled, matterinfolastrcptamount, matterinfototdisbs, addressinfoattlast, matterinfototalhours, matterinfotaxdisbs, matterinfosparedouble, matterinforesplwyr, matterinfolastfeedate, matterinfointrate, addressinfobusphone, addressinfoprov, matterinfocrossreference, addressinfofaxphone, matterinfolastrcptdate, matterinfototrcpts, addressinfotitle, matterinfolastdisbdate]
INFO: foreign keys: []
INFO: indexes: [pk__vmatterd__4d8e0b1a0b5cafea]
INFO: schema update complete
INFO: JNDI InitialContext properties:{}
INFO: Portable JNDI names for EJB VMatterDetailsFacade : [java:global/DBApp/VMatterDetailsFacade, java:global/DBApp/VMatterDetailsFacade!ejb.VMatterDetailsFacadeLocal]
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: Loading application DBApp at /DBApp
INFO: DBApp was successfully deployed in 3,374 milliseconds.
INFO: Find All Executing
INFO: Find All Return

The EJB bean is

@Stateless
public class VMatterDetailsFacade implements VMatterDetailsFacadeLocal {
    public static final Logger log = Logger.getLogger("ejb.VMatterDetailsFacade");

    @PersistenceUnit(unitName = "DBAppPU")
    private EntityManagerFactory emf;    

    private List<VMatterDetails> matterDetailsList;

    protected EntityManager getEntityManager() {
        return emf.createEntityManager();
    }


    @Override
    public VMatterDetails find(String str) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public List<VMatterDetails> findAll() {
        log.info("Find All Executing");
        matterDetailsList = emf.createEntityManager().createNamedQuery("VMatterDetails.findAll").getResultList();
//        matterDetails.addAll(em2.createNamedQuery("VMatterDetails.findAll").getResultList());
        log.info("Find All Return");
        return matterDetailsList;
    }
    @Override
    public int count() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

and my persistence xml is

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="DBAppPU" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>matterPool12248</jta-data-source>
    <properties>
      <property name="hibernate.hbm2ddl.auto" value="update"/>
    </properties>
  </persistence-unit>
</persistence>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:32:14+00:00Added an answer on May 16, 2026 at 4:32 pm

    The log you pasted doesn’t show any ERROR (nor FATAL nor WARNING) message and the particular message you’re showing is just telling you that you didn’t bind the SessionFactory to JNDI. There is nothing wrong with that, many application don’t use a JNDI-bound SessionFactory and this is not really relevant when using JPA anyway. So just ignore this INFOrmational message.

    Actually, according to the log file, everything looks fine: your entities have been detected, the named queries processed, the schema has been updated (so the connection to the DB is OK), etc.

    That being said, I would first activate SQL logging to see what is happening exactly (this won’t solve the problem but still). You can set either set the following property in your persistence.xml:

    <!-- Echo all executed SQL to stdout -->
    <property name="hibernate.show_sql" value="true"/>
    

    Or (and I prefer this option because I want fine control over logging anyway), by setting the logging level to debug for the following category:

    org.hibernate.SQL
    

    And run the generated SQL against the database.

    Second thing, I suggest using an injected container-managed EntityManager instead of using an application managed EntityManager (that’s the preferred way to go in a managed environment):

    @Stateless
    public class VMatterDetailsFacade implements VMatterDetailsFacadeLocal {
        public static final Logger log = Logger.getLogger("ejb.VMatterDetailsFacade");
    
        @PersistenceContext(unitName = "DBAppPU")
        private EntityManager em;
    
        @Override
        public VMatterDetails find(String str) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
    
        @Override
        public List findAll() {
            log.info("Find All Executing");
            List matterDetailsList = em.createNamedQuery("VMatterDetails.findAll")
                .getResultList();
            log.info("Find All Return");
            return matterDetailsList;
        }
        @Override
        public int count() {
            throw new UnsupportedOperationException("Not supported yet.");
        }
        ...
    }

    But again, this is just a side note, this won’t solve your problem.

    Start with checking the generated SQL and update your question with the result. If the query returns data, please tell us how you checked that the bean method doesn’t work.

    References

    • Hibernate Core documentation
      • 3.5. Logging
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to setup Spring using Hibernate and JPA, but when trying to persist
I'm using Spring with Hibernate as a JPA provider and are trying to get
I have a Spring/JPA/Hibernate application and am trying to get it to pass my
I am trying to configure Spring3 + JPA using Hibernate, but I am getting
I'm using Hibernate and JPA for a small project. Somehow when trying to obtain
I am trying to map a JPA (using Hibernate) one-to-one relationship with a inheritance
I'm trying to implement some basic entities using Hibernate/JPA. Initially the code was deployed
i have a strange situation: I'm using jpa/hibernate to get rows from a mySql
I'm trying to set up the following tables using JPA/Hibernate: User: userid - PK
I´m using JPA Hibernate and Spring MVC. I haved implemented repository pattern. I get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.