You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Vaibhav Puranik <vp...@gmail.com> on 2009/03/26 23:28:10 UTC

Hadoop config file IOException

Hi,

I am a HBase/Hadoop newbie.

Following code (groovy) works, but produces the exception given below:

def hbaseConfig = new HBaseConfiguration()
admin = new HBaseAdmin(hbaseConfig)
println admin.listTables()

Exception:
14:15:25.702 [main] DEBUG org.apache.hadoop.conf.Configuration -
java.io.IOException: config()
    at org.apache.hadoop.conf.Configuration.<init>(Configuration.java:176)
    at org.apache.hadoop.conf.Configuration.<init>(Configuration.java:164)
    at
org.apache.hadoop.hbase.HBaseConfiguration.<init>(HBaseConfiguration.java:32)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:70)
    at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
    at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:55)
    at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:191)
    at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:195)

I am using Hadoop 0.19, Hbase 0.19, have HADOOP_HOME and HBASE_HOME defined
in my .bashrc.

The code prints list of tables. but I don't understand why I am getting the
exception. Any pointers?

Regards,
Vaibhav

Re: Hadoop config file IOException

Posted by Vaibhav Puranik <vp...@gmail.com>.
Andy,

Actually, it was my mistake. I had SLF4J in my class path and  commons
logging was using SLF4J logger.
It worked as soon as I used the right logger class.

Thanks for your help. I will explore how to run scripts with hbase as per
your suggestion.

Regards,
Vaibhav

On Fri, Mar 27, 2009 at 3:17 PM, Andrew Purtell <ap...@apache.org> wrote:

>
> Hi Vaibhav,
>
> Does this work?
>
>  import org.apache.log4j.Level;
>  import org.apache.log4j.Logger;
>  // ...
>   Logger log = Logger.getLogger(<your main class>.class.getName());
>  log.setLevel(Level.WARN);
>
> ... where you make the appropriate substitution of course. :-)
> Works for me.
>
> Also, I always launch my client code using the appropriate launcher
> script. Doing so lessens the differences between my deployments and
> those of others who commonly do the same thing, which makes bug
> reporting smoother. So I copy my jars into hbase/lib and then do
>
>  hbase my.package.MyClass arg1 arg2 ... argn
>
> or
>
>  hbase-daemon.sh start my.package.MyClass arg1 arg2 ... argn
>
> as appropriate.
>
> Hope this helps,
>
>  - Andy
>
>
> --- On Fri, 3/27/09, Vaibhav Puranik <vp...@gmail.com> wrote:
>
> > From: Vaibhav Puranik <vp...@gmail.com>
> > Subject: Re: Hadoop config file IOException
> > To: hbase-user@hadoop.apache.org, apurtell@apache.org
> > Date: Friday, March 27, 2009, 11:02 AM
> > Hi Andy,
> >
> > I am trying to change it from the client code as I am not
> > executing my client using hadoop/bin/hadoop or
> > hbase/bin/hbase scripts.
> >
> > What logger should I use? using main, root and
> > "org.apache.hadoop.ipc.HBaseClass" or
> > 'org.apache.hadoop" doesn't  work.
> >
> > Regards,
> > Vaibhav
>
>
>
>
>

Re: Hadoop config file IOException

Posted by Andrew Purtell <ap...@apache.org>.
Hi Vaibhav,

Does this work?

  import org.apache.log4j.Level;
  import org.apache.log4j.Logger;
  // ...
  Logger log = Logger.getLogger(<your main class>.class.getName());
  log.setLevel(Level.WARN);

... where you make the appropriate substitution of course. :-)
Works for me. 

Also, I always launch my client code using the appropriate launcher
script. Doing so lessens the differences between my deployments and
those of others who commonly do the same thing, which makes bug
reporting smoother. So I copy my jars into hbase/lib and then do

  hbase my.package.MyClass arg1 arg2 ... argn

or 

  hbase-daemon.sh start my.package.MyClass arg1 arg2 ... argn

as appropriate. 

Hope this helps,

  - Andy


--- On Fri, 3/27/09, Vaibhav Puranik <vp...@gmail.com> wrote:

> From: Vaibhav Puranik <vp...@gmail.com>
> Subject: Re: Hadoop config file IOException
> To: hbase-user@hadoop.apache.org, apurtell@apache.org
> Date: Friday, March 27, 2009, 11:02 AM
> Hi Andy,
> 
> I am trying to change it from the client code as I am not
> executing my client using hadoop/bin/hadoop or
> hbase/bin/hbase scripts.
> 
> What logger should I use? using main, root and
> "org.apache.hadoop.ipc.HBaseClass" or
> 'org.apache.hadoop" doesn't  work.
> 
> Regards,
> Vaibhav



      

Re: Hadoop config file IOException

Posted by Vaibhav Puranik <vp...@gmail.com>.
Hi Andy,

I am trying to change it from the client code as I am not executing my
client using hadoop/bin/hadoop or hbase/bin/hbase scripts.

What logger should I use? using main, root and
"org.apache.hadoop.ipc.HBaseClass" or 'org.apache.hadoop" doesn't  work.

Regards,
Vaibhav

On Thu, Mar 26, 2009 at 5:42 PM, Andrew Purtell <ap...@apache.org> wrote:

