此 Java 异常的原因是什么'java.lang.ArrayIndexOutOfBoundsException?'



我在项目中使用comm.jar从com端口读取数据,但当我侦听并等待来自com端口的任何数据时,此异常。。。。。。

Exception in thread "Win32SerialPort Notification thread" java.lang.ExceptionInInitializerError
        at getsmsf1.IncomingSms.<init>(IncomingSms.java:160)
        at getsmsf1.Sms.lineReceived(Sms.java:563)
        at getsmsf1.Sms.serialEvent(Sms.java:463)
        at com.sun.comm.Win32SerialPort.sendDataAvailEvent(Win32SerialPort.java:649)
        at com.sun.comm.NotificationThread.run(Win32SerialPort.java:878)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 65533
        at getsmsf1.PduCodec.<clinit>(PduCodec.java:299)
        ... 5 more
java.lang.ArrayIndexOutOfBoundsException: 65533

似乎是根本原因。您似乎正在尝试索引65533,它超出了范围。

Win32SerialPort Notification thread 

只是发生此异常的线程名称。

相关内容

最新更新