.js extension for javascript file is missing
What version you are using? And are you sure the my_module.js is exist?

I think the best way is using hook_library to add js and css for your module:

function my_module_library() {
  $libraries['my-module'] = array(
    'title' =&gt; 'My custom module library',
    'version' =&gt; '1.0',
    'js' =&gt; array(
      drupal_get_path('module', 'my_module') . '/my_module.js' =&gt; array(),
    ),
  );
  return $libraries;
}

function my_module_init() {
  drupal_add_library('my_module', 'my-module');
}