>
> Hi Vaibhav,
>
> > From: Vaibhav Puranik
> > How do I change client's log level? I can change
> > server's log level from the web UI.
>
> For Hadoop, in hadoop/conf/log4j.properties modify hadoop.root.logger
> property.
>
> For HBase, in hbase/conf/log4j.properties modify hbase.root.logger
> property.
>
> These settings are picked up by the client if you are executing client side
> code using hadoop/bin/hadoop or hbase/bin/hbase scripts.
>
> Or, you can specify the log level on the command line, for example:
>
>  HBASE_ROOT_LOGGER=WARN,console bin/hbase foo
>
> Finally, you can change the log level within your client code:
>
>  import org.apache.log4j.Level;
>  import org.apache.log4j.Logger;
>  // ...
>  Logger log = Logger.getLogger(...);
>  log.setLevel(Level.WARN);
>
> Hope this helps,
>
>   - Andy
>
>
>
>
>

Re: Hadoop config file IOException

Posted by Andrew Purtell <ap...@apache.org>.
Hi Vaibhav,

> From: Vaibhav Puranik
> How do I change client's log level? I can change
> server's log level from the web UI.

For Hadoop, in hadoop/conf/log4j.properties modify hadoop.root.logger property.

For HBase, in hbase/conf/log4j.properties modify hbase.root.logger property.

These settings are picked up by the client if you are executing client side code using hadoop/bin/hadoop or hbase/bin/hbase scripts. 

Or, you can specify the log level on the command line, for example:

  HBASE_ROOT_LOGGER=WARN,console bin/hbase foo

Finally, you can change the log level within your client code:

  import org.apache.log4j.Level;
  import org.apache.log4j.Logger;
  // ...
  Logger log = Logger.getLogger(...);
  log.setLevel(Level.WARN);

Hope this helps,

   - Andy



      

Re: Hadoop config file IOException

Posted by Vaibhav Puranik <vp...@gmail.com>.
Thanks Andy.

How do I change client's log level? I can change server's log level from the
web UI.

Regards,
Vaibhav

On Thu, Mar 26, 2009 at 4:18 PM, Andrew Purtell <ap...@apache.org> wrote:

>
> Hi Vaibhav,
>
> This is a harmless exception that is printed at DEBUG level. It
> seems to have been put into the Hadoop Configuration class just to
> mark when the configuration object is created.
>
> Best regards,
>
>   - Andy
>
> > From: Vaibhav Puranik <vp...@gmail.com>
> > Subject: Hadoop config file IOException
> > To: hbase-user@hadoop.apache.org
> > Date: Thursday, March 26, 2009, 3:28 PM
> > Hi,
> >
> > I am a HBase/Hadoop newbie.
> >
> > Following code (groovy) works, but produces the exception
> > given below:
> >
> > def hbaseConfig = new HBaseConfiguration()
> > admin = new HBaseAdmin(hbaseConfig)
> > println admin.listTables()
> >
> > Exception:
> > 14:15:25.702 [main] DEBUG
> > org.apache.hadoop.conf.Configuration - java.io.IOException: config()
> >     at
> > org.apache.hadoop.conf.Configuration.<init>(Configuration.java:176)
> >     at
> > org.apache.hadoop.conf.Configuration.<init>(Configuration.java:164)
> >     at
> >
> org.apache.hadoop.hbase.HBaseConfiguration.<init>(HBaseConfiguration.java:32)
> >     at
> > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> >     at
> >
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> >     at
> >
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> >     at
> > java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> >     at
> >
> org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:70)
> >     at
> >
> org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
> >     at
> >
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:55)
> >     at
> >
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:191)
> >     at
> >
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:195)
> >
> > I am using Hadoop 0.19, Hbase 0.19, have HADOOP_HOME and
> > HBASE_HOME defined
> > in my .bashrc.
> >
> > The code prints list of tables. but I don't understand
> > why I am getting the
> > exception. Any pointers?
> >
> > Regards,
> > Vaibhav
>
>
>
>

Re: Hadoop config file IOException

Posted by Andrew Purtell <ap...@apache.org>.
Hi Vaibhav,

This is a harmless exception that is printed at DEBUG level. It
seems to have been put into the Hadoop Configuration class just to
mark when the configuration object is created.

Best regards,

   - Andy

> From: Vaibhav Puranik <vp...@gmail.com>
> Subject: Hadoop config file IOException
> To: hbase-user@hadoop.apache.org
> Date: Thursday, March 26, 2009, 3:28 PM
> Hi,
> 
> I am a HBase/Hadoop newbie.
> 
> Following code (groovy) works, but produces the exception
> given below:
> 
> def hbaseConfig = new HBaseConfiguration()
> admin = new HBaseAdmin(hbaseConfig)
> println admin.listTables()
> 
> Exception:
> 14:15:25.702 [main] DEBUG
> org.apache.hadoop.conf.Configuration - java.io.IOException: config()
>     at
> org.apache.hadoop.conf.Configuration.<init>(Configuration.java:176)
>     at
> org.apache.hadoop.conf.Configuration.<init>(Configuration.java:164)
>     at
> org.apache.hadoop.hbase.HBaseConfiguration.<init>(HBaseConfiguration.java:32)
>     at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>     at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>     at
> java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>     at
> org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:70)
>     at
> org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
>     at
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:55)
>     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:191)
>     at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:195)
> 
> I am using Hadoop 0.19, Hbase 0.19, have HADOOP_HOME and
> HBASE_HOME defined
> in my .bashrc.
> 
> The code prints list of tables. but I don't understand
> why I am getting the
> exception. Any pointers?
> 
> Regards,
> Vaibhav