Question

I have written a desktop application which is JavaFX based, developed on NetBeans 7.4. I'm using Glassfish to pool jdbc connections and JMS traffic. Development is on a Win 7 64bit system, using 64bit java 1.7_51. One of my users has a 32bit win 7 machine, and the application refuses to run correctly on his machine. There are actually 2 glassfish servers, each providing data connectivity from a different logical company. All of the server code on the two glassfish servers is built from the same code base. The application, running on the 32bit java, get a StackOverflowException when reading data from one of the servers but not the other, so I assumed it was somehow related to the deployment of the server. When I could find nothing there, I then serialized the data to a file, and when reading in the data from the file, the same dataset gives me the overflow. Again, this is only in the 32bit version of java. I have rebuilt the application using a 32bit java jdk, and the error persists. Running the 32bit jar on a 64bit java jvm does not have a problem. The stack trace when trying to read from the database:

2014-04-08 15:19:52,820 [INFO  PricingPresenter] - Entering com.lamtec.pricingcl
ient.PricingPresenter.displayLamtecProducts.
2014-04-08 15:19:52,824 [INFO  PricingPresenter] - Entering com.lamtec.pricingcl
ient.PricingPresenter.clearTables.
2014-04-08 15:19:52,828 [INFO  PricingPresenter] - Entering com.lamtec.pricingcl
ient.PricingPresenter.init.
2014-04-08 15:19:52,832 [INFO  PricingPresenter] - Properties:  {org.omg.CORBA.O
RBInitialHost=10.20.10.207, MessageTypeLoader=COM.LAMTEC.SHIPPING.UPDATE_LOADER,
 org.omg.CORBA.ORBInitialPort=3700, EnableProductDevelopment=true, RunAtCustom=f
alse, MessageTypeShipper=COM.LAMTEC.SHIPPING.UPDATE_SHIPPER, LamtecServer=http:/
/enterprise:8080/LamtecServer, CustomServer=http://resolute:8080/LamtecServer, P
roductDevelopmentServer=http://resolute:56156/ProductDevelopmentServer}.
2014-04-08 15:19:52,835 [INFO  PricingPresenter] - Entering com.lamtec.pricingcl
ient.PricingPresenter.getProductList
2014-04-08 15:19:52,839 [INFO  PricingPresenter] - Entering com.lamtec.pricingcl
ient.PricingPresenter.getAdhesiveList
2014-04-08 15:19:52,843 [INFO  PricingPresenter] - Entering com.lamtec.pricingcl
ient.PricingPresenter.getChemicalList
2014-04-08 15:19:52,850 [INFO  PricingPresenter] - Entering com.lamtec.pricingcl
ient.PricingPresenter.getMaterialList
2014-04-08 15:19:52,854 [INFO  PricingPresenter] - Entering com.lamtec.pricingcl
ient.PricingPresenter.hideProductNames.
org.springframework.remoting.RemoteAccessException: Could not access HTTP invoke
r remote service at [http://enterprise:8080/LamtecServer/lamtecserver.service];
nested exception is java.lang.StackOverflowError
        at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
.convertHttpInvokerAccessException(HttpInvokerClientInterceptor.java:212)
        at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
.invoke(HttpInvokerClientInterceptor.java:145)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
cAopProxy.java:202)
        at com.sun.proxy.$Proxy15.listProducts(Unknown Source)
        at com.lamtec.pricingclient.PricingPresenter$15.call(PricingPresenter.ja
va:2504)
        at com.lamtec.pricingclient.PricingPresenter$15.call(PricingPresenter.ja
va:2500)
        at javafx.concurrent.Task$TaskCallable.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.StackOverflowError
        at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
        at java.io.ObjectInputStream$BlockDataInputStream.readInt(Unknown Source
)
        at java.io.ObjectInputStream.readHandle(Unknown Source)
        at java.io.ObjectInputStream.readClassDesc(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at java.util.ArrayList.readObject(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at java.util.ArrayList.readObject(Unknown Source)
etc....

When trying to read the serialized data from a file:

2014-04-08 15:19:43,715 [INFO  PricingPresenter] - Entering com.lamtec.pricingcl
ient.PricingPresenter.doReadArchive.
2014-04-08 15:19:43,762 [INFO  ArchiveSelectorController] - Entering com.lamtec.
pricingclient.ArchiveSelectorController.getPrimaryStage.
2014-04-08 15:19:43,765 [INFO  ArchiveSelectorController] - Entering com.lamtec.
pricingclient.ArchiveSelectorController.getPrimaryStage.
2014-04-08 15:19:43,769 [INFO  ArchiveSelectorController] - Entering com.lamtec.
pricingclient.ArchiveSelectorController.getPrimaryStage.
2014-04-08 15:19:47,674 [INFO  ArchiveSelectorController] - Entering com.lamtec.
pricingclient.ArchiveSelectorController.doArchiveSelectedLoad.
2014-04-08 15:19:47,684 [INFO  ArchiveSelectorController] - Entering com.lamtec.
pricingclient.ArchiveSelectorController.getPrimaryStage.
2014-04-08 15:19:47,689 [INFO  ArchiveSelectorController] - Entering com.lamtec.
pricingclient.ArchiveSelectorController.isArchiveSelected.
2014-04-08 15:19:47,695 [INFO  PricingPresenter] - Entering com.lamtec.pricingcl
ient.PricingPresenter.clearTables.
2014-04-08 15:19:47,864 [INFO  PricingPresenter] - Entering read archive product
s
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java
.lang.reflect.InvocationTargetException
        at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(Unknown Source)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unkn
own Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknow
n Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknow
n Source)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Sou
rce)
        at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at javafx.event.Event.fireEvent(Unknown Source)
        at javafx.scene.control.MenuItem.fire(Unknown Source)
        at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContaine
r.doSelect(Unknown Source)
        at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContaine
r$6.handle(Unknown Source)
        at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContaine
r$6.handle(Unknown Source)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unkn
own Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknow
n Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknow
n Source)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(U
nknown Source)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Sourc
e)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Sou
rce)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Sourc
e)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Sou
rce)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Sourc
e)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Sou
rce)
        at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at javafx.event.Event.fireEvent(Unknown Source)
        at javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at javafx.scene.Scene$MouseHandler.access$1900(Unknown Source)
        at javafx.scene.Scene.impl_processMouseEvent(Unknown Source)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotificatio
