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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:29:50+00:00 2026-06-01T09:29:50+00:00

I have been following the affableBean tutorial from the NetBeans site located here .

  • 0

I have been following the affableBean tutorial from the NetBeans site located here .

Code Repo here .

I have run into an issue where I am unable to submit a purchase order(checkout.jsp).
When I submit the form data, I receive an http 500 status and the following errors:

WARNING: EJB5184:A system exception occurred during an invocation on EJB OrderManager, method: public java.util.Map session.OrderManager.getOrderDetails(int)
WARNING: javax.ejb.EJBException at controller.ControllerServlet.doPost(ControllerServlet.java:184)
Caused by: java.lang.NullPointerException at session.OrderManager.getOrderDetails(OrderManager.java:111)

Line 184 of ControllerServlet is: Map orderMap =
orderManager.getOrderDetails(orderId);

Line 111 of OrderManager is: Customer customer = order.getCustomer();

While running a debug session, it seems that the culprit is the line in OrderManger inside the getOrderDetails() method. From what I can tell,the line is supposed to populate the customer object with the orders’ customer.

Looking into where the .getCustomer() method originates it is from the CustomerOrder Entity class:

private Customer customer;    
...
public Customer getCustomer() {
        return customer;
    }

Seems simple enough, it returns the Customer object. What is puzzling me is why I would receive a nullpointer exception, why is this object empty?

I believe it may be down to my entity class being incorrect, this in turn would mean my database that I forward engineered from a entity diagram would be incorrect, am I on the right path?

Edit:

Having removed the try catch block from the placeOrder() method within the ordermanager class
due to it modifying the return value to 0.

i have run into additional problems:

WARNING: EJB5184:A system exception occurred during an invocation on EJB OrderManager, method: public int session.OrderManager.placeOrder(java.lang.String,....,cart.ShoppingCart)
WARNING: javax.ejb.EJBException
javax.validation.ConstraintViolationException: Bean Validation constraint(s) violated while executing Automatic Bean Validation on callback event:'prePersist'.**

at session.OrderManager.addCustomer(OrderManager.java:58) (*em.persist()*)
    at session.OrderManager.placeOrder(OrderManager.java:42)   (*Customer customer = addCustomer()*)

I am currently reading up on how to iterate over the errors and find what constraint i am failing.

Edit2:

Debugging the addCustomer method i see the customer id is null, is this okay? i assume it is as the ID database field is set to auto-increment, still, seems odd to have an settable id field in the entity at all in that case.

Edit3:
Turns out the auto generated [NotNull] tags in my entity classes were causing bean validation to fail, removed the tags and it works fine.

  • 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-01T09:29:51+00:00Added an answer on June 1, 2026 at 9:29 am

    The only possible cause that I see for a NPE thrown there, is that order itself is a null object.

    Since order is given by:

    CustomerOrder order = customerOrderFacade.find(orderId);
    

    my conclusion is that an order with that orderId is simply not present in the db.

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

Sidebar

Related Questions

I have been following the validation for Entry boxes from here . The code
I'm new to NHibernate... I have been following this NHibernate Tutorial from Gabriel Schenker
I have been following javascript tutorial from www.w3school.com and while reading one of the
I am new to Ajax and have been following a tutorial from JQuery.com. I
I'm new to jQuery and have been following the tutorial here for a Panel
i have been following apps snowfall tutorial, but i am getting some issue in
I have been following a video tutorial from O'reilly media going through the basics
I have been following this Tutorial on how to read from a plist. However
I have been following a tutorial on how to write a basic tile map
I have been following the tutorial on Microsofts website and they use GameTime to

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.