List Info

Thread: Newbie: jsp java.lang.NoClassDefFoundError




Newbie: jsp java.lang.NoClassDefFoundError
country flaguser name
United States
2007-10-06 09:25:34
Hello,

I am trying to create a jsp which accesses a class which
accesses a
lucene index.
When I develop an run the project locally using eclipse
everything
works fine.

As soon as I deploy the war file and try to access the page
I get
following exception:

SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NoClassDefFoundError
        at LuceneIndexer.Indexer.initIndex(Indexer.java:76)
        at LuceneIndexer.Indexer.startup(Indexer.java:66)
        at
org.apache.jsp.Test_jsp._jspService(Test_jsp.java:58)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.ja
va:97)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:
802)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServl
etWrapper.java:
334)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServl
et.java:
314)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java
:264)
        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:
802)
        at
sun.reflect.GeneratedMethodAccessor49.invoke(Unknown
Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAccessorImpl.java:
25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.catalina.security.SecurityUtil
$1.run(SecurityUtil.java:243)
        at
java.security.AccessController.doPrivileged(Native Method)
        at
javax.security.auth.Subject.doAsPrivileged(Subject.java:
517)
        at
org.apache.catalina.security.SecurityUtil.execute(SecurityUt
il.java:
275)
        at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(Secu
rityUtil.java:
161)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi
lter(ApplicationFilterChain.java:
245)
        at
org.apache.catalina.core.ApplicationFilterChain.access
$0(ApplicationFilterChain.java:177)
        at org.apache.catalina.core.ApplicationFilterChain
$1.run(ApplicationFilterChain.java:156)
        at
java.security.AccessController.doPrivileged(Native Method)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App
licationFilterChain.java:
152)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar
dWrapperValve.java:
213)
        at
org.apache.catalina.core.StandardContextValve.invoke(Standar
dContextValve.java:
178)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo
stValve.java:
126)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo
rtValve.java:
105)
        at
org.apache.catalina.core.StandardEngineValve.invoke(Standard
EngineValve.java:
107)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd
apter.java:
148)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Proce
ssor.java:
869)
        at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtoco
l.java:
664)
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Poo
lTcpEndpoint.java:
527)
        at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:
80)
        at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)


The line which causes the error is Directory dir =
FSDirectory.getDirectory(indexDir);

So it seems as if FSDirectory can't be found but I have the
lucene jar
file inside the webapps lib directory and it also works on
eclipse.
Inside the class I have
import org.apache.lucene.store.*;

It seems as if the class has another context and path as the
jsp and
has no access to the jar files inside /lib.

I am sure that this is quite a simple problem - Can anyone
help me
out?

Thanks in advance

--
Daniel Khan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Apache Tomcat" group.
To post to this group, send email to Apache-Tomcatgooglegroups.com
To unsubscribe from this group, send email to
Apache-Tomcat-unsubscribegooglegroups.com
For more options, visit this group at ht
tp://groups.google.com/group/Apache-Tomcat?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )