The amazing adventures of Doug Hughes

Getting Help

This is an article I wrote for my Java class at The Iron Yard. It’s being published here with permission.


Getting help

Often you will run into problems where your debugging strategies just don’t give you anything useful to work with. In these cases, you have to turn to other resources.

Craft a good question

The first step in getting help is to figure out the correct question to ask. Vague questions don’t lead to specific answers.

Instead of saying “when I click this button, it doesn’t work,” explain what you hoped it would do and what it actually does. To do this, you have to understand what it is you’re actually trying to accomplish. It might be a surprise to realize that sometimes you don’t know this.

Provide simple sample code that illustrates your problem. If you’re asking someone to help resolve your problem, they’re not going to be terribly willing to dig through thousands of lines of unrelated code. A short, clear, concise example is easier for everyone to understand and makes it more likely that you’ll get a good answer.

Chances are good that, while you’re trying to make a simple example and craft a good question, you’ll stumble on the solution to your problem

Here is a fantastic link on crafting good questions. All of the hints above are paraphrasing this article.

Ask a friend

Now that you’ve crafted a good question, ask someone for help! Chances are you have coworkers or other friends you can ask.

Failing that, there are many resources on the web where you can ask questions and maybe even get a good answer. The most ubiquitous example is StackOverflow. Many tools that programmers use provide mailing lists you can post questions to.

Learn to read documentation

Eventually someone is going to tell you to RTFM. I suggest having done so before asking your question.

Most programming languages, third party libraries, and other tools have documentation linked to from their webpage. Take your time to try to understand how the documentation is organized and what it communicates.

There are often two sections of documentation for programming languages. The first set is instructional or overview information. For example, Oracle provides lots of documentation on using Java. These tend to read like articles or books.

The other part of documentation is API documentation. This is where the various packages, namespaces, classes, objects, properties, methods, etc are documented in detail. These tend to read like reference material and can be harder to understand. Sometimes this documentation is generated automatically. As such, it tends to have a rigid and predictable structure.

I strongly suggest taking the time to learn how a language’s documentation is organized and communicates information. Sometimes there are even tutorials on how to read the documentation.

Here are some links to documentation for Java:

Become a Professional Googler

One of the last lines of defense as a programmer is Google. In fact, Google is so good that programmers often cut to the chance and use Google as our first line of defense.

professional-googler

Googling well is tricky. It can be challenging to figure out the right question to ask.

The trick in googling is to identify the right keywords to search for. Take for example this real error I received in a previous job:

