java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()L

在MAVEN项目里面,在整合spring和mybatis在执行数据库操作的时候报出了:

java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()L错误

在网上搜的大多说是jar包版本不兼容的问题。但想想,不应该啊,这是他们原有的系统,难道有做过升级吗,最后尝试着把版本升级了下,还真是版本兼容出了问题。

复制代码
 1 Exception in thread "main" java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer;
 2 at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85)
 3 at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
 4 at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
 5 at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
 6 at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
 7 at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
 8 at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
 9 at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
10 at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)
11 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
13 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
14 at java.lang.reflect.Method.invoke(Unknown Source)
15 at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
16 at com.sun.proxy.$Proxy8.selectOne(Unknown Source)
复制代码


更正后的依赖关系为:

复制代码
<properties>
    <springframework.version>3.2.9.RELEASE</springframework.version>
    <mybatis-spring.version>1.3.0</mybatis-spring.version>
    <mybatis.version>3.3.0</mybatis.version>
    <mysql-connector-java.version>5.1.37</mysql-connector-java.version>
</properties>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>${springframework.version}</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
    <version>${springframework.version}</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>${springframework.version}</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>${springframework.version}</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>${springframework.version}</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>${springframework.version}</version>
</dependency>
<dependency>
    <groupId>org.mybatis</groupId>
    <artifactId>mybatis-spring</artifactId>
    <version>${mybatis-spring.version}</version>
</dependency>
复制代码

大致导致这个问题的原意就是版本的问题, 将上面的mybatis-spring版本改为1.3.0即可.具体细节还有待去发现.

文章转载自:https://www.cnblogs.com/molao-doing/p/6056380.html

阅读更多

java.lang.AbstractMethodError

09-25

莫名其妙的rnrn Struts has detected an unhandled exception:rnMessages: rncom.hcger.service.UserServiceImpl.findUserListByCondtions(IIIIIII)Ljava/util/List;rnrnrnrnrnrn [color=#FF0000]java.lang.AbstractMethodError: com.hcger.service.UserServiceImpl.findUserListByCondtions(IIIIIII)Ljava/util/List;[/color]rnrn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)rn org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)rn org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)rn $Proxy7.findUserListByCondtions(Unknown Source)rn com.hcger.user.action.SearchFrendsByConditionsAction.execute(SearchFrendsByConditionsAction.java:44)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:510)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn com.hcger.util.RightManagerFilter.doFilter(RightManagerFilter.java:41)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)rn org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)rn org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)rn java.lang.Thread.run(Thread.java:619)rn rn用的struts2 hibernate3 spring3rn不知道怎么回事 rnjava.lang.AbstractMethodError: com.hcger.service.UserServiceImpl.findUserListByCondtions(IIIIIII)Ljava/util/List; rn开始的时候问题,我改了下方法里的hql语句就抛错,出错后,我把findUserListByCondtions方法里代码都删了,还是抛错,rn我在findUserListByCondtions方法只写个System.out.println("123");也不打印,说明根本没调到方法,好几个小时了,找到相同的问题,但都没得到解决,希望得到帮助;

java.lang.AbstractMethodError: ??

11-14

ERROR [localhost-startStop-1] - Unable to read class [.action.LoginActionTest]rnjava.lang.AbstractMethodError: com.opensymphony.xwork2.util.finder.ClassFinder$InfoBuildingVisitor.visitFrame(II[Ljava/lang/Object;I[Ljava/lang/Object;)Vrn at org.objectweb.asm.ClassReader.accept(Unknown Source)rn at org.objectweb.asm.ClassReader.accept(Unknown Source)rn at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:780)rn at com.opensymphony.xwork2.util.finder.ClassFinder.access$500(ClassFinder.java:59)rn at com.opensymphony.xwork2.util.finder.ClassFinder$InfoBuildingVisitor.extractSuperInterfaces(ClassFinder.java:830)rn at com.opensymphony.xwork2.util.finder.ClassFinder$InfoBuildingVisitor.visit(ClassFinder.java:817)rn at org.objectweb.asm.ClassReader.accept(Unknown Source)rn at org.objectweb.asm.ClassReader.accept(Unknown Source)rn at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:780)rn at com.opensymphony.xwork2.util.finder.ClassFinder.(ClassFinder.java:165)rn at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:376)rn at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:334)rn at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)rn at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:215)rn at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)rn at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)rn at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)rn at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)rn at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)rn at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)rn at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)rn at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4809)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5485)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:744)

