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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/mxj588love/article/details/51192485
Exception in thread "main" java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout()Ljava/lang/Integer;
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)
at 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 org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
at com.sun.proxy.$Proxy8.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:163)
at com.platform.core.dao.DaoImpl.get(DaoImpl.java:35)
at com.platform.app.dao.SysUsersDAOImpl.checkUser(SysUsersDAOImpl.java:23)

at com.test.Test.main(Test.java:30)


我是用Maven构建项目的, 单元测试运行的时候报了以上错误, jar版本如下

<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.0</version>
</dependency>

<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.1</version>
</dependency>

导致这个问题的原意就是版本的问题, 将上面的mybatis-spring版本改为1.3.1即可

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) 论坛

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");也不打印,说明根本没调到方法,好几个小时了,找到相同的问题,但都没得到解决,希望得到帮助; 论坛

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 论坛

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