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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:24:04+00:00 2026-05-31T01:24:04+00:00

I am trying to create a web app using JSF and EJB 3.0. I

  • 0

I am trying to create a web app using JSF and EJB 3.0.

I am using plain JSF, Glassfish Server, Hibernate as my persistance provider. My database is apache derby.

Here my Stateless Session bean as follows:

  @Stateless
  @TransactionManagement(TransactionManagementType.CONTAINER)
  public class StudentServiceBean implements StudentService{


    @PersistenceContext(unitName="forPractise")
    private EntityManager entityMgr;

    @Resource
    private SessionContext sessionContext;

    @Override
    public List<StudentVO> fetchStudentListOrderByStudentId(boolean flag){
        List<StudentEntity> studentList = null;
        TypedQuery<StudentEntity> studentQuery = null; 
        List<StudentVO> studentVOList = null;
        String queryDesc = "select s from StudentEntity s order by s.studentId desc";
        String query = "select s from StudentEntity s order by s.studentId";
        try{

            if(!flag){
                studentQuery = entityMgr.createQuery(query,StudentEntity.class);
            }else{
                studentQuery = entityMgr.createQuery(queryDesc,StudentEntity.class);
            }           

            studentList = studentQuery.getResultList();
            studentVOList = new ArrayList<StudentVO>();
            for(StudentEntity studentE : studentList){              
                studentVOList.add(new StudentVO(String.valueOf(studentE.getStudentId()),studentE.getStudentName(),studentE.getContactNumber()));
            }

        }catch(Exception e){
            System.out.println(" EXCEPTION IN "+this.getClass().getName()+" in method fetchStudentListOrderByStudentId "+e);
        }
        return studentVOList;
    }

And this is my persistence.xml:

 <?xml version="1.0" encoding="UTF-8"?>
 <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_2_0.xsd"
              version="2.0">
    <persistence-unit name="forPractise" transaction-type="JTA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>jdbc/app</jta-data-source>
        <class>com.entity.StudentEntity</class>
        <properties>
                <property name="hibernate.dialect"  value="org.hibernate.dialect.DerbyDialect"  />
                <property name="hibernate.show_sql" value="true" />
                <property name="hibernate.format_sql" value="true" />               
                <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.SunONETransactionManagerLookup" />             
        </properties>
    </persistence-unit>
 </persistence>

What happens is on load of the JSP page, the getter method of StudentList is called –
inside the getter method I have written logic that if studentList is empty then call the studentService.fetchStudentListOrderByStudentId(true);.

But when I do this I get an exception:

EXCEPTION IN com.bb.StudentServiceBean in method
fetchStudentListOrderByStudentId
org.hibernate.service.UnknownServiceException: Unknown service
requested
[org.hibernate.service.jdbc.connections.spi.ConnectionProvider]

Can you please tell me what I am missing, or where I am going wrong?

Thanks.

  • 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-31T01:24:05+00:00Added an answer on May 31, 2026 at 1:24 am

    You indicate that you are using Hibernate 4.x, but the class you mentioned afaik is only valid for JPA 1.0 and Hibernate 3.x. Try removing the following line from your configuration:

    <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.SunONETransactionManagerLookup" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a web application using maven, tomcat and hibernate. Now I'm
I am trying to create a UI for a java web app using Vaadin.
I am trying to create a simple web app using Python on GAE. The
We are trying to create an ASP.NET web app using the apple-mobile-web-app-capable meta-tag to
I am trying to create a web site app using MVC 3- The problem
I'm trying to create a rails web app that does not use ActiveRecord framework
I am trying to create a screen cast for my new web app. I
I'm trying to create a Palm OS app to check a web site every
So I'm trying to create an MVC3 web app. I decided to use EF
I'm trying to create a small web app that is used to remove items

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.