Don't just ask, ask to ask
Every now and then, in online chat rooms I hang around in, someone pops in and says something completely inappropriate in the lines of,
Foobar123:
This is horrific form, for several reasons. What the person is actually blurting out here is,
Foobar123:
There are plenty of reasons why people who DO have the knowledge would be deeply offended by this sudden text dump. By just asking, you're dropping a heavy burden into the chat without establishing a social contract first.
You're assuming people care. You're ambushing them. You're also unnecessarily cluttering the channel scrollback. I often like to sit in channels and enjoy the absolute silence, and a massive wall of code or a specific error message ruins the vibe entirely.
Alternatively, it can be seen as..
Foobar123:
..which is just rude. If you're not willing to ask for permission to speak first, why should we listen?
The solution is not to just ask, but to ask to ask. Someone who is idling on the channel and only every now and then glances what's going on needs to be properly coaxed into a conversation. A vague, mysterious query about their credentials will pique their pride and get them to answer.
So, to summarize, don't ask "How do I do [problem] with Java and [other relevant info]?", but rather ask "Any Java experts around?"