nutch启动时报Login failed: Cannot run program "whoami"

现象:

javax.security.auth.login.LoginException: Login failed: Cannot run program "whoami": CreateProcess error=2, ?????????
	at org.apache.hadoop.security.UnixUserGroupInformation.login(UnixUserGroupInformation.java:250)
	at org.apache.hadoop.security.UnixUserGroupInformation.login(UnixUserGroupInformation.java:275)
	at org.apache.hadoop.security.UnixUserGroupInformation.login(UnixUserGroupInformation.java:257)
	at org.apache.hadoop.security.UserGroupInformation.login(UserGroupInformation.java:67)
	at org.apache.hadoop.fs.FileSystem$Cache$Key.<init>(FileSystem.java:1438)
	at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1376)
	at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:215)
	at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:120)
	at org.apache.nutch.searcher.FetchedSegments.<init>(FetchedSegments.java:205)
	at org.apache.nutch.searcher.NutchBean.<init>(NutchBean.java:115)
	at org.apache.nutch.searcher.NutchBean.<init>(NutchBean.java:82)
	at org.apache.nutch.searcher.NutchBean$NutchBeanConstructor.contextInitialized(NutchBean.java:448)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

 解决方法,在windows机器上安装cygwin,然后在环境变量path中加上cygwin的bin目录,如F:\cygwin2.510.2.2\bin

你可能感兴趣的:(java,apache,hadoop,Security,sun)