LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-01-2007, 08:54 PM   #1
laundry_day
LQ Newbie
 
Registered: May 2007
Posts: 9

Rep: Reputation: 0
Question Problem with Nutch, Tomcat, or Java


Hoping you all might be able to help this newbie.

I recently installed Debian Etch, the latest JVM, Tomcat 5.5, and Nutch 0.9 . Was able to successfully crawl, index, and search the database from the terminal console, but got an error when trying to use the Nutch search page located at localhost:8180 (Tomcat's default).

When performing a search query I get the following error:

Code:
HTTP Status 500 -
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /search.jsp:66

63: --%>
64:
65: <%
66:   NutchBean bean = NutchBean.get(application, nutchConf);
67:   // set the character encoding to use when interpreting request values
68:   request.setCharacterEncoding("UTF-8");
69:


Stacktrace:
   org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:506)
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:585)
   org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
   java.security.AccessController.doPrivileged(Native Method)
   javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
   org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
   org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)

root cause

java.lang.RuntimeException: java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
   org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:80)
   org.apache.hadoop.fs.FileSystem.get(FileSystem.java:159)
   org.apache.hadoop.fs.FileSystem.getNamed(FileSystem.java:119)
   org.apache.hadoop.fs.FileSystem.get(FileSystem.java:91)
   org.apache.nutch.searcher.NutchBean.<init>(NutchBean.java:95)
   org.apache.nutch.searcher.NutchBean.<init>(NutchBean.java:84)
   org.apache.nutch.searcher.NutchBean.get(NutchBean.java:71)
   org.apache.jsp.search_jsp._jspService(search_jsp.java:106)
   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:585)
   org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
   java.security.AccessController.doPrivileged(Native Method)
   javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
   org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
   org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.
Not sure but I think the Nutch search page (located at: /usr/share/tomcat5.5-webapps/ROOT ) doesn't know where the Nutch Java classes and/or the database files are.

Any ideas on what this means and how to fix this?

The folders for Java and Tomcat were installed in their default locations. Nutch was installed in /usr/local/nutch/ with the database index located at /usr/local/nutch/crawl .

Thanks in advance,
 
Old 05-01-2007, 09:05 PM   #2
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
To me it looks more as if it's a matter of permissions. Are you doing this as root or as a regular user? What about password protection on the database?
 
Old 05-01-2007, 10:28 PM   #3
laundry_day
LQ Newbie
 
Registered: May 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for your reply, jay73. Everything was done as root when using the terminal (installing packages, running the crawl, etc.). But when using the search page via the browser (here on the local network and from outside) it was just done normally, of course.

Nothing was done to the database to password protect it. I just followed the Nutch tutorial verbatim for our first crawl.

Edit: Not sure if this is relevant. Nutch typically uses port 8080. Since installation I've never been able to get port 8080 open/listening. Ports 80 (apache2) and 8180 (tomcat) are fine. But all port scans (nmap) have showed that 8080 is closed. Could that be a problem?

Last edited by laundry_day; 05-01-2007 at 10:45 PM.
 
Old 05-01-2007, 11:57 PM   #4
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
That would be one explanation. I'm not familiar with that kind of application but I'm sure it has a configuration file somewhere that allows assigning a different port. It's usually as easy as tracing down the relevant line in the file and manually replacing with a different port.
 
Old 05-02-2007, 12:44 AM   #5
laundry_day
LQ Newbie
 
Registered: May 2007
Posts: 9

Original Poster
Rep: Reputation: 0
I located the server.xml file for tomcat and changed port 8180 to 8080 (then restarted tomcat). I was able to access Nutch's search page at localhost:8080 but it gave "less" of an error this time when doing a search. Which I guess is progress.

Code:
type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:585)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)


root cause 

java.lang.RuntimeException: java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
	org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:80)
	org.apache.hadoop.fs.FileSystem.get(FileSystem.java:159)
	org.apache.hadoop.fs.FileSystem.getNamed(FileSystem.java:119)
	org.apache.hadoop.fs.FileSystem.get(FileSystem.java:91)
	org.apache.nutch.searcher.NutchBean.<init>(NutchBean.java:95)
	org.apache.nutch.searcher.NutchBean.<init>(NutchBean.java:84)
	org.apache.nutch.searcher.NutchBean.get(NutchBean.java:71)
	org.apache.jsp.search_jsp._jspService(search_jsp.java:106)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:585)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.
The first error had a section about /search.jsp and line 66 (NutchBean). But this time it didn't give that error. Either that's a good thing or a bad thing.

So now I need to investigate the Java security a little more.
 
Old 05-02-2007, 02:16 AM   #6
laundry_day
LQ Newbie
 
Registered: May 2007
Posts: 9

Original Poster
Rep: Reputation: 0
Progress. I stumbled across this tutorial about Nutch and Debian Etch. It has some code that is suppose to be added to the policy file located at /etc/tomcat5.5/policy.d/04webapps.policy . The code is:

Code:
grant codeBase "file:/usr/share/tomcat5.5-webapps/-" { 
    permission java.util.PropertyPermission "user.dir", "read";
    permission java.util.PropertyPermission "java.io.tmpdir", "read,write";
    permission java.util.PropertyPermission "org.apache.*", "read,execute";
    permission java.io.FilePermission "/usr/local/nutch/crawls/-" , "read";
    permission java.io.FilePermission "/var/lib/tomcat5.5/temp", "read";
    permission java.io.FilePermission "/var/lib/tomcat5.5/temp/-", "read,write,execute,delete";
    permission java.lang.RuntimePermission "createClassLoader", "";
    permission java.security.AllPermission;
    };
After restarting tomcat a search could be performed without errors. BUT no results were found (unlike searches using the terminal inside the nutch dirctory). All I need to do now is figure out how to point Tomcat to the right crawl directory. I guess.

Thanks for your help, jay73. You were right, it was about permissions.

Edit: Solved. The tutorial above mentions placing a searcher.dir variable (pointing back to the nutch crawl directory - /usr/local/nutch/crawl ) inside a nutch-site.xml file. I found the file within /usr/share/tomcat5.5-webapps/ROOT/WEB-INF/classes/ folder and added:

Code:
<name>searcher.dir</name> 
<value>/usr/local/nutch/crawl</value>
Still no change. So I opened a file in the same classes directory called nutch-default.xml and hidden within that file was a variable for searcher.dir. I changed the <value> to point to the nutch crawl directory, restarted Tomcat again, and WALLA! Complete searches!

Hopefully this will help if anyone else tries to get Nutch running on Debian Etch. Thanks!

Last edited by laundry_day; 05-02-2007 at 02:45 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with nutch 0.7.1 in suse 9.2 hk- Linux - Software 0 11-14-2005 02:50 PM
Java, apache, tomcat @ngelot Linux - Software 0 11-03-2005 05:55 AM
JAVA and TOMCAT problem : Broken Pipe fellsin Linux - Software 1 01-13-2005 01:47 AM
run java and tomcat varunbihani Linux - Software 2 09-17-2003 04:05 AM
java ant tomcat j-ray Linux - Software 1 09-12-2002 11:59 AM


All times are GMT -5. The time now is 02:05 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration