6

Before you say never I will invite you to think about this example:

you are connected to a oracle database and when you do rs.getString(1) you get this stacktrace.

java.lang.ArrayIndexOutOfBoundsException: -5
    at oracle.sql.LnxLibThin.lnxnuc(LnxLibThin.java:6087)
    at oracle.sql.NUMBER.toText(NUMBER.java:2796)

The first action I will take is to search "oracle.sql.LnxLibThin.lnxnuc(LnxLibThin.java:6087)" on my favorite search engine to understand what is happening...

For now, your lucky and SO has an answer (not the best one...) because unfortunately the question is closed.

Why is it closed?, well first I believed that the question was read to quickly "this user is crazy trying to index -5", so I entered the "so-close-vote-reviewers" (maybe you should not...) and asked what they belived.

They correctly pointed out that it was missing MCVE since exact driver version is not indicated (so future user can't determine if he is in same situation) and since I have great respect for the persons dedicating time to clean up SO, for me that was it.

Time goes by and every day I see students posting there homework, this is surely nice for new user who need some points and learn how to answer questions on SO... but hardly useful for "professional and enthusiast programmers"

Instead maybe the oracle.sql.LnxLibThin.lnxnuc(LnxLibThin.java:6087) would be more useful for "professional and enthusiast programmers", even if the OP does not give a d*** posting his driver version and other useful info.

If I have same error in LnxLibThin.java:6087 (same row), I can be pretty sure I'm using same library..

So I end up posting here not to reopen the question, but for some advice and reflections on how we can promote questions that are useful for professional and enthusiast programmers, more tolerance on how question is made?, a stack trace say's more then 1M words?....

or maybe the job for the great guys in the "so-close-vote-reviewers" only get more complex....

EDIT: @Makoto in a comment managed to summarize my feeling

"those asking questions about their homework are providing more details about their problem than the professionals."

so we end up with questions of homework? or can we create value in another way?

START EDIT:

Initially I did not wan't to include the question in post, since this is not about this single question, but the problem of OP not posting MVCE on a question that probably is a really good question.. however I like to avoid you having to search on google so here its is arrayindexoutofbounds-when-getting-data-from-an-oracle-database

END EDIT

10
  • 4
    This is like NullPointerException. All the questions (except the canonical) are more or less useless. Once you understand what the exception means, the rest is debug work and that's not up to Stack Overflow. In this case, the exception seems to be thrown in some Oracle library. Report it or submit a fix. Again, not something Stack Overflow should be involved in. Commented Nov 11, 2015 at 20:31
  • I edited your post to improve its English. If I misinterpreted any parts of your question, please edit your question to fix any mistakes I made.
    – ryanyuyu
    Commented Nov 11, 2015 at 20:32
  • @Sotirios Delimanolis, my point is that the stacktrace can be very useful for people when they have exact same problem... for me I often have had alot of help on SO to determine my problem searching on stacktrace... Note the question is not mine...@ryanyuyu thanks. Commented Nov 11, 2015 at 20:35
  • 1
    If you get a stack trace, you should always provide it (or at least the relevant parts, but a lot of posters don't know the relevant parts because they don't know how to read a stack trace). If I saw a question that simply asked "What does the stack trace [in your question] mean?", I would immediately downvote and close as a duplicate. If they provided a stacktrace AND an MCVE demonstrating their understanding of the exception and their effort to debug it, then I would consider helping with something other than a duplicate. Commented Nov 11, 2015 at 20:38
  • @ryanyuyu sorry had to rollback since it seems that this was my problem, this question was made to reflect on what is usefull on SO Commented Nov 11, 2015 at 20:40
  • @PetterFriberg no worries.
    – ryanyuyu
    Commented Nov 11, 2015 at 20:44
  • @Sotirios Delimanolis and if OP does not we close it even if it could be very useful to other users? Commented Nov 11, 2015 at 20:53
  • 3
    Yes, until it can be improved. The judgement call is that, in its state, the question will not be useful to other users. Commented Nov 11, 2015 at 20:56
  • So I need to swallow my frustration of OP not providing a MCVE on a good question.... thanks @Sotirios Delimanolis Commented Nov 11, 2015 at 21:02
  • 2
    @PetterFriberg: The point is that it isn't even an acceptable question. Yet. Though you suspect the OP could write a good question, if he was willing, which he obviously isn't. And you seem to have the knowledge to write a good question which is similar. Commented Nov 11, 2015 at 21:05

2 Answers 2

13

Did you try to join on an empty set, select from an empty set, or "something" from an empty set? To me, that is what it looks like. Internally doing that caused this exception.

The problem with this type of Stack Trace is that it is very, very vague. In fact, many Stack Traces are vague which is why having the actual code to reproduce the indicated error or exception is desirable and why the minimal example applies in so many of these cases.

Note that not all questions require a minimal example. Due diligence and an explanation of precedence or research will often suffice.

However, in this case, there doesn't seem to be any explanation aside from the Stack Trace (I assume it is this post: https://stackoverflow.com/questions/33480776/arrayindexoutofbounds-when-getting-data-from-an-oracle-database).

Without any actual way to reproduce this, the community (as in each person wanting to help or answer) would need to guess, check, and finally create a demo to reproduce the shown error before even beginning to solve the problem. For this reason, in this exact scenario, the Stack Trace was not enough information to use to solve the question in a verifiable manner.

This is not to say that Stack Traces are not valuable - they are. Also, a question can only have a Stack Trace and still be viable. It is just that in this exact scenario, there was not enough information present and as a result the question was closed. It is also not even clear in this exact scenario that the OP had used the same approach you used to get to this error message because they do not reference the getString method that you do ( it is conjecture ).

7
  • My point is maybe its up to "us" to create value of these questions.... getString is not hard to guess.. OracleResultSetImpl.getString(... since OP will not... Commented Nov 11, 2015 at 20:50
  • 4
    It's not up to us, as the potential answerers, to make a question clear and therefore create value. It is up to the questioner. We can help, through editing, if the English needs work, or there are formatting problems, to make it better. But if there is information missing that only the questioner can supply, they must provide it. We get thousands of questions a day -- it's not like we need to keep all of them. Commented Nov 11, 2015 at 20:55
  • 3
    I feel like if you have an example or set of code that verifiably recreates a scenario, and that example isn't anywhere else, just make a new question and create higher quality content that way. It may end up being easier to search for and thus helping more people in the end as well.
    – Travis J
    Commented Nov 11, 2015 at 20:56
  • 1
    My frustration is the of the thousands of questions a day, 90% seems to be homework... and when valueble question shows up OP is not providing enough information.... so it needs to be deleted...... Commented Nov 11, 2015 at 20:59
  • 1
    @PetterFriberg: The irony there is that those asking questions about their homework are providing more details about their problem than the professionals. That's actually quite scary in actuality (and quite good that the future wave of programmers will be able to actually explain their pain points).
    – Makoto
    Commented Nov 11, 2015 at 21:03
  • @Makoto with this comment you increase my frustration again... so we end up closing questions of professionals and running after reputation on homework...... Commented Nov 11, 2015 at 21:07
  • 3
    @PetterFriberg: Well darn it, what do you want from me? I don't care if you're a professional or a student. If you ask a question that's clear, I'll be happy to answer it. If the question isn't clear, then the only recourse I have is to close it. It's nothing personal, but if the professional can't include enough information for us to have a chance to address their problem, then there's really no helping them.
    – Makoto
    Commented Nov 11, 2015 at 21:08
7

Let's turn this on its head and ask another question:

How useful is a stack trace without context?

The answer is going to be "it isn't", and I'll explain why below.


Suppose that you're someone working in a Spring shop, and you run into the most dreaded exception of them all:

java.lang.IllegalStateException: Failed to load ApplicationContext

Well...shoot. Spring's broken. Maybe if I included more of the stack trace someone could help...

java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

...Yeah. Does that stack trace do anything for you? It shouldn't, because:

  • This is the top level exception from Spring, which contains no context into the actual problem
  • This sort of exception could happen for any number of reasons related to Spring
  • A question that only contains this as context information alone can't be useful since if you're having this same problem, you've already seen this stack trace!

This was actually lifted from this question, which is a good example of a question being complete; it contains enough information for the question to be at least answerable.

And now, we come to this stack trace:

java.lang.ArrayIndexOutOfBoundsException: -5
    at oracle.sql.LnxLibThin.lnxnuc(LnxLibThin.java:6087)
    at oracle.sql.NUMBER.toText(NUMBER.java:2796)

An ArrayIndexOutOfBoundsException. Great! I've seen those before; it's what happens when you go out of bounds on an array, isn't it? But...I don't control anything in the oracle.sql package, and I doubt that my company would be okay with me "fixing" this issue.

Well, shoot - how do I figure out what's going on with this problem? Maybe someone on the internet knows?

Now, as in the example above, this stack trace does nothing for you since it's a top-level exception and does not describe how one got into this scenario to begin with. It's likely the case that this is a state that the package maintainers for Oracle didn't foresee, but in all honesty, the real question is, how did you get in that state to begin with?

If you can't provide enough context to help me get into the same state that you're in when you encountered the problem, then why would you expect me to simply divine what the issue is? That's a huge ask, even of professionals. Even if I knew how you could get into that state, I'd need to at least see a little bit more to verify that it's one of the cases that I know of. If I just rattle off a whole bunch of ways that you might have landed here (and those ways are divergent), then that does not benefit you or anyone else looking for a solution to the problem.

8
  • I don't think I complete agree with you, since my intrest was not solving the users problem, but providing help for future users (I have a feeling that you often land on SO searching on stacktrace), and if question was open an answer could have been es. With driver version 6.1 using getString on Numeric value you get this error, this can be solved updating to... or with this work around.... Commented Nov 11, 2015 at 21:37
  • 1
    @PetterFriberg: As a layman, I have no context into what could be causing the issue. I've never worked with this library before. At least, with more context into the problem, I can be partially useful and reference documentation to diagnose what the issue may be. In general, you're not going to run into experts that know this particular issue when the question is asked; you're going to run into folks like me who are fairly good as software engineering but may not be familiar with a library. This is a strong reason why context is necessary - it enables me to help as well.
    – Makoto
    Commented Nov 11, 2015 at 21:57
  • If oracle was better in releasing there sourcecode, I know that you would have no problem answering this question.... Commented Nov 11, 2015 at 22:13
  • 1
    Or...if...y'know...the person that had a problem could actually properly explain how they got in that scenario...
    – Makoto
    Commented Nov 11, 2015 at 22:15
  • There I can't help you but I think we can do a fairly good guess... like we often do... Commented Nov 11, 2015 at 22:17
  • 5
    If they're asking a question, there really shouldn't be any guessing involved. I shouldn't have to guess what sort of problem they're running into. That's the frustration I'm having with this scenario.
    – Makoto
    Commented Nov 11, 2015 at 22:19
  • enough with frustration lets move on, thanks @Makoto Commented Nov 11, 2015 at 22:20
  • Lets just stop abusing the word "frustration". Its a simple fact that questions stemming from guesswork are going to be off-topic support requests. Before you can turn to SO for help, you need to have passed the guessing stage. The sooner the better, because programmers or engineers who guess are not doing their job right. They should actively refuse to do it unless left with no other choice. You have no other choice when you have nothing left to investigate - case in point, you have this wonderful stacktrace with a root cause. Investigate.
    – Gimby
    Commented Nov 12, 2015 at 11:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .