相关疑难解决方法(0)

尝试在db中加载blob时,为什么会出现java.lang.AbstractMethodError?

我遇到了JDBC问题.

我有以下代码:

//blargeparam is a blob column.
PreparedStatement pst =connection.prepareStatement("update gcp_processparams_log set blargeparam= ? where idprocessparamslog=1");

pst.setBinaryStream(1,inputStream);         
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

Exception in thread "main" java.lang.AbstractMethodError:           
oracle.jdbc.driver.T2CPreparedStatement.setBinaryStream(ILjava/io/InputStream;)V  
Run Code Online (Sandbox Code Playgroud)

我的连接字符串是 jdbc:oracle:oci:@.....

Oracle版本为11g.

从错误消息似乎缺少某些东西但是:

  • 当我从相同的blob列(使用blob.getBytes)读取时,一切正常.
  • 即时客户端的DLL(正确地)在库路径中.
  • 这是我的类路径中Oracle JDBC JAR的清单:

    Manifest-Version: 1.0  
    Specification-Title:    Oracle JDBC driver classes for use with JDK14  
    Sealed: true  
    Created-By: 1.4.2_14 (Sun Microsystems Inc.)  
    Implementation-Title:   ojdbc14.jar  
    Specification-Vendor:   Oracle Corporation  
    Specification-Version:  Oracle JDBC Driver version - "10.2.0.4.0"  
    Implementation-Version: Oracle JDBC Driver version - "10.2.0.4.0"  
    Implementation-Vendor:  Oracle Corporation  
    Implementation-Time:    Sat Feb  2 11:40:29 2008  
    
    Run Code Online (Sandbox Code Playgroud)

java database oracle jdbc oracleclient

45
推荐指数
3
解决办法
14万
查看次数

Spring Boot 2-自动连接服务时对Feign客户端的不满意依赖

我的情况很简单,我已经尝试了一些方法,但找不到导致此问题的原因。它声称它不能自动连接Feign客户端类,尽管这是我在Spring Boot 1.5.9中做到的。至少我很确定。尽管我在嘲笑此客户端,但在所有单元测试中一切正常。以前它是导入库的一部分,但是为了消除我可能无法正确定位Bean的可能性,我将其添加到了同一项目中。

我不是Spring或Feign方面最有经验的人,所以我想知道我在这里缺少什么。

简单的假冒客户:

@FeignClient(name = "my-other-service")
public interface OtherServiceClient {

    @GetMapping(value = "/foo/{fooId}")
    @ResponseBody
    String getFoo(@PathVariable int fooId);
}
Run Code Online (Sandbox Code Playgroud)

主应用程序类:@SpringBootApplication @EnableDiscoveryClient @EnableFeignClients //在其他模块中的公共类MyServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(MyServiceApplication.class, args);
    }
}
Run Code Online (Sandbox Code Playgroud)

取决于伪装客户端的服务:

@Service
public class FooService {
    private final FooRepository fooRepository;
    private final BarRepository barRepository;
    private OtherServiceClient otherServiceClient;

    @Autowired
    public OrderService(
            FooRepository fooRepository,
            BarRepository barRepository,
            OtherServiceClient otherServiceClient) {
        this.fooRepository= fooRepository;
        this.barRepository = barRepository;
        this.otherServiceClient = otherServiceClient;
    }
Run Code Online (Sandbox Code Playgroud)

由于这可能是自动配置,因此这里是配置报告:

============================
CONDITIONS EVALUATION REPORT
============================


Positive matches: …
Run Code Online (Sandbox Code Playgroud)

java spring spring-boot spring-cloud-feign

1
推荐指数
2
解决办法
6113
查看次数