换一批

ssh+oracle+resin下的java.lang.AbstractMethodError错误

11-11

我用的环境是Struts+Spring+hibernate架构。rnweb server: Apache/2.0.58 + Resin/3.0.17rn数据库:oracle 9.2 编码 us7asciirnjdk: 1.5rn开发工具,eclipse3.1+myEclispe4.0rnrn在配置完环境我打开项目时发现了这个错误:rnjava.lang.AbstractMethodError: org.springframework.orm.hibernate.HibernateTransactionObject.isRollbackOnly()Zrn at org.springframework.transaction.support.DefaultTransactionStatus.isGlobalRollbackOnly(DefaultTransactionStatus.java:154)rn at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:664)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)rn at $Proxy21.initSecurity(Unknown Source)rn at jaoso.framework.web.servlet.StartSpring.init(StartSpring.java:40)rn at javax.servlet.GenericServlet.init(GenericServlet.java:69)rn at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:600)rn at com.caucho.server.dispatch.ServletManager.init(ServletManager.java:152)rn at com.caucho.server.webapp.Application.start(Application.java:1599)rn at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:579)rn at com.caucho.server.deploy.DeployController.restartImpl(DeployController.java:542)rn at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.request(StartAutoRedeployAutoStrategy.java:125)rn at com.caucho.server.deploy.DeployController.request(DeployController.java:512)rn at com.caucho.server.webapp.ApplicationContainer.getApplication(ApplicationContainer.java:847)rn at com.caucho.server.webapp.ApplicationContainer.buildInvocation(ApplicationContainer.java:687)rn at com.caucho.server.host.Host.buildInvocation(Host.java:421)rn at com.caucho.server.host.HostContainer.buildInvocation(HostContainer.java:316)rn at com.caucho.server.resin.ServletServer.buildInvocation(ServletServer.java:582)rn at com.caucho.server.dispatch.DispatchServer.buildInvocation(DispatchServer.java:198)rn at com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:414)rn at com.caucho.server.port.TcpConnection.run(TcpConnection.java:388)rn at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)rn at com.caucho.util.ThreadPool.run(ThreadPool.java:423)rn at java.lang.Thread.run(Thread.java:595)rn我换了classes12.jar和ojdbc.jar两个驱动都不行,超级郁闷啊。。希望哪位高人能解答啊。。谁只要能回答出来。。分数全部归谁。。rn这个项目在我同事那都能用。。在我这却不行。。

java.lang.AbstractMethodError: createStatement这个异常?

04-10

java.lang.AbstractMethodError: createStatementrn at COM.ibm.db2.jdbc.app.DB2Connection.createStatement(II)Ljava.sql.Statement;(DB2Connection.java:???)rn at weblogic.jdbc.wrapper.Connection.createStatement(II)Ljava.sql.Statement;(Connection.java:345)rn at BSC.tree.pagetag.PageDataBean.init(Ljava.sql.Connection;)V(PageDataBean.java:37)rn at BSC.tree.PageScriptTag.doEndTag()I(PageScriptTag.java:140)rn at jsp_servlet._basic.__basic0004q._jspService(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(__basic0004q.java:320)rn at weblogic.servlet.jsp.JspBase.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(JspBase.java:33)rn at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;(ServletStubImpl.java:1006)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:419)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:463)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(ServletStubImpl.java:315)rn at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava.lang.Object;(WebAppServletContext.java:6718)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(AuthenticatedSubject.java:321)rn at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(SecurityManager.java:121)rn at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic.servlet.internal.ServletRequestImpl;Lweblogic.servlet.internal.ServletResponseImpl;)V(WebAppServletContext.java:3764)rn at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic.kernel.ExecuteThread;)V(ServletRequestImpl.java:2644)rn at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(ExecuteThread.java:219)rn at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:178)rn at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)rn客户那边的环境会出现这样的问题,我自己这边没有,看了所有配置好像没什么不一样哦!  请大虾样帮忙看一下。

