Friday, January 11, 2013

Error when building Apache components using non-Sun Java

Sometimes, when building some Apache Hadoop related components with non-Sun Java (such as IBM Java or OpenJDK) you may encounter the following error:

java.lang.NoClassDefFoundError: org.apache.hadoop.security.UserGroupInformation

I got this error while building Hbase, Hive and Oozie. And all times the problem was the same. When building a component that depends on Hadoop, your Hadoop jar should build with non-Sun Java as well.

That means that you should rename some com.sun imports in Hadoop code, so it is buildable with other JVMs. Replace this com.sun imports with the correspondent non-Sun package.

Usually the jar that causes the problem is hadoop-core.jar.

Hope it save you all some work!

No comments:

Post a Comment