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?
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.xmlfile: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.