String is immutable whereas StringBuffer and StringBuilder can change their values.

The only difference between StringBuffer and StringBuilder is that StringBuilder is unsynchronized whereas StringBuffer is synchronized. So when the application needs to be run only in a single thread then it is better to use StringBuilder. StringBuilder is more efficient than StringBuffer.

Criteria to choose among String, StringBuffer and StringBuilder

1. If your text is not going to change use a string Class because a String object is immutable.
2. If your text can change and will only be accessed from a single thread, use a StringBuilder because StringBuilder is unsynchronized.http://www.blogger.com/img/blank.gif
3. If your text can changes, and will be accessed from multiple threads, use a StringBuffer because StringBuffer is synchronous.

Ref : link 1


link 2

link 3

Mismatched serialization UIDs

Caused by: org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge :
Mismatched serialization UIDs :
Source (RepId RMI:com.model.HAHAResult:1335A78CB1E6EDB7:690F13781C0374C1) = 690F13781C0374C1 whereas
Target (RepId RMI:com.model.HAHAResult:359C570FBD100732:584576386E6E2CBD) = 584576386E6E2CBD vmcid: IBM minor code: 896 completed: No


ปัญหาเกิดจาก com.model.HAHAResult ไม่ได้ประกาศ serialVersionUID ทำให้เรียก Object ผ่าน RMI
มีปัญหาฟ้องว่า uid ต้นทางกับ ปลายทางไม่ตรงกัน ดูข้อมูลได้จาก entry เรื่องของ Serializable

วิธีแก้ที่คือ ถ้าสร้าง class แล้ว implements java.io.Serializable ต้องสร้าง serialVersionUID เสมอ
พอเพิ่มแล้ว compile class ใหม่ก็ใช้ได้แล้ว

แต่เนื่องจาก class ตัวนี้ เป็น ejb (แล้วยังไง compile ใหม่ก็เสร็จ) แล้วมีการนำ ejb client ไปใช้ที่ระบบอื่นด้วย
ทำให้ถ้า gen client ใหม่ ก็ต้องส่งให้ระบบอื่นด้วยจะทำยังไงแค่แก้ฝั่ง ejb โดยไม่กระทบ client

เลยคิดว่า งั้นก็ สร้าง serialVersionUID ที่มีค่า uid เหมือนกับ ตัวแปล ที่ client
แต่เราจะรู้ค่า uid ที่อยู่ใน jvm ได้ยังไง
จากที่หาข้อมูลมาที่ http://download.oracle.com/javase/6/docs/platform/serialization/spec/class.html (บอกวิธีคำนวน uid ด้วย)

ทำให้รู้จัก ObjectStreamClass จะมี method getSerialVersionUID


String name = "com.model.HAHAResult";
Class c = Class.forName(name);

ObjectStreamClass oc = ObjectStreamClass.lookup( c );
long uid = oc.getSerialVersionUID();


เราก็จะได้ ค่า uid ของ class ที่ต้องการแล้ว

แต่ทั้งนี้ทั้งนั้น Entry นี้จะไม่เกิด ถ้าสร้าง class แล้ว implements java.io.Serializable ต้องสร้าง serialVersionUID เสมอ

The command line length depends on the OS:

Windows NT, the command line is limited to 256 characters.
Windows 2000, the command line is limited to 2046 characters.
Windows XP, the command line is limited to 8190 characters.

For all OS's NTFS and FAT allows pathnames of up to 260 characters.

If you're not reaching any of these limits with your command line, then maybe telnet has it's own input limit. In which case you may want to break up your input line with a continuation character, which I think is "\" at the end of the line.

unix ,This is in the /usr/include/limits.h file
ex.the limit there is _POSIX_PATH_MAX = 255 per file name.
_POSIX_MAX_INPUT : Maximum number of bytes allowed in a terminal input queue. Value: 255

link : description for limits.h
top