action中调用lucene的问题

问题描述

直接用main方法是可以查出数据的,但是一用action调就出现如下问题,由于小弟刚学lucene,哪位高手遇到过请赐教,谢谢!2011-09-06 15:40:57,156 INFO [com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor] - java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.sseinfonet.ib.util.advice.ParmeterInterceptor.intercept(ParmeterInterceptor.java:60)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)at java.lang.Thread.run(Unknown Source)Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzerat com.sseinfonet.ib.action.cn.infoDisclosure.CorporateNoticeAction.queryTitleByKeywords(CorporateNoticeAction.java:119)... 76 moreCaused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.Analyzerat org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)... 77 more 问题补充:Rainbow702 写道

解决方案

引用Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzerat 是不是JAR导入出错了?

时间: 2024-11-05 18:16:19

action中调用lucene的问题的相关文章

action 没有跳转-Action中调用另一个类中的方法时没有跳转,但是新建的其他测试类就可以跳转,WHY?

问题描述 Action中调用另一个类中的方法时没有跳转,但是新建的其他测试类就可以跳转,WHY? action中调用EmailUtil中的sendHtmlMail方法: public void forgetPassword() throws Exception { String email = request.getParameter("email"); User u=userService.getByEmail(email); Json json=new Json(); if (St

用strut2集成SSH框架Action中调用Dao层方法出现空指针异常

问题描述 自己弄了spring的配置文件,和strut的配置文件这个是服务层的代码publicclassSerservicesimplementsISerservices{privateICstServiceDAOServicedao;publicvoidsetDao(ICstServiceDAOServicedao){this.dao=dao;}publicvoidsave(CstServicebean){dao.save(bean);}}这个是Action的代码publicclassSerA

请各位大神帮我看看,struts2做的小项目,action中调用接口方法,显示nullpoint异常,可是单元测试方法没有问题啊

问题描述 这是接口publicinterfaceProvinceService{publicbooleanaddProvince(Provinceprovince);publicbooleandelProvince(Provinceprovince);publicList<Province>findAll();publicbooleanupdateProvince(Provinceprovince);publicList<Course>querryCourseByPro(Provi

动态调用Action与Action中方法(二)

其实有8动态调用Action与Action中方法(一)这第一种方法,这第二三种方法,就显示的不重要了,只能动态调用Action中方法 ,但这里也记一下 第二种方法 method="addUser",method="getUserList" Xml代码 <action name="addUser" class="ssh.org.web.UserAction" method="addUser"> &

ajax-web中在调用两个接口(有优先级)时,怎样将action中优先级高的参数返回?

问题描述 web中在调用两个接口(有优先级)时,怎样将action中优先级高的参数返回? 具体问题:是进行交易查询时,共5个入参,先调用验证接口(使用两个入参),在响应码为"1"的情况下调用查询接口,在获取查询结果的值是通过在html中使用ajax(ajax是写在js的function中的),现在我不知道的是当验证接口的响应码为"0"时怎样返回这个值,并在html中获取?不知道在action中代码怎么敲以及html中这是第一次写这方面的代码,对ajax等都不了解,希

如何在非action的普通java类中调用service和dao来操作数据库

问题描述 如何在非action的普通java类中调用service和dao来操作数据库 web程序用的框架是SSH的,在spring.xml中通过方式自动扫描service和dao,现有一个后台消息处理类,要在该类调用其他service和dao进行一些业务和数据库的操作,使用@Autowired private BaseDaoI baseDao;引用dao,在调用时报空指针错误,请教大神们该怎么解决. 解决方案 你所谓的"后台消息处理类"也的用注解标注它是一个Bean才行啊 解决方案二

javaweb-测试类中能调用方法,action中却不可以

问题描述 测试类中能调用方法,action中却不可以 用findByproperty做查询,在测试类中能调用该方法,但是在action中却不能调用 但是findById是可以用的,完全不知道是什么问题 解决方案 看下报什么错误呢?是不是方法没找到

为什么继承了actionsupport后不能调用action中的自定义方法

问题描述 为什么action继承了actionsupport后不能调用action中的自定义方法.调用execute方法就可以.先是用spring管理action.改成spring不管理action也不行.总是提示:找不到指定的方法错误.为什么?不继承actionsupport就不能用getText方法. 解决方案 估计你aop代理了造成的 贴出aop相关配置解决方案二:struts2,怎么可能...不清楚是你是怎么配置的 注解?xml?

动态调用Action与Action中方法(一)

Struts1提供了DispatchAction 实现一个Action中名含多个业务逻辑 现在我们使用Struts2 也可实现现样的效果,是使用通配符来实现的. struts.xml 文件中,常用 <action /> 的name ,class,method 三个属性都支持通配符 <resutl/> 也支持通配符 Xml代码 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE