0

I am getting following exception, when running java web application. Environment is as follows Operating system: Windows 10 enterprise Payara: 5.201 Maria DB: 5.5.64 Apache net beans IDE 11.3 Wicket version: 9.0.0 Jakarta EE:8.0.0

The warning mentions that it should be reported to maintainers of org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by  org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream (file:/C:/Dev/Java/CKBDataAccess/target/CKBDataAccess/WEB-INF/lib/wicket-core-9.0.0.jar) to method java.io.ObjectStreamClass.lookup(java.lang.Class,boolean)
WARNING: Please consider reporting this to the maintainers of org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

[Wicket-AsyncPageStore-PageSavingThread] ERROR org.apache.wicket.serialize.java.JavaSerializer - Error serializing object class uk.ac.ox.ndph.ckb.cda.ui.registration.Register [object=[Page class = uk.ac.ox.ndph.ckb.cda.ui.registration.Register, id = 5, render count = 1]]|#] org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream$ObjectCheckException: The object type is not Serializable! A problem occurred while checking object with type: com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate Field hierarchy is: 5 [class=uk.ac.ox.ndph.ckb.cda.ui.registration.Register, path=5] private java.lang.Object org.apache.wicket.MarkupContainer.children [class=java.util.ArrayList] java.lang.Object org.apache.wicket.Component.data[write:30][write:31] [class=uk.ac.ox.ndph.ckb.cda.ui.registration.Register$DataForm, path=5:inputForm] java.lang.Object org.apache.wicket.Component.data [class=org.apache.wicket.model.CompoundPropertyModel] private java.lang.Object org.apache.wicket.model.ChainingModel.target [class=org.apache.wicket.model.LoadableDetachableModel] final uk.ac.ox.ndph.ckb.cda.model.ControllerSecurity uk.ac.ox.ndph.ckb.cda.model.ControllerSecurity$1.this$0 [class=uk.ac.ox.ndph.ckb.cda.model.ControllerSecurity] private uk.ac.ox.ndph.ckb.cda.db.session.CdaPreRegRequestsFacade uk.ac.ox.ndph.ckb.cda.model.ControllerSecurity.mCdaPreRegRequestsFacade [class=uk.ac.ox.ndph.ckb.cda.db.session.EJB31_Generated__CdaPreRegRequestsFacade__Intf____Bean] private uk.ac.ox.ndph.ckb.cda.db.session.EJB31_Generated__CdaPreRegRequestsFacade__Intf uk.ac.ox.ndph.ckb.cda.db.session.EJB31_Generated__CdaPreRegRequestsFacade__Intf____Bean.__ejb31_delegate [class=com.sun.proxy.$Proxy437] protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate] <----- field that is causing the problem

Can someone please help?

Code of the facade referred to last in hierarchy

 /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uk.ac.ox.ndph.ckb.cda.db.session;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import uk.ac.ox.ndph.ckb.cda.common.CDAConstants;
import uk.ac.ox.ndph.ckb.cda.db.entity.CdaPreRegRequest;
import uk.ac.ox.ndph.ckb.cda.db.search.SearchOnString;
import uk.ac.ox.ndph.ckb.cda.exceptions.DuplicateKeyEx;

@Stateless
public class CdaPreRegRequestsFacade extends AbstractFacade<CdaPreRegRequest> {

    @PersistenceContext(unitName = "CKBDataAccessPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public CdaPreRegRequestsFacade() {
        super(CdaPreRegRequest.class);
        mSearchList.add(new SearchOnString(CDAConstants.EMAIL, 
                CDAConstants.EMAIL));
    }

    public CdaPreRegRequest findRequestByKey(String strKey) {
        return getByUniqueIndex(em,
                "CdaPreRegRequest.findByKey", "strKey", strKey);
    }

    public CdaPreRegRequest findRequestById(int id) {
        return getByUniqueIndex(em,
                "CdaPreRegRequest.findByReqId", "id", id);
    }

    @Override
    public CdaPreRegRequest checkDuplicate(CdaPreRegRequest curObj,     String menuName) throws DuplicateKeyEx {
        CdaPreRegRequest existing = getByUniqueIndex(em,
                "CdaPreRegRequest.findByEmail", "Email", curObj.getEmail());        
        if (existing != null && !existing.equals(curObj)) {
            throw new DuplicateKeyEx(
                    CDAConstants.EMAIL, menuName,  curObj.getEmail());
        }
        return curObj;
    }
}
    
  • [What is an illegal reflective access?](https://stackoverflow.com/questions/50251798/what-is-an-illegal-reflective-access) – Scratte Jul 12 '21 at 15:36
  • I am afraid I don't know – Rajani Sohoni Jul 12 '21 at 15:42
  • If anyone were to try to reproduce this, where would they find the `uk.ac.ox.ndph.ckb.cda` stuff that is required by imports? – Scratte Jul 12 '21 at 16:41
  • Its a huge project, and I will need to check before I can share all the relevant code. I will try to reduce it to bare minimum, to see if I can share it. I also don't know how jvm can be configured via Apache Netbeans, to setup options mentioned in the link. – Rajani Sohoni Jul 13 '21 at 07:56
  • The Problem was using LoadableDetachableModel in Stateless class. Once I moved it to class inherited from Webpage, problem was resolved. – Rajani Sohoni Jul 14 '21 at 09:09
  • I think no one here would have been able to find that from the information provided. – Scratte Jul 14 '21 at 09:11
  • Yes I agree. Sorry. – Rajani Sohoni Jul 14 '21 at 10:02

0 Answers0