Help coderanch get a
new server
by contributing to the fundraiser

mupparaju srinivasa rao

Greenhorn
+ Follow
since Apr 16, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by mupparaju srinivasa rao

Hi,

Java Client application is having Swing and AWT components.The client application is running on operating system windows-2000 Japanees, Pentium-3 machine with JRE 1.3.0 environment.It is working normally for past one year.The same application is installed on operating system windows-2000 Japanees,Pentium-4 processor with JRE 1.3.0. environment.The application is hanged up after working for few hours.The CPU usage on client machine is showing 100%.The pentium-3 machine is still running.Both are connected to same server.The sound filter is used play sound when ever new or updated data is received by the client machine.The sound filter is configured on both client machines.The difference in both the machines is processors(pentium-3,pentium-4).Please help me if you faced this problem.

Thanks in advance,
MSR
18 years ago
Hi,

There are two applications.The communication between the two application is through socket.
The code that is writing on the socket is as follows:

public boolean sendAlarmWithSize(int size_, String alarm_) throws Exception
{
_dataOutputStream.writeShort(size_);
_dataOutputStream.writeUTF(alarm_);
return true;
}
After writing on the socket i put the print statement in writeShort method of API.It is printing the size_ correct.

At the receiving end for reading from the socket the following code is used:

private Payload readMessages(InputStream in)
throws IOException, java.text.ParseException, InvalidMessageFormat {
PropertyList prop = new PropertyList();
String propertyStr, contentType = null, action = null;
Object obj;
DataInputStream dataStream = new DataInputStream(in);
int numAlarms = dataStream.readShort();
CircuitMessage[] circuitAlarms = new CircuitMessage[numAlarms];
for (int i = 0; i < numAlarms; i++) {
propertyStr = dataStream.readUTF();
if (Logger.DEBUG && myDebug != null) {
myDebug.out(5,"Message Received - " + propertyStr);
}
obj = prop.objectFrom(propertyStr);
if (obj instanceof java.util.Hashtable) {
java.util.Hashtable hash = (java.util.Hashtable)obj;
contentType = (String) hash.get("<content-type>");
action = (String) hash.get("<action-type>");
obj = mssgFactory.digest(hash);
if (obj instanceof CircuitMessage) {
circuitAlarms[i] = (CircuitMessage) obj;
}
} else {
// skip this message because I don't recognize it.
System.out.println(obj);
}
}
Payload payload = new Payload();
payload.payload = circuitAlarms;
payload.contentType = contentType;
payload.action = action;
return payload;
}

In the above code after reading from the stream using readShort() the value is different than the one we wrote on the stream.At the same time readUTF() is throwing UTFDataformat exception. I hope some one can help me .

Thanks in advance,

MSR
18 years ago
Hi,
Thank you for reply.
I am always writing 1 in writeShort method.When the problem occured at reading side the readShort is returning 1280(which it should be one).Even in this case while reading the first string using readUTF it is throwing UTFDataFormatException.
Earlier the writing alarms on socket application was in Object C language and reading from socket application is in java 1.4.0.
Now after converting Writing alarm application also into java tis problem is occuring.

regards,
MSR
19 years ago
Hi,

I am having two applications.In one application,one thread writes the data on the socket using writeUTF() method and in other application another thread reads the data using readUTF method.The readUTF method is throwing UTFDataFormat exception very frequently(after reading~100 alarms data).If i run the 2 applications on two different machines th UTFDataFormat exception is thrown(after reading ~1500 alarms data).The jdk version is 1.4.0.
The reading thread:
public void run() {
private Payload readMessages(InputStream in)
throws IOException, java.text.ParseException, InvalidMessageFormat {
PropertyList prop = new PropertyList();
String propertyStr, contentType = null, action = null;
Object obj;
DataInputStream dataStream = new DataInputStream(in);
int numAlarms = dataStream.readShort();
CircuitMessage[] circuitAlarms = new CircuitMessage[numAlarms];

for (int i = 0; i < numAlarms; i++) {


propertyStr = dataStream.readUTF();
if (Logger.DEBUG && myDebug != null) {
myDebug.out(5,"Message Received - " + propertyStr);
}
}



The writting thread is:
public void run(){
public boolean sendAlarmWithSize(int size_, String alarm_) throws Exception
{
try
{
Logger.log(Logger.Normal, "SocketUtilities sendAlarmWith Size= "+size_);
Logger.log(Logger.Normal, "SocketUtilities sendAlarmWith alarm_= "+alarm_);
//_dataOutputStream.flush();
_dataOutputStream.writeShort(size_);
TotalAlarmsSendSofar++;
Logger.log(Logger.Error, "SocketUtilities sendAlarmWith alarm???,TotalAlarmsSendSofar = "+TotalAlarmsSendSofar);
_dataOutputStream.writeUTF(alarm_);
return true;
}catch(UTFDataFormatException utf)
{
Logger.log(Logger.Error, "SocketUtilities sendAlarmWith utf.toString() "+utf.toString());
return false;
}

catch(IOException ie)
{Logger.log(Logger.Error, "SocketUtilities sendAlarmWith ie.toString() "+ie.toString());
return false;
}
}


I pasted a part of code.

Please help me.

regards,
MSR
19 years ago
Hi,

I am having the scenario in which Iam having a method getSessionStatus()in RemoteSystemManagerInterface with no arguments.When this is compiled in j2sdk 1.4.2 and running in server environment having jre 1.3.1 it is working fine.If i change the server environment to j2sdk 1.4.2_05 it is throwing unmarshalling return; nested exception is: java.io.OptionalDataException from the stub. The Stack Trace is given below




java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.OptionalDataException
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164)
at com.orillion.webcast.system.RemoteSystemManagerImpl_Stub.getSessionStatus(RemoteSystemManagerImpl_Stub.java:1121)
at com.orillion.webcast.RemoteConnectionListener.run(RemoteConnectionListener.java:43)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.OptionalDataException
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1294)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at java.util.LinkedList.readObject(LinkedList.java:706)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:297)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:146)
... 3 more


