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

  • SEARCH
  • Home
  • 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 7834181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:05:09+00:00 2026-06-02T13:05:09+00:00

I am using hibernate JPA on tomcat. I created a connection pool on tomcat

  • 0

I am using hibernate JPA on tomcat. I created a connection pool on tomcat and it works fine independently. Now for my JPA to use this connection pool ; I created persistence.xml as follows:

<?xml version="1.0"?>
<persistence>
    <persistence-unit name="kids" transaction-type="JTA">
        <jta-data-source>jdbc/kids</jta-data-source>
    </persistence-unit>
</persistence>

It is giving me following exception:

javax.persistence.PersistenceException: Invalid persistence.xml.
Error parsing XML (line-1 : column -1): cvc-elt.1: Cannot find the declaration of element ‘persistence’.

Please help.

  • 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-06-02T13:05:11+00:00Added an answer on June 2, 2026 at 1:05 pm

    Maybe you should set the namespace attribute and the schema location for the persistence node:

    <persistence 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_1_0.xsd"
             version="1.0">
        <persistence-unit name="kids" transaction-type="JTA">
            <jta-data-source>jdbc/kids</jta-data-source>
        </persistence-unit>
    </persistence>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using tomcat connection pool, jpa, hibernate. The datasource i created in context.xml
I`m using hibernate with jpa, and it is configured with persistence.xml Is it possible
I would like to use springMVC and JPA (using hibernate) on my tomcat 7
When using Persistence frameworks like Hibernate, JPA etc. on the server side, what are
This question is related to Hibernate using JPA (annotated Entities) and liquibase . I
I have a JPA using Hibernate connected to SQLserver. It works but i have
I'm using Hibernate with JPA and have a relationship that looks like this: public
I have an application using Tomcat/Spring 3/JPA/Hibernate but my merges do not commit to
I'm using OpenEJB 3.1.3 embedded in Tomcat 5.5.26 and I use hibernate 3.6 as
I am using Tomcat6/J2ee app with Hibernate jpa libraries. I have database connection properties

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.