I have a parser program in Scala sending string
to it and breaking the string and parse. I am getting the following error on that which I don't even know which part of the program is wrong:
Exception in thread "main" scala.MatchError: xxxx/xml/test3D.xml (of class java.lang.String)
What are the possibilities that I need to check and what is the best way to solve these kind of errors?
There is exact place where exception occurred and it is described by file name and line number in this file. For example, look at this stack trace:
Exception in thread "main" scala.MatchError: 7 (of class java.lang.Integer)
at stackoverflow.M$.delayedEndpoint$stackoverflow$M$1(Functions.scala:35)
at stackoverflow.M$delayedInit$body.apply(Functions.scala:30)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
Here you can see that exception cause is on line 35 in Functions.scala file. The second line in a stack trace is the line where exception was thrown. Check this line!
MatchError occurs whenever an object doesn't match any pattern of a pattern matching expression.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With