[英]StackOverflowException on 32bit java - not 64bit
I have written a desktop application which is JavaFX based, developed on NetBeans 7.4. 我编写了一个基于JavaFX的桌面应用程序,该应用程序是在NetBeans 7.4上开发的。 I'm using Glassfish to pool jdbc connections and JMS traffic. 我正在使用Glassfish来池化jdbc连接和JMS通信。 Development is on a Win 7 64bit system, using 64bit java 1.7_51. 使用64位Java 1.7_51在Win 7 64位系统上进行开发。 One of my users has a 32bit win 7 machine, and the application refuses to run correctly on his machine. 我的一个用户拥有一台32位win 7计算机,该应用程序拒绝在其计算机上正确运行。 There are actually 2 glassfish servers, each providing data connectivity from a different logical company. 实际上有2个glassfish服务器,每个服务器都提供来自不同逻辑公司的数据连接。 All of the server code on the two glassfish servers is built from the same code base. 两个glassfish服务器上的所有服务器代码均基于相同的代码库构建。 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. 在32位Java上运行的应用程序从其中一台服务器读取数据时,却从另一台服务器读取数据时,出现StackOverflowException异常,因此我认为这与服务器的部署有关。 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. 同样,这仅在Java的32位版本中。 I have rebuilt the application using a 32bit java jdk, and the error persists. 我已经使用32位Java jdk重建了应用程序,错误仍然存在。 Running the 32bit jar on a 64bit java jvm does not have a problem. 在64位Java jvm上运行32位jar不会出现问题。 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. 无论数据存储在什么地方,它都会发生,这让我觉得它是数据,但是对所有数据进行手动检查(幸运的是,在4个表中只有大约200-500行),这不是事实。坏。
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. 回顾一下,无论我使用32位还是64位的jdk构建都没有关系,唯一重要的是我使用的是什么jvm。 A 32 bit jvm always crashes reading the same data; 一个32位的jvm总是会崩溃,无法读取相同的数据。 even when running on a 64 bit OS. 即使在64位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<>. 数据库获取是一个简单的“ select * from ...”,而来自文件的数据反序列化是从ObjectInputBuffer直接读取到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 + '}';
}
} }
There is no such thing as a "32-bit jar". 没有“ 32位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. 所有纯Java文件都(独立于)独立于它们所建立的体系结构-这就是“在任何地方写入一次即可运行”的全部内容。 The difference between 32 and 64 bit depends only on the VM running the code. 32位和64位之间的差异仅取决于运行代码的VM。
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 ): 如果您未明确调整堆栈大小,则32bit-Vm更有可能遇到StackOverflowError
因为每个线程的默认堆栈大小要小得多(请参见此处 ):
In Java SE 6, the default on Sparc is 512k in the 32-bit VM, and 1024k in the 64-bit VM. 在Java SE 6中,Sparc的默认值在32位VM中为512k,在64位VM中为1024k。 On x86 Solaris/Linux it is 320k in the 32-bit VM and 1024k in the 64-bit VM. 在x86 Solaris / Linux上,在32位VM中为320k,在64位VM中为1024k。
On Windows, the default thread stack size is read from the binary (java.exe). 在Windows上,默认线程堆栈大小是从二进制文件(java.exe)中读取的。 As of Java SE 6, this value is 320k in the 32-bit VM and 1024k in the 64-bit VM. 从Java SE 6开始,此值在32位VM中为320k,在64位VM中为1024k。
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. 您可以在异常堆栈跟踪中看到,调用层次结构非常深,因为您似乎要反序列化复杂的对象树,而320k堆栈似乎无法处理该问题。 To solve your problem you could try setting the -Xss-parameter to a higher value. 要解决您的问题,您可以尝试将-Xss-parameter设置为更高的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.