lucene3.4下IKAnalyzer2012的java.lang.AbstractMethodError错误

04-08

不知哪位大神可以帮我看看是哪里的问题rnrnrn这是错误rnException in thread "main" java.lang.AbstractMethodError: org.apache.lucene.analysis.Analyzer.tokenStream(Ljava/lang/String;Ljava/io/Reader;)Lorg/apache/lucene/analysis/TokenStream;rn at org.apache.lucene.analysis.Analyzer.reusableTokenStream(Analyzer.java:78)rn at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:126)rn at org.apache.lucene.index.DocFieldProcessorPerThread.processDocument(DocFieldProcessorPerThread.java:278)rn at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:766)rn at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2067)rn at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:2041)rn at cutword.Cut.main(Cut.java:82)rnrnrnrn这是源码(IKAnalyzer2012的样例)rn/**rn * IK 中文分词 版本 5.0rn * IK Analyzer release 5.0rn *rn * Licensed to the Apache Software Foundation (ASF) under one or morern * contributor license agreements. See the NOTICE file distributed withrn * this work for additional information regarding copyright ownership.rn * The ASF licenses this file to You under the Apache License, Version rn2.0rn * (the "License"); you may not use this file except in compliance withrn * the License. You may obtain a copy of the License atrn *rn * http://www.apache.org/licenses/LICENSE-2.0rn *rn * Unless required by applicable law or agreed to in writing, softwarern * distributed under the License is distributed on an "AS IS" BASIS,rn * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.rn * See the License for the specific language governing permissions andrn * limitations under the License.rn *rn * 源代码由林良益(linliangyi2005@gmail.com)提供rn * 版权声明 2012,乌龙茶工作室rn * provided by Linliangyi and copyright 2012 by Oolong studiorn *rn *rn */rnpackage cutword;rnrnimport java.io.IOException;rnimport org.apache.lucene.analysis.Analyzer;rnimport org.apache.lucene.document.Document;rnimport org.apache.lucene.document.Field;rnimport org.apache.lucene.index.CorruptIndexException;rnimport org.apache.lucene.index.IndexReader;rnimport org.apache.lucene.index.IndexWriter;rnimport org.apache.lucene.index.IndexWriterConfig;rnimport org.apache.lucene.index.IndexWriterConfig.OpenMode;rnimport org.apache.lucene.queryParser.ParseException;rnimport org.apache.lucene.queryParser.QueryParser;rnimport org.apache.lucene.search.IndexSearcher;rnimport org.apache.lucene.search.Query;rnimport org.apache.lucene.search.ScoreDoc;rnimport org.apache.lucene.search.TopDocs;rnimport org.apache.lucene.store.Directory;rnimport org.apache.lucene.store.LockObtainFailedException;rnimport org.apache.lucene.store.RAMDirectory;rnimport org.apache.lucene.util.Version;rnimport org.wltea.analyzer.lucene.IKAnalyzer;rnrn/**rn * IKAnalyzer 示例 2012-3-2rn *rn * 以下是结合Lucene3.4 API的写法rn *rn */rnpublic class Cut rn public static void main(String[] args) rn // Lucene Document的域名rn String fieldName = "text";rn // 检索内容rn String text = "IK Analyzer是一个结合词典分词和文法分词的中文分词开源工具包。它使用了全新的正向迭代最细粒度切分算法。";rn // 实例化IKAnalyzer分词器rn Analyzer analyzer = new IKAnalyzer();rn Directory directory = null;rn IndexWriter iwriter = null;rn IndexReader ireader = null;rn IndexSearcher isearcher = null;rn try rn // 建立内存索引对象rn directory = new RAMDirectory();rn // 配置IndexWriterConfigrn IndexWriterConfig iwConfig = new IndexWriterConfig(rn Version.LUCENE_34, analyzer);rn iwConfig.setOpenMode(OpenMode.CREATE_OR_APPEND);rn iwriter = new IndexWriter(directory, iwConfig);rn // 写入索引rn Document doc = new Document();rn doc.add(new Field("ID", "10000", Field.Store.YES,rn Field.Index.NOT_ANALYZED));rn doc.add(new Field(fieldName, text, Field.Store.YES,rn Field.Index.ANALYZED));rn iwriter.addDocument(doc);rn iwriter.close();rn // 搜索过程**********************************rn // 实例化搜索器rn ireader = IndexReader.open(directory);rn isearcher = new IndexSearcher(ireader);rn String keyword = "中文分词工具包";rn // 使用QueryParser查询分析器构造Query对象rn QueryParser qp = new QueryParser(Version.LUCENE_34, fieldName,rn analyzer);rn qp.setDefaultOperator(QueryParser.AND_OPERATOR);rn Query query = qp.parse(keyword);rn // 搜索相似度最高的5条记录rn TopDocs topDocs = isearcher.search(query, 5);rn System.out.println("命中:" + topDocs.totalHits);rn // 输出结果rn ScoreDoc[] scoreDocs = topDocs.scoreDocs;rn for (int i = 0; i < topDocs.totalHits; i++) rn Document targetDoc = isearcher.doc(scoreDocs[i].doc);rn System.out.println("内容:" + targetDoc.toString());rn rn catch (CorruptIndexException e) rn e.printStackTrace();rn catch (LockObtainFailedException e) rn e.printStackTrace();rn catch (IOException e) rn e.printStackTrace();rn catch (ParseException e) rn e.printStackTrace();rn finally rn if (ireader != null) rn try rn ireader.close();rn catch (IOException e) rn e.printStackTrace();rn rn rn if (directory != null) rn try rn directory.close();rn catch (IOException e) rn e.printStackTrace();rn rn rn rn rnrnrnrnrnrnrn

