java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z

处理java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z 报错

错误出现是使用spring boot构建web项目,在配置oracle数据库的时候,

配置文件:application.yml

spring:
  datasource:
    driver-class-name: oracle.jdbc.driver.OracleDriver
    url: jdbc:oracle:thin:@127.0.0.1:1521:xuexi
    username: HHxuexi1
    password: HHxuexi1
  jpa:
    hibernate:
      ddl-auto: update

 这样创建配置文件后,实体类也创建了,

启动时报错java.lang.AbstractMethodError: oracle.jdbc.driver.T4CConnection.isValid(I)Z 

    找了很久,发现被自己坑了,本地的maven中的oracle 驱动jar是ojdbc14,瞬间有种......

我将驱动jar 替换成ojdbc7后,问题解决






阅读更多
换一批

dbcp连接池问题java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z

07-13

java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Zrn at org.apache.commons.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:914)rn at org.apache.commons.dbcp2.PoolableConnection.validate(PoolableConnection.java:227)rn at org.apache.commons.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:303)rn at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2165)rn at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2148)rn at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:1903)rn at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1413)rn at com.tsc.util.JDBCTools.getConnection(JDBCTools.java:65)rn at test.TestJDBCTools.testJDBCTools(TestJDBCTools.java:13)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:601)rn at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)rn at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)rn at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:236)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rnrnrnrnrnrnrnrn private static final String configFile = "dbcp.properties";rn private static DataSource dataSource;rnrn rn static rn Properties prop = new Properties();rn try rn prop.load(JDBCTools.class.getClassLoader()rn .getResourceAsStream(configFile));rn dataSource = BasicDataSourceFactory.createDataSource(prop);rn catch (Exception e) rn e.printStackTrace();rn log.error("数据库连接池初始化失败" + e.getMessage());rn rn rn rn public JDBCTools() rn rnrn /**rn * 设置事务提交rn * @param connectionrn */rn public static void commit(Connection connection)rn if(connection != null)rn try rn connection.commit();rn catch (SQLException e) rn log.error("设置事务提交异常" + e.getMessage());rn rn rn rn rn /**rn * 使用dbcp数据库连接池获取数据库连接rn * rn * @return Connectionrn */rn public static final Connection getConnection() rn Connection conn = null;rn try rn conn = dataSource.getConnection();rn catch (SQLException e) rn e.printStackTrace();rn log.error("获取数据库连接失败" + e.getMessage());rn rn return conn;rn rn

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)

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