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 3944344
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:53:21+00:00 2026-05-20T00:53:21+00:00

We are trying to build a JSF application with JPA. For now, we want

  • 0

We are trying to build a JSF application with JPA. For now, we want to make the login feature, but when we run the application on our glassfish server, there is the exception:

javax.persistence.PersistenceException: No Persistence provider for EntityManager named siteMami

We think the problem is somewhere from persistence.xml, maybe at the provider, please help us. Thanks! Here is the directory structure:

Here is the directory structure

persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    version="1.0">

    <persistence-unit name="siteMami" transaction-type="JTA">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <class>model.Admin</class>
        <class>model.User</class>
        <class>model.Client</class>
        <properties>
            <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
            <property name="javax.persistence.jdbc.url"
                value="jdbc:mysql://localhost/siteMami" />
            <property name="javax.persistence.jdbc.user" value="root" />
            <property name="javax.persistence.jdbc.password" value="" />
        </properties>
    </persistence-unit>
</persistence>

User.java:

/**
 * 
 */
package model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "useri")
@Inheritance(strategy = InheritanceType.JOINED)
public class User implements Serializable
{
    @Transient
    private static long serialVersionUID    = 6837935606727700935L;

    @Id
    @GeneratedValue
    @Column(name = "idUseri")
    private long        id;

    @Column(unique = true)
    private String      username;
    private String      password;

    /**
     * @param id
     * @param userName
     * @param password
     */
    public User(long id, String username, String password)
    {
        super();
        this.id = id;
        this.username = username;
        this.password = password;
    }

    /**
     * @return the id
     */
    public long getId()
    {
        return id;
    }

    /**
     * @return the userName
     */
    public String getUsername()
    {
        return username;
    }

    /**
     * @return the password
     */
    public String getPassword()
    {
        return password;
    }

    public void setId(long id)
    {
        this.id = id;
    }

    public void setUsername(String userName)
    {
        this.username = userName;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }
}

UserManager.java:

package dao;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import model.User;

public class UserManager
{
    private EntityManagerFactory    factory;

    public UserManager()
    {
        factory = Persistence.createEntityManagerFactory("siteMami");
    }

    public User getUser(String username, String password)
    {
        EntityManager entityManager = factory.createEntityManager();

        EntityTransaction entityTransaction = entityManager.getTransaction();

        entityTransaction.begin();

        Query q = entityManager.createQuery("SELECT * FROM User WHERE User.username = '" + username + "' and User.password = '" + password + "'");

        entityTransaction.commit();

        return (User) q.getSingleResult();
    }
}
  • 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-20T00:53:22+00:00Added an answer on May 20, 2026 at 12:53 am

    It just popped out on the screenshot somehow: Your file is named
    “persitence.xml” instead of
    “persistence.xml”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build an Java EE 6-application on GlassFish V3, using JSF 2.0,
I was trying Build For Archiving application (from Titanium Mobile) with xCode 4.4, but
I'm trying to build JSF application and I'm using hibernate as ORM solution. The
I'm trying to build a POC to migrate a heavy JSF application to a
im trying out to build a web application. it must have contain a login
I'm trying to run a simple jsf-2.0 tutorial using embedded glassfish 3.0 and keep
I trying to build an application that is using the torrent technology to make
I'm trying build an App Engine connected Android application and am having some problems
I'm trying build a MVC framework, but I'm confused about manage themes. Well... I
I am trying to build a navigation tree via recursion in JSF. I have

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.