We are facing an issue regarding the properties file. We have a property file "ExceptionMessages_en_EX.properties" which contains list of exceptions
p4154=User not terminated. Please select terminated user.
This property file is placed in IBM\WebSphere\AppServer\properties.
Here the senerio is that we got one situation that, the application should check whether the user is terminated or not.
If user is not terminated then we are calling user defined exception using throw. in this method we connecting to "ExceptionMessages_en_EX.properties" and fetching the error message and alterting at JSP level.
But the issue is that while trying yo connect to property file we are getting below message
Rob Spoor wrote:You, or Websphere, is trying to send a RandomAccessFile object across the network. That's not going to work, since that class does not implement Serializable. Can you perhaps use a java.util.Properties object instead? You fill it from the existing file, but a Properties object is serializable and will therefore not cause the same problem.
We are not sending any RandomAccessFile object across the network. How can a Websphere send this RandomAccessFile (because i am working first time on websphere). Can you please elaborate please.
Joined: Jan 25, 2012
At last we resolve the problem
int above code, EElixirException class is trying to create an instance of Logger through getInsatnce method.
if we declare static as below in EElixirException class then we are not getting any problem otherwise its showing unable to serialize.
You were trying to serialize EElixirException, which contains a Logger object. That means that if you serialize an EElixirException object, it will also try to serialize the Logger object that the EElixirException is referring to, and all objects that are referred to by the Logger, etc. Logger probably somewhere has a RandomAccessFile, which isn't Serializable.
You most likely don't want to serialize the Logger, so you could make it static or transient.