1 year ago

#342606

test-img

Jade

Netbeans getting error trying to run Web app to create/read/update/delete MySQL database table entries

I'm having trouble with my program. I need to make a Web application that connects to my MySQL database and is able to Create, Read, Update and Delete entries in the database tables.

I am using this tutorial to create it:

https://www.youtube.com/watch?v=TUKV-HITSrs

Edit: I have since downloaded Apache Tomee Webprofile 8.0.10, and am using Java EE 7 as the platform. (I tried downloading Java EE 8 as recommended, but GlassFish5 ended up being in the folder, and I wasn't sure how to add Java EE 8 as a new platform). I'm still using Netbeans 12.6.

I now can run the program, and a web page is created: index.xhtml

However, when I click on either of the links, I get this error page:

An Error Occurred:
javax.el.ELException: Error reading [items] on type [storeDB.CustomersController$$OwbNormalScopeProxy0]

viewId=/customers/List.xhtml
location=C:\Users\jades\Desktop\Java\storeDB\target\storeDB-1\customers\List.xhtml
phaseId=RENDER_RESPONSE(6)

Caused by:
java.lang.NullPointerException - The bean encountered a non-application exception; nested exception is: java.lang.NullPointerException
at storeDB.AbstractFacade.findRange(AbstractFacade.java:47)

/customers/List.xhtml at line 17 and column 138 rendered="#{customersController.items.rowCount == 0}"
+ Stack Trace
+ Component Tree
+ Scoped Variables

AstractFacade.java Line 47 is this:

javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();

List.xhtml Line 17 is this:

<h:outputText escape="false" value="#{bundle.ListCustomersEmpty}" rendered="#{customersController.items.rowCount == 0}"/>

Does anyone know what's wrong with these lines? I don't see any error symbols or red underlines.

java

mysql

netbeans

crud

apache-tomee

0 Answers

Your Answer

Accepted video resources