我正在尝试使用Java设置网络超时我的Oracle数据库连接.但是,我收到了一个错误.下面是示例代码,它是相应的例外.
try{
conn = new Database("oracle").connect();
conn.setNetworkTimeout(null, 30000); //I don't have an Executor, so the field is set to null
System.out.println(Switch.date() + " -> Database Connection Initialized");
}
catch(SQLException ex){
Logger.getLogger(Switch.class.getName()).log(Level.SEVERE, null, ex);
}
Run Code Online (Sandbox Code Playgroud)
我得到的例外是:
Exception in thread "main" java.lang.AbstractMethodError:oracle.jdbc.driver.T4CConnection.setNetworkTimeout(Ljava/util/concurrent/Executor;I)V
at ke.co.smart.Switch.<init>(Switch.java:524)
at ke.co.smart.Switch.main(Switch.java:161)
Java Result: 1
Run Code Online (Sandbox Code Playgroud)
我认为它与抽象方法有关(读取AbstractMethodError).什么可能导致这个错误,因为我只实现了我认为已经在Java中定义的方法,因此,不拒绝编译.
注意:如果有抽象方法,Java不允许编译具体类.
尝试在更新我的应用程序以使用WebRTC 的本机库(libjingle_peerconnection_so.so到 arm64-v8a)支持 64 位后发送文本消息,消息传递给接收器,但 logcat 打印一堆错误消息有什么想法吗?
发送方设备的 logcat 输出:
E/libjingle: (apm_helpers.cc:67): Failed to set AGC mode in ADM: 1
E/libjingle: (adm_helpers.cc:47): Unable to set recording channel to kChannelBoth.
E/libjingle: (adm_helpers.cc:65): Failed to set stereo recording mode.
E/libjingle: (adm_helpers.cc:109): Failed to set stereo playout mode.
E/libjingle: (webrtcsession.cc:1319): AddSctpDataStream called when sctp_transport_ is NULL.
E/libjingle: (stunport.cc:506): sendto : [0x00000016] Invalid argument
E/libjingle: (turnport.cc:724): Jingle:Port[0x5596dbe130:data:1:0:relay:Net[lo:127.0.0.0/8:Loopback]]: Failed to send TURN message, err=22
E/libjingle: (stunport.cc:506): sendto : [0x00000016] …Run Code Online (Sandbox Code Playgroud) 使用 Gradle 编译 Android 应用程序时,如何确定要使用哪个 Java 版本?例如,我的 gradle 构建文件的一些片段如下所示:
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
// Other settings
defaultConfig {
applicationId "com.example"
minSdkVersion 15
targetSdkVersion 22
// Other default settings
}
}
Run Code Online (Sandbox Code Playgroud)
Android SDK 版本 19 及更高版本(即 KitKat 及更高版本)支持 Java SE 7。根据上面的代码片段,我如何确定应该使用 Java SE 7 还是 Java SE 6 来实现编译和源代码兼容性?
我可以在本地将我的应用程序发布到 S3 存储桶并且应用程序可以正常工作。但是通过 AWS Amplify 控制台 (web) 部署在后端的 Build 步骤失败。
由于缺少配置文件或目录,后端的构建步骤失败。
{
Error: ENOENT: no such file or directory, scandir '/codebuild/output/src145745747/src/aws-service-catalog/amplify/backend/auth/cognito8f0f2f1d'
at Object.fs.readdirSync (fs.js:904:18)
at getCfnFiles (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js:337:20)
at updateS3Templates (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js:350:39)
at packageResources.then.then.then.then (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js:42:17)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:229:7)
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: '/codebuild/output/src145745747/src/aws-service-catalog/amplify/backend/auth/cognito8f0f2f1d'
}
Run Code Online (Sandbox Code Playgroud)
有人有如何调试/解决此问题的提示吗?
在此示例中,如果满足第一个条件,则编译器是否测试了另一个条件?
a = 10
if (a % 2 == 0 || a / 2 == 5 || a == 10)
echo 'hello world'
Run Code Online (Sandbox Code Playgroud) android ×2
java ×2
aws-amplify ×1
build-tools ×1
c ×1
database ×1
error-list ×1
javascript ×1
jdbc ×1
oracle ×1
reactjs ×1
webrtc ×1