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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:14:33+00:00 2026-05-17T03:14:33+00:00

I’ve been following the ‘Netbeans E-Commerce tutorial’, and have am currently on this step:

  • 0

I’ve been following the ‘Netbeans E-Commerce tutorial’, and have am currently on this step:
http://netbeans.org/kb/docs/javaee/ecommerce/entity-session.html

I have fully configured my Window 7 account as per that page, with NetBeans 6.9.1, Glassfish server and MySQL.

I’m getting an error 500 when executing ‘Category’ page (log extract below). The error manifests itself when I complete step 3 in the ‘selected category’ sub-section of the ‘Accessing Data with EJBs’ this page. The line in question is:

// get selected category
selectedCategory = categoryFacade.find(Short.parseShort(categoryId));

If I comment this line out, the bug goes away.

The log file snippet is here:

[#|2010-09-29T18:32:32.570+0100|WARNING|glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=30;_ThreadName=http-thread-pool-8080-(2);|StandardWrapperValve[Controller]: PWC1406: Servlet.service() for servlet Controller threw exception
javax.ejb.EJBException
 at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5119)
 at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5017)
 at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4805)
 at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2004)
 at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1955)
 at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:198)
 at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
 at $Proxy355.find(Unknown Source)
 at session.__EJB31_Generated__CategoryFacade__Intf____Bean__.find(Unknown Source)
 at controller.ControllerServlet.doGet(ControllerServlet.java:68)

Line 68 in the ControllerServlet code is the one identified above.

My experience with both Java and Netbeans is sufficiently light that I’m not even sure how to go about starting to debug this. I’ve followed the tutorial pretty closely, so it should not be something I’ve missed – but mistakes do happen.

I understand an outright solution based on the information contained would be difficult. If there is any further information required, please ask. Failing that, if anyone has any suggestions on how I can further investigate this on my own, I’d be very grateful.

I always think cracking problems is the best way to learn, but it is pretty frustrating as well.

Update:
I’ve been running through the NetBeans debugger. It appears that the problem is with the cast code (Short.parseShort(categoryId)). When I replace this with a simple numeral it works.
e.g. this code works
// get selected category
selectedCategory = categoryFacade.find(1);

Does anyone have any ideas why the cast is failing? categoryId is confirmed as a string with a value of “1” in the debugger…

  • 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-17T03:14:33+00:00Added an answer on May 17, 2026 at 3:14 am

    Okay, I’ve cracked this. It was obviously my fault…

    The table identity should have been set up as a short, instead I set it up as an integer. Therefore by casting the ‘categoryId’ string to short and passing it into the find method, I was passing in the wrong data type.

    Replacing the ‘Short.parseShort(categoryId)’ argument with a ‘Integer.parseInt(categoryId)’ fixed the problem.

    For those that took the time to read this; thank you.

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

Sidebar

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.