Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!

Julius Adek

+ Follow
since Dec 02, 2012
Julius likes ...
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Julius Adek

Oh thanks! I have not actually chosen any manufacturer, am just looking for where to start before starting developing the app
4 months ago
Thanks so much. I did not actual know manufacturer that can provide me with what you have mentioned above. Please, I will appreciate if you can prescribe anyone for me. Thanks for your response.
4 months ago
please am about to develop an app that will makes use of finger print machine but I need a simulator that I can use in place of this device for testing purpose while I am developing this app. please, can someone prescribe one for me? thanks for your response.
4 months ago
Yes, an abstract class is meant to be extended by concrete class. Since abstract class can not be instantiated, so one of the work of concrete class is to implement abstract methods in the abstract class. Abstract method is a method that is having head without a body, so concrete class gives bodies to all abstract class methods. You can read more here:
8 months ago
Moreover, I later detected that it was converter issue so I searched net. But later came across omnifaces Converter, so I used it and everything working perfectly now.
Oh thanks Mohammed, I have long resolve this issue, just forget to post feedback message concerning it. Well, I resolved it by removing ManyToOne annotation since the CRUD of both tables in the database would done manually and not by JPA framework. Thanks for your response.
You can start with Java tutorial here:

After you are comfortable with that you may play with Java SE specification and Java virtual machine specification if you like, I think these would educate you on how java programming works.
8 months ago
Great, congratulations! wish you more success in all your endeavour.
8 months ago
They exit as soon as the class is loaded. static members of class always exit even without creation of any object of that specific class, you can directly access a static member through the name of the class but for you to access any instance member there must be an object attach to it. For example, if assign() method was created as "static void assign(){ }"; then you should be able to call assign() within the main() method without calling it through "big" object although you can still call it through it. However, static variable has only one original copy in all the objects of a class; if you create "static int x = 5;" in a class called "Rectangle". Then , you now create 3 objects from Rectangle class called "rec1", "rec2", and "rect3" respectively. The value "x" in all these 3 objects would be the same that is, if you change "x = 20;" from "rec1". This new value will be available in "rec1", "rec2" and "rec3".
8 months ago
Because locationCell is only locally accessible to an instance of TryOut object. So, it can not be called without the instance of this object. As you can see that before you called assign() it was called through an instance object of TryOut called big. However, if this locationCell has been created as static variable; you would have been able to call locationCell within any static or reference method especially the main method. All static members of a class are always globally accessible.
8 months ago
Please when ever I run this application i got the following message:

java.lang.IllegalArgumentException: Cannot convert 4801 of type class java.lang.String to class com.smartshop.entity.category.Category

The files are:





//The html file has been reduced to preserve space.


The issue is that if remove "categoryId" from, this app will work fine but anytime I include it back it will issue the above error. Please, what can I do to resolve this? Thanking you for your quick response.
Thanks it is working fine. I just changed " <property name="eclipselink.ddl-generation"
value="drop-and- <property name="eclipselink.ddl-generation"
value="drop-and-create-tables"/> -tables"/> "  to " <property name="eclipselink.ddl-generation"
Please, when ever i made changes to any of the file like "persistence.xml" or "" file. For example, to change " p.setName("Hendro Steven");" to  " p.setName("James Paul");" save the file and then run the program. It will give the following error:

HTTP Status 500 - Internal Server Error

type Exception report

messageInternal Server Error

descriptionThe server encountered an internal error that prevented it from fulfilling this request.


