Getting Nutch1.0 example working in tomcat 6 (on ubuntu)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Getting Nutch1.0 example working in tomcat 6 (on ubuntu)

Alex McLintock
I'm trying out nutch-1.0 release on Ubuntu 9.04. I'm trying to follow
the 0.8 version tutorial found at
http://lucene.apache.org/nutch/tutorial8.html

Now I seem to be able to do the web crawling and create indexes. I can
do searches from the command line using

eg


/local/apps/software/nutch$ bin/nutch org.apache.nutch.searcher.NutchBean Banks
Total hits: 36
 0 20090704080759/http://www.iain-banks.net/
 ... to announce that Iain Banks / Iain M Banks, author of The ... and
tributes from Iain  ...
etc

So now I am trying to see the same thing in a web app.

I had trouble installing the war file in tomcat6 (which is the ubuntu
repository version)and dont know if I have done it right.

Basically I keep on getting this error to do with security permissions...


SEVERE: Exception sending context initialized event to listener
instance of class
org.apache.nutch.searcher.NutchBean$NutchBeanConstructor
java.lang.RuntimeException: java.security.AccessControlException:
access denied (java.lang.reflect.ReflectPermission
suppressAccessChecks)
        at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:81)

(rest of the stack trace at the end of this email)

Now I've done some researching and it looks like I need to set up the
security policy for tomcat 6 such that it allows reflection.
But frankly I dont understand what Nutch is doing that requires me to
set up a special security policy for it.

I've tried editing /etc/tomcat6/policy.d/04webapps.policy but I am not
sure I understand how to do it. Can anyone help me with their tomcat
policy file for Nutch?

Is it having problems trying to find the indexes on the file system?
That doesnt seem to be the problem?

Is the nutch code doing anything special which tomcat is right to deny?

Does it really make a difference what directory I start tomcat from ?
Surely I want to start tomcat from the system scripts at start up.








04-Jul-2009 12:08:21 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener
instance of class
org.apache.nutch.searcher.NutchBean$NutchBeanConstructor
java.lang.RuntimeException: java.security.AccessControlException:
access denied (java.lang.reflect.ReflectPermission
suppressAccessChecks)
        at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:81)
        at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1366)
        at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:56)
        at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1379)
        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.NutchBean.<init>(NutchBean.java:89)
        at org.apache.nutch.searcher.NutchBean.<init>(NutchBean.java:77)
        at org.apache.nutch.searcher.NutchBean$NutchBeanConstructor.contextInitialized(NutchBean.java:425)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4338)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123)
        at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        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:578)
        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 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.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)
Caused by: java.security.AccessControlException: access denied
(java.lang.reflect.ReflectPermission suppressAccessChecks)
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
        at java.security.AccessController.checkPermission(AccessController.java:546)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
        at java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:107)
        at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:76)
        ... 39 more