users@glassfish.java.net

StackOverflowError while Persisting Data

From: <glassfish_at_javadesktop.org>
Date: Wed, 20 Feb 2008 12:05:21 PST

What I am trying to accomplish is populate a database using JPA. I have created the entities and now I am attempting to store the data in the database. When the entity manager persist the data, I get the following error. Mind you the SQL Server 2005 database is empty.

Feb 20, 2008 1:44:49 PM com.sun.ejb.containers.BaseContainer postInvoke
INFO:
javax.ejb.EJBException
        at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3869)
        at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3769)
....
Caused by: java.lang.StackOverflowError
        at java.lang.reflect.Method.invoke(Method.java:597)
        at oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.invokeMethod(PrivilegedAccessHelper.java:322)


My code is as fllows:



                EntityManager em = getEntityManager();
                
                em.joinTransaction();
                
                Asset asset2= new Asset();
                asset2.setAssetArtifact(assetVO.getAssetArtifact());
                asset2.setAssetImage(assetVO.getAssetImage());
                asset2.setAssetMaintenanceHistories(assetVO.getAssetMaintenanceHistories());
                asset2.setAssetOrigDate(assetVO.getAssetOrigDate());
                asset2.setAssetType(assetVO.getAssetType());
                asset2.setCageCode(assetVO.getCageCode());
                asset2.setConsumables(assetVO.getConsumables());
                asset2.setDateDecommissioned(assetVO.getDateDecommissioned());
                asset2.setDatePlacedInService(assetVO.getDatePlacedInService());
                asset2.setGovFurnishEquipAssetId(assetVO.getGovFurnishEquipAssetId());
                asset2.setItemPart(assetVO.getItemPart());
                asset2.setManufacturer(assetVO.getManufacturer());
                asset2.setModel(assetVO.getModel());
                asset2.setNsn(assetVO.getNsn());
                asset2.setPemaAsset(assetVO.getPemaAsset());
                asset2.setProdModelName(assetVO.getProdModelName());
                asset2.setProductDo(assetVO.getProductDo());
                asset2.setSerialNbr(assetVO.getSerialNbr());
                asset2.setServerAsset(assetVO.getServerAsset());
                asset2.setTradingPartner(assetVO.getTradingPartner());
                asset2.setWarranties(assetVO.getWarranties());
                
                
                em.persist(asset2);

Any help would be greatly appreciated.

Russ
[Message sent by forum member 'russ205' (russ205)]

http://forums.java.net/jive/thread.jspa?messageID=260005