java.lang.AbstractMethodError问题 高手解决一下

11-21

HTTP Status 500 -rnrntype Exception reportrnrnmessagernrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexceptionrnrnjavax.servlet.ServletException: Servlet.init() for servlet action threw exceptionrn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)rn org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:843)rn org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:679)rn org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1293)rn java.lang.Thread.run(Thread.java:595)rnroot causernrnjava.lang.AbstractMethodError: net.sf.ehcache.hibernate.Provider.start(Ljava/util/Properties;)Vrn net.sf.hibernate.cfg.Configuration.configureCaches(Configuration.java:1133)rn net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:804)rn cn.com.sunjapan.sd.training.xudl.calendar.common.startup.HibernateInit.config(HibernateInit.java:77)rn cn.com.sunjapan.sd.training.xudl.calendar.common.startup.Startup.init(Startup.java:94)rn cn.com.sunjapan.sd.training.xudl.calendar.common.plugin.InitPlugin.init(InitPlugin.java:139)rn org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)rn org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)rn javax.servlet.GenericServlet.init(GenericServlet.java:212)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)rn org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:843)rn org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:679)rn org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1293)rn java.lang.Thread.run(Thread.java:595)rnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.31 logs.rnrnApache Tomcat/5.5.31rnrnhibernate.cfg.xmlrn[code=XML][/code]rnrnrnrn rn rn jdbc:oracle:thin:@127.0.0.1:1521:orclrn net.sf.hibernate.dialect.OracleDialectrn SYSTEM rn jxhrn oracle.jdbc.driver.OracleDriverrn rn net.sf.hibernate.connection.C3P0ConnectionProviderrn 10rn 5rn 5000rn 1000rn 3000rn 5rn 3000rn falsern truern 3rn falsern net.sf.ehcache.hibernate.Providerrn net.sf.hibernate.transaction.JDBCTransactionFactoryrnrn rn rn rn rn rn rn rn rn rn rn rn rnrnrn[code=XML][/code]rnrnrnehcache.xmlrn[code=XML][/code]rnrn rn rnrnrn[code=XML][/code]rn

没有更多推荐了,返回首页