2014-10-30 09:29:25,451 ERROR [main] [plugin.osgi.factory.OsgiPlugin] enableInternal Detected an error (BundleException) enabling the plugin 'com.foo.ConflunceJMSIntegration' : Constraint violation for package 'org.springframework.transaction' when resolving module 201.0 between existing import 0.org.springframework.transaction BLAMED ON [[201.0] package; (&(package=org.springframework.transaction)(version>=0.0.0)(version<=0.0.0))] and uses constraint 4.0.org.springframework.transaction BLAMED ON [[201.0] package; (package=org.springframework.jms.connection)].  This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see https://developer.atlassian.com/x/mQAN
2014-10-30 09:29:25,452 WARN [main] [atlassian.plugin.impl.AbstractPlugin] enable Unable to enable plugin 'com.foo.ConflunceJMSIntegration'
2014-10-30 09:29:25,454 WARN [main] [atlassian.plugin.impl.AbstractPlugin] enable Because of this exception
com.atlassian.plugin.osgi.container.OsgiContainerException: Cannot start plugin: com.foo.ConflunceJMSIntegration
at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:479)
at com.atlassian.plugin.impl.AbstractPlugin.enable(AbstractPlugin.java:310)
at com.atlassian.plugin.impl.AbstractDelegatingPlugin.enable(AbstractDelegatingPlugin.java:242)
at com.atlassian.plugin.manager.PluginEnabler.actualEnable(PluginEnabler.java:136)
at com.atlassian.plugin.manager.PluginEnabler.enable(PluginEnabler.java:104)
.... had to remove detail to trim length of question ....
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.osgi.framework.BundleException: Constraint violation for package 'org.springframework.transaction' when resolving module 201.0 between existing import 0.org.springframework.transaction BLAMED ON [[201.0] package; (&(package=org.springframework.transaction)(version>=0.0.0)(version<=0.0.0))] and uses constraint 4.0.org.springframework.transaction BLAMED ON [[201.0] package; (package=org.springframework.jms.connection)]
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3415)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1709)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:892)
at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:456)
... 33 more
2014-10-30 09:29:25,455 ERROR [main] [atlassian.plugin.manager.PluginEnabler] actualEnable Unable to enable plugin com.foo.ConflunceJMSIntegration
com.atlassian.plugin.osgi.container.OsgiContainerException: Cannot start plugin: com.foo.ConflunceJMSIntegration
at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:479)
at com.atlassian.plugin.impl.AbstractPlugin.enable(AbstractPlugin.java:310)
.... had to remove detail to trim length of question ....
Caused by: org.osgi.framework.BundleException: Constraint violation for package 'org.springframework.transaction' when resolving module 201.0 between existing import 0.org.springframework.transaction BLAMED ON [[201.0] package; (&(package=org.springframework.transaction)(version>=0.0.0)(version<=0.0.0))] and uses constraint 4.0.org.springframework.transaction BLAMED ON [[201.0] package; (package=org.springframework.jms.connection)]
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3415)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1709)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:892)
at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:456)
... 33 more

If you received this error, how would you search for help?

What I do is start by identifying words or phrases that seem important, as well as relevant details, but nothing that is unique to my project.

Good keywords and phrase candidates:

  • atlassian – this was a plugin for an Atlassian product
  • BundleException
  • enabling the plugin
  • Constraint violation for package
  • org.springframework.transaction
  • when resolving module
  • org.springframework.jms.connection

Bad keywords and phrase candidates:

  • com.foo.ConfluenceJMSIntegration – this was a class I wrote.
  • 201.0 between existing import 0.org.springframework.transaction BLAMED ON [[201.0] package; (&(package=org.springframework.transaction)(version>=0.0.0)(version<=0.0.0))] – This has some repeating keywords in it along with common words like version, package, between. The numbers specified were useless and uninformative.
  • This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see https://developer.atlassian.com/x/mQAN – This is just a gut feeling. Obviously I checked this link first and didn’t find an answer to my question. There are many plugins that have had this problem, so results don’t lead to anything specific to this problem.

Using these candidates I think I’ll try a search of:

atlassian BundleException Constraint violation for package org.springframework.transaction when resolving module org.springframework.jms.connection

Searching Google with these keywords takes me to an answer!

professional-google-results

Be sure to checkout Google’s own Tips & Tricks page to learn more googling goodness.

Read a book

Sometimes a book is the best way to learn something new. In these cases my recommendations are simple. For any given topic, go to Amazon and find the shortest book with the most positive ratings.

I find that short books that lots of people like tend to be the best. They are the easiest to read, are accessible, and provide just the right amount of information needed.

As an example, let’s consider books on Scrum. Scrum is a project management system that is common in software projects. Searching for Scrum on Amazon turns up hundreds of results, not all of them related.

A best seller is Essential Scrum: A Practical Guide to the Most Popular Agile Process. This book gets 4.7 out of 5 stars, has been reviewed 186 times, and has 504 pages.

By contrast we see Scrum: a Breathtakingly Brief and Agile Introduction. This book gets 4.3 out of 5 stars, has been reviewed 537 times, and is only 54 pages.

Given the choice, I would absolutely go with the second book. Lots of people like it a lot and it’s short enough that I could read it in one sitting. It’ll give me the introduction I need and enough knowledge to get started.

Comments on: "Getting Help" (1)

  1. Take out the extra word “it” under Craft a good question – second paragraph

    Sent from my iPhone

    Like

What are your thoughts?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: