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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:30:10+00:00 2026-06-04T23:30:10+00:00

Up to this point I have had a fully functional NetBeans Platform application with

  • 0

Up to this point I have had a fully functional NetBeans Platform application with a single screen that utilized Shipvia entity class through the following code:

import entity.Shipvia;
import entity.Route;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Persistence;
import javax.persistence.Query;

public class RetrieveResultList {

    public static List RetrieveResultList (String tablename){
        EntityManager entityManager = Persistence.createEntityManagerFactory("EntityLibraryPU").createEntityManager();
        System.out.println("NAMED QUERY:>"+tablename+".findAll");
        Query query = entityManager.createNamedQuery(tablename+".findAll");
        List<Shipvia> resultList = query.getResultList();
        return resultList;
    }
}

As you can see I create a dynamic query based on the table name passed. So if the user opens a ShipviaTopComponent, it will call Shipvia.findAll (see part of entity class below).

package entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "SHIPVIA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Shipvia.findAll", query = "SELECT c FROM Shipvia c")
});

My goal is to have a second screen, called RouteTopComponent utilize Route entity class

package entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "ROUTE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Route.findAll", query = "SELECT c FROM Route c")
});

However, here is the error I am getting when I try to open the Route screen:

SEVERE [global]
java.lang.IllegalArgumentException: NamedQuery of name: Route.findAll not found.
    at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getDatabaseQueryInternal(EJBQueryImpl.java:577)
    at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createNamedQuery(EntityManagerImpl.java:1043)
    at com.demo.viewer.RetrieveResultList.RetrieveResultList(RetrieveResultList.java:23)
    at com.demo.viewer.RoutesTopComponent.<clinit>(RoutesTopComponent.java:40)
Caused: java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

Line 40 of RouteTopComponent is:

List<Route> resultList = RetrieveResultList.RetrieveResultList("Route");

It puzzles me as to why it works fine opening ShipviaTopComponent and finds Shipvia.findAll, but not RouteTopComponent/Route.findAll ?

  • 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-04T23:30:12+00:00Added an answer on June 4, 2026 at 11:30 pm

    As discussed in the comments, you have to list the entity classes explicitly in the persistence.xml file if you are using RESOURCE_LOCAL transaction-type/ running JPA in Java SE environment.

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

Sidebar

Related Questions

I really need help here. I'm desperate at this point. I have NSOperation that
I have this code that I want to make point-free; (\k t -> chr
I am somewhat new to Jruby - up to this point I have had
Up to this point we have not yet needed a new masterpage for our
I've created my first custom Umbraco 5.1 solution. At this point I have a
I have create a module which at this point does nothing but exist the
I have a fairly simple iOS 5 app at this point. A UINavigationController is
I'm extremely new to Flex and I'm stuck at this early point. I have
This is what I have in mind: Can anyone point out some relevant resources?
I have this code: public class Area { Texture2D point; Rectangle rect; SpriteBatch _sB;

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.