Help me please.

regards,
MSR
19 years ago
Hi,

I am having the scenario in which Iam having a method getSessionStatus()in RemoteSystemManagerInterface with no arguments.When this is compiled in j1sdk 1.4.2 and running in server having jre 1.3.1 it is working fine.If i change the server environment to j2sdk 1.4.2_05 it is throwing unmarshalling return; nested exception is: java.io.OptionalDataException from the stub. Help me please.The Stack Trace is given below




java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.OptionalDataException
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:164)
at com.orillion.webcast.system.RemoteSystemManagerImpl_Stub.getSessionStatus(RemoteSystemManagerImpl_Stub.java:1121)
at com.orillion.webcast.RemoteConnectionListener.run(RemoteConnectionListener.java:43)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.OptionalDataException
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1294)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at java.util.LinkedList.readObject(LinkedList.java:706)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:297)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:146)
... 3 more

regards,
MSR
[ February 21, 2005: Message edited by: mupparaju srinivasa rao ]
19 years ago
Hi,

I got an exception while reading data from server.I am using swing client and rmi.I am using IPlanet web server and servlets.Jdk version is 1.4.2_05

The exception is given below:
error unmarshalling return; nested exception is:
java.io.OptionalDataException.

Could any one explain.

I am attaching the folloowing code
The following method is from RemoteListener class
public void run() {
Vector sessions = null;
boolean conn = true;
try {
while (conn) {
sessions = remoteSystemManager.getSessionStatus();
for (int i = 0; i < sessions.size(); i++) {
SessionEvent evt = (SessionEvent) sessions.elementAt(i);
switch (evt.getEventType()) {
case SessionEvent.ADD :
mf.sessionAdded(evt);
break;
case SessionEvent.REMOVE :
mf.sessionRemoved(evt);
break;
case SessionEvent.EXPIRE :
mf.sessionExpired(evt);
break;
default :
break;
}
}
Thread.sleep(sleepTime);
}
} catch (java.rmi.RemoteException re) {
re.printStackTrace(System.err);
mf.alertDisconnection();
conn = false;
} catch (Exception e) {
}
}
}



The getSessionStatus method calls the beloe method which is from RemoteSystemimpl_stub class which is given below.



public java.util.Vector getSessionStatus()
throws java.rmi.RemoteException
{

try {
if (useNewInvoke) {

Object $result = ref.invoke(this, $method_getSessionStatus_22, null, 5332006586607892842L);
return ((java.util.Vector) $result);
} else {
java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 22, interfaceHash);
ref.invoke(call);
java.util.Vector $result;
try {

java.io.ObjectInput in = call.getInputStream();
$result = (java.util.Vector) in.readObject();
for (int i = 0; i < $result.size(); i++) {
SessionEvent evt = (SessionEvent) $result.elementAt(i);

} catch (java.io.IOException e) {
throw new java.rmi.UnmarshalException("In stub error unmarshalling return,getSessionStatus()", e);
} catch (java.lang.ClassNotFoundException e) {
throw new java.rmi.UnmarshalException("error unmarshalling return", e);
} finally {
ref.done(call);
}
return $result;
}
} catch (java.lang.RuntimeException e) {
throw e;
} catch (java.rmi.RemoteException e) {
throw e;
} catch (java.lang.Exception e) {
throw new java.rmi.UnexpectedException("undeclared checked exception", e);
}
}

In the above code the invoke method is throwing exception.








when i am deleting the user and reconnecting the same user automatically the administrator application is throwing the following message and getting disconnected.
When the application is running it is throughing the following exception
Fri, 11 Feb 2005 11:19:42 GMT+05:30 - RemoteConnectionListener java.rmi.RemoteException re)error unmarshalling return; nested exception is: java.io.OptionalDataException
Thanks,

[ February 13, 2005: Message edited by: mupparaju srinivasa rao ]

[ February 14, 2005: Message edited by: mupparaju srinivasa rao ]

[ February 15, 2005: Message edited by: mupparaju srinivasa rao ]
[ February 15, 2005: Message edited by: mupparaju srinivasa rao ]
19 years ago
I am using IPlanet 4.1 webserver,how to get the garbage collection information/data i.e when the garbage collection took place,how many objects are garbage collected..

regards,
MSR
19 years ago
I am using IPlanet 4.1 webserver.I set the verbosemode=1,in jvm12.conf.The Garbage collector information is still not available.
19 years ago