Glassfish 3.1 远程独立(应用程序)客户端
您好,我正在尝试在 Glassfish 3.1 服务器上运行远程独立应用程序客户端。
这个问题很奇怪,我花了很多时间试图找到这个:
我设置了以下iiop
属性:
public static InitialContext setProps4Connect() {
Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("java.naming.factory.url.pkgs","com.sun.enterprise.naming");
props.setProperty("java.naming.factory.state","com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
props.setProperty("org.omg.CORBA.ORBInitialHost", "192.168.0.81");
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
try {
InitialContext ic = new InitialContext(props);
return ic;
} catch (Exception re) {
DialogFinancial("soel.utils.setProps4Connect() InitialContext. Σφάλμα κατά τον ορισμό των παραμέτρων!", re.toString(), 2, -1);
return null;
}
}
我使用以下代码更新了参数“SOM”的一条记录“
:
String ID = "SOM";
try {
Parameters parameters = parametersFacade.find(ID);
if(parameters==null){
throw new Exception("searched protocol not found");
}
parameters.setDescriptionel(jTextFieldDescription_EL.getText());
parameters.setDescriptionen(jTextFieldDescription_EN.getText());
//****************************************************************//
//update.setType(jComboBoxType.getSelectedItem().toString());
parameters.setFuse(jTextFieldFUse.getText());
parameters.setComments(jTextAreaComments.getText());
parametersFacade.edit(parameters);
当我执行远程客户端时,在 server.log
文件中,我收到一条错误消息:
查询:InsertObjectQuery(iesoel.remote.entity.Parametersdetails[parametersdetailsPK=null ])
现在开始发生奇怪的事情。我尝试从 parameters
获取一个字段:
System.out.println(parameters.setDescriptionel());
这很好用。现在,如果我将属性从: 更改
props.setProperty("org.omg.CORBA.ORBInitialHost", "192.168.0.81");
为
props.setProperty("org.omg.CORBA.ORBInitialHost", "www1");
那么一切工作正常。
请注意,此问题仅出现在 GlassFish 3.1 上,而不出现在 GlassFish 3.0.1 上。所以如果我理解的话,这不是网络问题。有什么想法吗?
Hi I am trying to run a remote standalone application client on Glassfish 3.1 server.
The problem is very strange and I have spent a lot of time trying to find this:
I have set the following iiop
properties:
public static InitialContext setProps4Connect() {
Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("java.naming.factory.url.pkgs","com.sun.enterprise.naming");
props.setProperty("java.naming.factory.state","com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
props.setProperty("org.omg.CORBA.ORBInitialHost", "192.168.0.81");
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
try {
InitialContext ic = new InitialContext(props);
return ic;
} catch (Exception re) {
DialogFinancial("soel.utils.setProps4Connect() InitialContext. Σφάλμα κατά τον ορισμό των παραμέτρων!", re.toString(), 2, -1);
return null;
}
}
I used the following code to update one record of the parameter "SOM"
:
String ID = "SOM";
try {
Parameters parameters = parametersFacade.find(ID);
if(parameters==null){
throw new Exception("searched protocol not found");
}
parameters.setDescriptionel(jTextFieldDescription_EL.getText());
parameters.setDescriptionen(jTextFieldDescription_EN.getText());
//****************************************************************//
//update.setType(jComboBoxType.getSelectedItem().toString());
parameters.setFuse(jTextFieldFUse.getText());
parameters.setComments(jTextAreaComments.getText());
parametersFacade.edit(parameters);
When I execute my remote client, in the server.log
file I get an error that says:
Query: InsertObjectQuery(iesoel.remote.entity.Parametersdetails[ parametersdetailsPK=null ])
And now starts the strange things. I try to get a field from parameters
:
System.out.println(parameters.setDescriptionel());
This works fine. Now if I change the property from:
props.setProperty("org.omg.CORBA.ORBInitialHost", "192.168.0.81");
to
props.setProperty("org.omg.CORBA.ORBInitialHost", "www1");
Then everything is working fine.
Please note this problem is only on GlassFish 3.1 not on GlassFish 3.0.1. So if I understand, this is not a network problem. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
搜索解决方案后,我找到了以下包含解决方案的链接: http://web.archiveorange.com /archive/v/N2KaoS4G06nDbgqxPmzu
我将以下内容添加到
persistence.xml
文件中:我删除了
条目,现在它工作正常。请注意,该问题仅存在于 Glassfish 3.1 中,而不存在于 GlassFish 3.0.1 中。我认为这是一个错误。
After searching for solutions, I found the following link with a solution: http://web.archiveorange.com/archive/v/N2KaoS4G06nDbgqxPmzu
I added the following to the
persistence.xml
file:I deleted the
<properties/>
entry, and it now is working fine.Please note, the problem is only with Glassfish 3.1 and not with GlassFish 3.0.1. I think it's a bug.