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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:38:58+00:00 2026-06-16T11:38:58+00:00

Here is my structure \jpa \src \resources \META-INF \persistence.xml \oldtests \com TestClass.java \war \oldtests

  • 0

Here is my structure

\jpa
  \src
    \resources
      \META-INF
        \persistence.xml
  \oldtests
    \com
      TestClass.java
\war
  \oldtests
    \com
      TestSuite.java

TestClass extends BaseTest, and I am running it via the test suite.

In the test itself I am grabbing my persistance info with…

public class BaseTest extends TestCase {
  protected EntityManagerFactory emf;
  protected EntityManager em;
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    emf = Persistence.createEntityManagerFactory("test");
    em = emf.createEntityManager();
    ...
  }
  ...
}

However, emf is always null, thus throwing an NPE on the next line. This leads me to believe my persistence.xml isn’t getting picked up for some reason. Can someone help me solve where the file needs to be located? Is there a place I can confirm it isn’t an issue with the file itself (bad configuration)?

I could add the persistance-unit on request but I doubt that is the issue since we are using this elsewhere. Also I am using eclipse to run my tests.

  • 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-16T11:38:59+00:00Added an answer on June 16, 2026 at 11:38 am

    The steps I needed to solve this are follows:

    1. Add IBM plugin jars to classpath

      I did this by creating a user library that points to <WASINSTALL>\plugins\*.jar

    2. Add items to your Junit Classpath.

      I did this by going to run > Debug Configurations

      • Next I selected the junit test suite configuration

      • Next I selected the classpath tab

      • Finally I added the JPA project and the user lib using the advanced option.

    This seeemed to solve my issue

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

Sidebar

Related Questions

here is the structure of my project. proj ---src ----main ----java ----Main.java ----resources ----res.txt
For example I have a file name call A.java. Here its structure: public class
Here's the structure of my XML <FileRoot> <UserSet1> <User> <FirstName></FirstName> <LastName></LastName> </User> <User> <FirstName></FirstName>
I have a shape drawable in the drawable folder. Here is XML structure: <?xml
I have the generic structure here: <?xml version=1.0 encoding=UTF-8?> <SOAP-ENV:Envelope xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/ xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/
I want to get an attribute from vimeo xml.. here is structure of xml
here is table structure table1 pk int, email character varying(100)[] data 1, {'mr_a@gmail.com', 'mr_b@yahoo.com',
Here is a structure used in a program: struct basic_block { void * aux;
okey so here is my structure. one.php two.php three.php one.php includes both two.php and
I have a document structure {'text': 'here is text', 'count' : 13, 'somefield': value}

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.