Troubleshooting

If you have problems related to what we described previously, the following tips should help you get things working.

UnsupportedClassVersionError

You can install more than one version of Java on your machine but, when running a command (for example, java or javac), the system will pick up the java interpreter/compiler that is declared in your path. So if you get the UnsupportedClassVersionError error, it means that you're using a wrong JVM (most probably Java 6 or older). In the Prerequisites section earlier in this chapter, there's a table that will help you. However, this is the short version: Solr 4.7.x allows Java 6 or 7, but Solr 4.8 or greater runs only with (at least) Java 7.

If you're starting Solr from the command line, just type this:

# java -version

The output of this command will show the version of Java your system is actually using. So make sure you're running the right JVM, and also check your JAVA_HOME environment variable; it must point to the right JVM.

If you're running Solr in Eclipse, after checking what is described previously (that is, the JVM that starts Eclipse), make sure you're using a correct JVM by navigating to Window | Preferences | Java | Installed JREs.

The "Failed to read artifact descriptor" message

When running a command for the first time (for example, clean, install, or test), Apache Maven will have to download all the required libraries. In order to do that, your system must have a valid Internet connection.

So if you get this kind of message, it means that Maven wasn't able to download a required dependency. The name of the dependency should be in the message. The reason for failure could be a network issue, either permanent or transient.

In the first case, you should simply check your connection. In the second scenario (that is, a transient network failure during the download), there are some manual steps that need to be done. Assume that the dependency is org.apache.solr:solr-solrj:jar:4.8.0. You should go to your local Maven repository and remove the content of the folder that hosts that dependency, like this:

# rm -rf $HOME/.m2/repository/org/apache/solr/solr-solrj/4.8.0

On the next build, Maven will download that dependency again.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.85.181