n.run(Unknown Source)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotificatio
n.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unkn
own Source)
        at com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
        at com.sun.glass.ui.View.notifyMouse(Unknown Source)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
        at com.sun.glass.ui.win.WinApplication$3$1.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.reflect.misc.Trampoline.invoke(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
        ... 41 more
Caused by: java.lang.StackOverflowError
        at java.io.ObjectInputStream$BlockDataInputStream.readByte(Unknown Sourc
e)
        at java.io.ObjectInputStream.readString(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
        at java.io.ObjectInputStream.readSerialData(Unknown Source)
        at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
        at java.io.ObjectInputStream.readObject0(Unknown Source)
        at java.io.ObjectInputStream.readObject(Unknown Source)
        at java.util.ArrayList.readObject(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)

The fact that it happens regardless of where the data is stored makes me think it is the data, but doing a manual examination of all of the data (which thankfully is only about 200 - 500 rows in 4 tables), it wasn't that bad.

So, I'm here looking for suggestions as to what the underlying cause might be. To recap, it doesn't matter if I build with 32 or 64 bit jdk, the only thing that matters is what jvm I use. A 32 bit jvm always crashes reading the same data; even when running on a 64 bit OS. Stack overflows usually point to some type of run-away recursion, but there is nothing like that in the code. The database fetch is a simple "select * from..." and the deserialization of the data from a file is a straight read from an ObjectInputBuffer into a ArrayList<>. Thanks for any help.

Sorry, forgot some code - Here is the file deserialization:

        try (FileInputStream fin = new FileInputStream(home.toString() + "/products.ser"); ObjectInputStream oin = new ObjectInputStream(fin)) {
            logger.info("Entering read archive products");
            ArrayList<Product> aInputList = (ArrayList<Product>) oin.readObject();
            if (pricingProductTableList == null) {
                pricingProductTableList = FXCollections.observableArrayList(aInputList);
            } else {
                pricingProductTableList.clear();
                pricingProductTable.getItems().clear();
                pricingProductTableList.addAll(aInputList);
            }
            pricingProductTable.getItems().setAll(pricingProductTableList);
            oin.close();
            fin.close();
        } catch (Exception ex) {
            DialogFX error = new DialogFX(DialogFX.Type.ERROR);
            error.setMessage("Invalid Selection " + ex.getMessage());
            error.showDialog();
            return;
        }
        try (FileInputStream fin = new FileInputStream(home.toString() + "/chemicals.ser"); ObjectInputStream oin = new ObjectInputStream(fin)) {
            ArrayList<Chemical> aInputList = (ArrayList<Chemical>) oin.readObject();
            logger.info("Entering read archive chemicals");
            if (pricingChemicalTableList == null) {
                pricingChemicalTableList = FXCollections.observableArrayList(aInputList);
            } else {
                pricingChemicalTableList.clear();
                pricingChemicalTable.getItems().clear();
                pricingChemicalTableList.addAll(aInputList);
            }
            pricingChemicalTable.getItems().setAll(pricingChemicalTableList);
            oin.close();
            fin.close();
        } catch (Exception ex) {
            DialogFX error = new DialogFX(DialogFX.Type.ERROR);
            error.setMessage("Invalid Selection " + ex.getMessage());
            error.showDialog();
            return;
        }
        try (FileInputStream fin = new FileInputStream(home.toString() + "/adhesives.ser"); ObjectInputStream oin = new ObjectInputStream(fin)) {
            ArrayList<Adhesive> aInputList = (ArrayList<Adhesive>) oin.readObject();
            logger.info("Entering read archive adhesives");
            if (pricingAdhesiveTableList == null) {
                pricingAdhesiveTableList = FXCollections.observableArrayList(aInputList);
            } else {
                pricingAdhesiveTableList.clear();
                pricingAdhesiveTable.getItems().clear();
                pricingAdhesiveTableList.addAll(aInputList);
            }
            pricingAdhesiveTable.getItems().setAll(pricingAdhesiveTableList);
            oin.close();
            fin.close();
        } catch (Exception ex) {
            DialogFX error = new DialogFX(DialogFX.Type.ERROR);
            error.setMessage("Invalid Selection " + ex.getMessage());
            error.showDialog();
            return;
        }
        try (FileInputStream fin = new FileInputStream(home.toString() + "/materials.ser"); ObjectInputStream oin = new ObjectInputStream(fin)) {
            ArrayList<Material> aInputList = (ArrayList<Material>) oin.readObject();
            logger.info("Entering read archive materials");
            if (pricingMaterialTableList == null) {
                pricingMaterialTableList = FXCollections.observableArrayList(aInputList);
            } else {
                pricingMaterialTableList.clear();
                pricingMaterialTable.getItems().clear();
                pricingMaterialTableList.addAll(aInputList);
            }
            pricingMaterialTable.getItems().setAll(pricingMaterialTableList);
            oin.close();
            fin.close();
        } catch (Exception ex) {
            DialogFX error = new DialogFX(DialogFX.Type.ERROR);
            error.setMessage("Invalid Selection " + ex.getMessage());
            error.showDialog();
            return;
        }

All of the database fetches look like this:

private ObservableList<Product> getProductList() {
    logger.info("Entering {}.getProductList", this.getClass().getName());
    if (costingService == null) {
        return null;
    }
    final Task<ObservableList> loadProductTask = new Task<ObservableList>() {
        @Override
        protected ObservableList call() throws Exception {
            return FXCollections.observableList(costingService.listProducts());
        }
    };

    loadProductTask.stateProperty().addListener(new ChangeListener<Worker.State>() {
        @Override
        public void changed(ObservableValue<? extends Worker.State> source, Worker.State oldState, Worker.State newState) {
            if (newState.equals(Worker.State.SUCCEEDED)) {
                if (pricingProductTableList != null && !pricingProductTableList.isEmpty()) {  // moved here from beginning of method, now table doesn't redraw
                    pricingProductTableList.clear();
                }
                pricingProductTableList = loadProductTask.getValue();
                pricingProductTable.getItems().setAll(pricingProductTableList);
                if (tempProduct != null) {
                    Platform.runLater(new Runnable() {
                        @Override
                        public void run() {
                            int index = pricingProductTableList.indexOf(tempProduct);
                            pricingProductTable.getSelectionModel().select(index);
                            pricingProductTable.requestFocus();
                            pricingProductTable.scrollTo(index);
                        }
                    });
                }
            } else if (newState.equals(Worker.State.FAILED)) {
                loadProductTask.getException().printStackTrace();
            }
        }
    });

    new Thread(loadProductTask).start();

    return pricingProductTableList;
}

The Product Entity class (which is basically the same as all of the persisted classes):

@Entity
@Table(name = "Product")
@NamedQueries({
    @NamedQuery(name = "Product.findAll", query = "SELECT p FROM Product p order by p.pr    oduct"),
    @NamedQuery(name = "Product.findById", query = "SELECT p FROM Product p WHERE p.id =     :id"),

    @NamedQuery(name = "Product.findByProduct", query = "SELECT p FROM Product p WHERE     p.product = :product order by p.product"),
    @NamedQuery(name = "Product.findBySelected", query = "SELECT p FROM Product p WHERE     p.selected = :selected"),
    @NamedQuery(name = "Product.findBySubtotal", query = "SELECT p FROM Product p WHERE     p.subtotal = :subtotal"),
    @NamedQuery(name = "Product.findBySellingPrice", query = "SELECT p FROM Product p     WHERE p.sellingPrice = :sellingPrice"),
    @NamedQuery(name = "Product.findByWaste", query = "SELECT p FROM Product p WHERE     p.waste = :waste")})

public class Product implements Serializable {
private static final long serialVersionUID = -6259908469382195499L;
private Long id;
private String pCost;
private String product;
private String selected;
private String subtotal;
private String tCost;
private String wCost;
private String sellingPrice;
private String waste;
private String wipCost;
private String finishedCost;
private Boolean inactive;
private String updateUser;
private Date creationDate;
private Date updateDate;
private List<AdhesiveComponent> adhesiveComponentList;
private List<MaterialComponent> materialComponentList;
private List<MachineHour> machineHourList;

public Product() {
    this.creationDate = new Date();
}

public Product(Long id) {
    this.id = id;
}

public Product(Long id, String product) {
    this.creationDate = new Date();
    this.id = id;
    this.product = product;
}

public Product(Product product) {
    this.creationDate = new Date();
    this.pCost = product.getPCost();
    this.product = product.getProduct() + "_COPY";
    this.subtotal = product.getSubtotal();
    this.waste = product.getWaste();
    this.wCost = product.getWCost();
    this.sellingPrice = product.getSellingPrice();
    this.selected = product.getSelected();
    this.inactive = product.getInactive();
    this.tCost = product.getTCost();
    this.wipCost = product.getWipCost();
    this.finishedCost = product.getFinishedCost();
}

public Product(String pCost, String product, String selected, String subtotal, String tCost, String wCost, String sellingPrice, String waste,
        String wipCost, String finishedCost, Boolean inactive) {
    this.creationDate = new Date();
    this.pCost = pCost;
    this.product = product;
    this.selected = selected;
    this.subtotal = subtotal;
    this.tCost = tCost;
    this.wCost = wCost;
    this.sellingPrice = sellingPrice;
    this.waste = waste;
    this.wipCost = wipCost;
    this.finishedCost = finishedCost;
    this.inactive = inactive;
}

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Basic(optional = false)
@Column(name = "id")
public Long getId() {
    return id;
}

public void setId(Long id) {
    this.id = id;
}

@Column(name = "pcost", length=12)
public String getPCost() {
    return pCost;
}

public void setPCost(String pCost) {
    this.pCost = pCost;
}

@Basic(optional = false)
@Column(name = "product", unique = true)
public String getProduct() {
    return product;
}

public void setProduct(String product) {
    this.product = product;
}

@Column(name = "selected")
public String getSelected() {
    return selected;
}

public void setSelected(String selected) {
    this.selected = selected;
}

@Column(name = "subtotal", length=12)
public String getSubtotal() {
    return subtotal;
}

public void setSubtotal(String subtotal) {
    this.subtotal = subtotal;
}

@Column(name = "tcost", length=12)
public String getTCost() {
    return tCost;
}

public void setTCost(String tCost) {
    this.tCost = tCost;
}

@Column(name = "wcost", length=12)
public String getWCost() {
    return wCost;
}

public void setWCost(String wCost) {
    this.wCost = wCost;
}


@Column(name="selling_price", length=12)
public String getSellingPrice() {
    return sellingPrice;
}

public void setSellingPrice(String sellingPrice) {
    this.sellingPrice = sellingPrice;
}

@Column(name = "waste", length=12)
public String getWaste() {
    return waste;
}

public void setWaste(String waste) {
    this.waste = waste;
}

@Column(name = "wib_cost", length = 12)
public String getWipCost() {
    return wipCost;
}

public void setWipCost(String wipCost) {
    this.wipCost = wipCost;
}

@Column(name = "finished_cost", length = 12)
public String getFinishedCost() {
    return finishedCost;
}

public void setFinishedCost(String finishedCost) {
    this.finishedCost = finishedCost;
}

@Basic(optional=false)
@Column(name= "inactive")
public Boolean getInactive() {
    return inactive;
}

public void setInactive(Boolean inactive) {
    this.inactive = inactive;
}

@Column(name = "update_user", length = 4)
public String getUpdateUser() {
    return updateUser;
}

public void setUpdateUser(String updateUser) {
    this.updateUser = updateUser;
}

@Temporal(TemporalType.TIMESTAMP)
@Column(name = "creation_date")
public Date getCreationDate() {
    return creationDate;
}

public void setCreationDate(Date creationDate) {
    this.creationDate = creationDate;
}

@Temporal(TemporalType.TIMESTAMP)
@Column(name = "update_date")
public Date getUpdateDate() {
    return updateDate;
}

public void setUpdateDate(Date updateDate) {
    this.updateDate = updateDate;
}

@OneToMany(mappedBy="product", cascade={CascadeType.ALL}, targetEntity=AdhesiveComponent.class, orphanRemoval = true)
@LazyCollection(LazyCollectionOption.FALSE)
public List<AdhesiveComponent> getAdhesiveComponentList() {
    return adhesiveComponentList;
}

public void setAdhesiveComponentList(List<AdhesiveComponent> adhesiveComponentSet) {
    this.adhesiveComponentList = adhesiveComponentSet;
}

@OneToMany(mappedBy="product", cascade={CascadeType.ALL}, targetEntity=MaterialComponent.class, orphanRemoval = true)
@LazyCollection(LazyCollectionOption.FALSE)
public List<MaterialComponent> getMaterialComponentList() {
    return materialComponentList;
}

public void setMaterialComponentList(List<MaterialComponent> materialComponentList) {
    this.materialComponentList = materialComponentList;
}

@OneToMany(mappedBy="testProduct", cascade={CascadeType.MERGE, CascadeType.REFRESH, CascadeType.REMOVE}, targetEntity=MachineHour.class, orphanRemoval = true)
@LazyCollection(LazyCollectionOption.FALSE)
public List<MachineHour> getMachineHourList() {
    return machineHourList;
}

public void setMachineHourList(List<MachineHour> machineHourList) {
    this.machineHourList = machineHourList;
}

public String returnUpdateDate() {
    if (this.getUpdateDate() != null) {
        return (new SimpleDateFormat("MM/dd/yyyy").format(this.getUpdateDate()));
    } else {
        return "";
    }
}

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

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

@Override
public String toString() {
    return "Product{" + "id=" + id + ", pCost=" + pCost + ", product=" + product + ", selected=" + selected
            + ", subtotal=" + subtotal + ", tCost=" + tCost + ", wCost=" + wCost
            + ", sellingPrice=" + sellingPrice + ", waste=" + waste
            + ", wibCost=" + wipCost + ", finishedCost=" + finishedCost + ", inactive=" + inactive + ", created=" + creationDate
            + ", updated=" + updateDate + '}';
}

}

Was it helpful?

Solution

There is no such thing as a "32-bit jar". All pure java-files are (meant to be) independent of the architecture they are built on - that's what "write once run anywhere" is all about. The difference between 32 and 64 bit depends only on the VM running the code.

If you didn't adjust your stack-size explicitly a 32bit-Vm is much more likely to run into a StackOverflowError since it's default stack-size per thread is much smaller (see here):

In Java SE 6, the default on Sparc is 512k in the 32-bit VM, and 1024k in the 64-bit VM. On x86 Solaris/Linux it is 320k in the 32-bit VM and 1024k in the 64-bit VM.

On Windows, the default thread stack size is read from the binary (java.exe). As of Java SE 6, this value is 320k in the 32-bit VM and 1024k in the 64-bit VM.

You can see in the exceptions stacktrace, that the call-hierarchy is pretty deep since you seem to be deserializing a complex object-tree and the 320k-stack doesn't seem to be able to handle this. To solve your problem you could try setting the -Xss-parameter to a higher value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top