org.jboss.weld.exceptions.IllegalStateException: WELD-000227: Bean identifier index inconsistency detected - the distributed container probably does not work with identical applications
Expected hash: -1910493119
Current index: BeanIdentifierIndex [hash=2147418287, indexed=12]:
   1: WELD%AbstractBuiltInBean%com.sun.faces.application.view.ViewScopeExtension%HttpSession
   2: WELD%AbstractBuiltInBean%org.glassfish.cdi.transaction.TransactionalExtension%HttpSession
   3: WELD%AbstractBuiltInBean%org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider%HttpSession
   4: WELD%AbstractBuiltInBean%org.glassfish.jersey.ext.cdi1x.servlet.internal.CdiExternalRequestScopeExtension%HttpSession
   5: WELD%AbstractBuiltInBean%org.glassfish.jersey.ext.cdi1x.transaction.internal.TransactionalExceptionInterceptorProvider%HttpSession
   6: WELD%AbstractBuiltInBean%org.glassfish.jms.injection.JMSCDIExtension%HttpSession
   7: WELD%AbstractBuiltInBean%org.glassfish.osgicdi.impl.OSGiServiceExtension%HttpSession
   8: WELD%AbstractBuiltInBean%org.glassfish.sse.impl.ServerSentEventCdiExtension%HttpSession
   9: WELD%AbstractBuiltInBean%org.hibernate.validator.internal.cdi.ValidationExtension%HttpSession
  10: WELD%AbstractBuiltInBean%root_web%HttpSession
  11: WELD%AbstractBuiltInBean%web%HttpSession

note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 4.1.1 logs.
GlassFish Server Open Source Edition 4.1.1

Moreover, if I try to close the IDE "Netbeans 8.1" to restart it back. This time if I run the program it will work fine but all the data that have been stored in the database before i restart it will not be found again, only the current new data will be retained and if I made any change to any file, the above error will be printed on the screen.

Please, what can I do to this? Thanks for your response.
Thanks Rob spoor, God bless you more. I have set it to "false" as you have instructed and it works.
Please I just had issue with JPA sample application with Netbeans IDE 8.1, the following is the error message after I run the app:

Jun 08, 2017 11:41:04 PM org.hibernate.validator.internal.util.Version <clinit>
INFO: HV000001: Hibernate Validator 5.1.2.Final
[EL Info]: 2017-06-08 23:41:10.481--ServerSession(2504638)--EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd
[EL Info]: connection: 2017-06-08 23:41:43.366--ServerSession(2504638)--file:/D:/New E-Library/360View Apps/JPA tutor 8 June 2017/build/web/WEB-INF/classes/_JPATest2_PU login successful
[EL Warning]: metamodel: 2017-06-08 23:41:43.444--The collection of metamodel types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units.  Please verify that your entity classes are referenced in persistence.xml using either <class> elements or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element
java.lang.IllegalArgumentException: Object: entity.Person[ id=null ] is not a known entity type.
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(
at JPATest2.persist(
at JPATest2.main(
BUILD SUCCESSFUL (total time: 1 minute 11 seconds)

All the files are:

1. persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
  <persistence-unit name="JPATest2_PU" transaction-type="RESOURCE_LOCAL">
      <property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/sample"/>
      <property name="javax.persistence.jdbc.password" value="app"/>
      <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
      <property name="javax.persistence.jdbc.user" value="app"/>
      <property name="javax.persistence.schema-generation.database.action" value="create"/>
      <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>


package entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

public class Person implements Serializable {

    private static final long serialVersionUID = 1L;
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id  ;

    public Long getId() {
        return id;

    public void setId(Long id) { = id;
    private String address;

     * Get the value of address
     * @return the value of address
    public String getAddress() {
        return address;

     * Set the value of address
     * @param address new value of address
    public void setAddress(String address) {
        this.address = address;
    private String phoneNumber;

     * Get the value of phoneNumber
     * @return the value of phoneNumber
    public String getPhoneNumber() {
        return phoneNumber;

     * Set the value of phoneNumber
     * @param phoneNumber new value of phoneNumber
    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;

    private String name;

    public String getName() {
        return name;

    public void setName(String name) { = name;

    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;

    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Person)) {
            return false;
        Person other = (Person) object;
        if (( == null && != null) || ( != null && ! {
            return false;
        return true;

    public String toString() {
        return "entity.Person[ id=" + id + " ]";


import entity.Person;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

public class JPATest2 {
     public static void main(String[] args) {
Person p = new Person();
        p.setName("Hendro Steven");
        p.setAddress("Salatiga, Indonesia");
        JPATest2 test = new  JPATest2();
     public void persist(Object object) {
        EntityManagerFactory emf = javax.persistence.Persistence.createEntityManagerFactory("JPATest2_PU");
        EntityManager em = null;
        em = emf.createEntityManager();
        try {
        } catch (Exception e) {
        } finally {

Please, what did I need to put in place for this JPA app to auto create table and work as intended? Thanks for your response.