I am working on a existing Java EE based application .
Somehow the functionality is not working written by them .
When i found out the logs in Linux server i found out this Exception there
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at com.cyber.EasyOptions.view(EasyOptions.java:2054)
What does this mean exactly ??
I guess there is a class named EasyOptions and in that there is a method view and inside it there is this Exception occuring ??
This particular class EasyOptions is present inside a jar file in our code .
I am using JD-GUI decompiler and when navigated to this particualr jar , and saw this class EasyOptions , inside view method there is no such line (2054)
so dont know we can match the line numbers this way or not ??
I guess we cant match line numbers this way , my questions how can we trace out the exact line of error ??
guess there is a class named EasyOptions and in that there is a method view and inside it there is this Exception occuring ??
That's correct.
I am using JD-GUI decompiler and when navigated to this particualr jar , and saw this class EasyOptions , inside view method there is no such line (2054)
The line number only makes sense in the context of the original source code. The decompiled code isn't identical to the original and will have different line numbering.
how can we trace out the exact line of error
Without the original source code it's going to be tricky. One way to narrow down the possibilities is to look through the decompiled code for EasyOptions.view(), looking for places where an array is being accessed.
Related
I am trying to use the "Program Arguments" field in Eclipse (using java, on a mac), but whenever I enter an argument, it treats the argument like a file. I'm getting the same error no matter what. For example, if I input AL into the command line, I get the following error:
I/O exception while reading: ......./AL (No such file or directory)
I'm assuming I didn't set something up right and I was wondering how to set the command line up? I have made sure that I have the correct file, the correct method, and the pathway (the ....'s) is valid. Not really sure why this isn't working and having a hard time finding answers online.
EDIT: I added a picture of the full program and output that I am getting. For the arguments I put an "a" followed by a return key and a "b".
Not sure what these errors mean as I have searched some of them such as "Exception NO enum constant" but only "no enum const class" comes up answered on google. Can anyone examine the error at the bottom of command prompt and tell me what the error might be from? Image of the cmd error attached below.
As requested I have put the source code for org.evosuite.Properties.Algorithm which showed that there was an enum error. The entire class is too big but innside algorithm I have alreayd put "CELLULARGA" and the rest of the types of algorithms run so I'm unsure why there is that exception error when I run with cellularGA
// ---------------------------------------------------------------
// Search algorithm
public enum Algorithm {
STANDARDGA, MONOTONICGA, ONEPLUSONEEA, STEADYSTATEGA, RANDOM, NSGAII, MOSA, CELLULARGA
}
It's an IllegalArgumentException, which means you have passed in wrong arguments (probably due to type mismatch) to some method in your code. And it says it's on line 238 so you should start there.
You should practice catching exceptions with code that you can understand and which gives you a clearer picture of where the problem is instead of just printing a stacktrace you clearly can't interpret.
Except it's a runtime exception, in which case you might just have to study them.
Also, you would get more help here if you showed us some source code...
So for some reason stack overflow won't let me post more than 2 links so here is a link containing links: http://pastebin.com/FERUSH2P
Hello, so I have no idea why but I am getting ClassNotFoundException when
trying to deserialize a .bin file. I am serializing in one program and deserializing in another. The serialversion IDs are the same. Here is class in the first program: (Link 1) and the second program: (Link 2) Here is seriazation code (in second program): (Link 3) And here is deserialization code (in first program): (Link 4) And finally here is the error: (Link 5)
I would really appreciate any help! Thanks!
EDIT: By the way, getCause() returns null
EDIT: I fixed it by moving the classes now are in packages with the same name. Thanks!
Your code seems correct (except for a minor remark - it's better to put your "stream.close()" in "finally" clauses).
The error clearly indicates that the reading side doesn't have class "AnimatedModelData" on its classpath. Your can verify it by calling Class.forName("core.ModelData.AnimatedModelData") on the reading side, even without reading the stream. The standard solution is to compile such model classes once, optionally package them as a jar, then adding them to the classpath of both sides - reader and writer.
In C++, the file of the source code and current line number is decided by FILE and INLINE, which is decided at compiling time, is there any method in Java that could do the similar thing? The file and line number is decided at compiling time instead of runtime? this will be convenient for log. I kind of doubt that use runtime method to detect these information will decrease the performance.
You could use Thread.getStackTrace() and something like
System.out.println(Thread.currentThread().getStackTrace()[1]);
Output includes the current method and line number (if debugging was compiled in).
For example,
com.stackoverflow.Main.main(Main.java:23)
so, I've written programs using ifstream in the past, successfully. yet this time, I can't seem to correct this "cannot read characters from string" error shown in the image. I basically declare ifstream inputFileStream in the class header, then try stating inputFileStream("text.txt"); and I already have that given error in the debugger.
More specifically, I construct an instance of the given class in the main method, and call (from the main method,) the public method which contains the statement inputFileStream("text.txt");.
I've made sure that the given text file is actually in the same folder as the project. Anybody familiar with this error?
I looked up the cccccccc error code and it has to do with an uninitialized stack something, but why would that be relevant to this?
The closest post to this was here, but im still trying to decipher the problem How to end up with a pointer to 0xCCCCCCCC
so, I got it working. I'm using visual studio 2013. all I had to do was copy the code into a new project, and compile it there. no idea why this worked as such