Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Corb.jar not found.. #280

Closed
grtjn opened this issue Sep 11, 2014 · 2 comments
Closed

Corb.jar not found.. #280

grtjn opened this issue Sep 11, 2014 · 2 comments

Comments

@grtjn
Copy link
Contributor

grtjn commented Sep 11, 2014

Reported by Jochen:

After upgrading my a roxy environment to the current dev branch, ml fails to start a corb process caused by the fact that corb.jar is not found.

I had a look at deploy/lib/server_config.rb and I think the path.expansion to corb.jar returns a non existing directory.

# Find the XCC jar
  matches = Dir.glob(ServerConfig.expand_path("../java/*xcc*.jar"))
  raise "Missing XCC Jar." if matches.length == 0
  xcc_file = matches[0]

  if install
    # If we're installing, we need to change directories to the source
    # directory, so that the xquery_modules will be visible with the
    # same path that will be used to see it in the modules database.
    Dir.chdir(@properties['ml.xquery.dir']) do
      runme = %Q{java -cp #{ServerConfig.expand_path("../java/corb.jar")}#{path_separator}#{xcc_file} com.marklogic.developer.corb.Manager #{connection_string} #{collection_name} #{xquery_module} #{thread_count} #{uris_module} #{module_root} #{modules_database} #{install}}
      logger.info runme
      `#{runme}`
    end
  else
    runme = %Q{java -cp #{ServerConfig.expand_path("../java/corb.jar")}#{path_separator}#{xcc_file} com.marklogic.developer.corb.Manager #{connection_string} #{collection_name} #{xquery_module} #{thread_count} #{uris_module} #{module_root} #{modules_database} #{install}}
    logger.info runme
    `#{runme}`
  end
end

If I replace the lines above with the following, it seems to work fine:

  # Find the XCC jar
  matches = Dir.glob(ServerConfig.expand_path("../java/*xcc*.jar"))
  raise "Missing XCC Jar." if matches.length == 0
  xcc_file = matches[0]

  # Find the CORB jar
  matchesCorbJar = Dir.glob(ServerConfig.expand_path("../java/*corb*.jar"))
  raise "Missing CORB  Jar." if matchesCorbJar.length == 0
  corb_file = matchesCorbJar[0]

  if install
    # If we're installing, we need to change directories to the source
    # directory, so that the xquery_modules will be visible with the
    # same path that will be used to see it in the modules database.
    Dir.chdir(@properties['ml.xquery.dir']) do
      runme = %Q{java -cp #{corb_file}#{path_separator}#{xcc_file} com.marklogic.developer.corb.Manager #{connection_string} #{collection_name} #{xquery_module} #{thread_count} #{uris_module} #{module_root} #{modules_database} #{install}}
      logger.info runme
      `#{runme}`
    end
  else
    runme = %Q{java -cp #{corb_file}#{path_separator}#{xcc_file} com.marklogic.developer.corb.Manager #{connection_string} #{collection_name} #{xquery_module} #{thread_count} #{uris_module} #{module_root} #{modules_database} #{install}}
    logger.info runme
    `#{runme}`
  end
end
@grtjn
Copy link
Contributor Author

grtjn commented Sep 11, 2014

Might be caused by the chdir if you are using the install option. The glob is a bit overkill as the name of the jar really is corb.jar, but this makes it future proof in case someone trades our corb.jar with a newer version that has a slightly different name (with a version number in it for instance)..

+1 for applying the given patch..

@grtjn
Copy link
Contributor Author

grtjn commented Jul 6, 2015

Superseded by the fix for #391 (PR #402). Fixed in dev.

@grtjn grtjn closed this as completed Jul 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants