I'm trying to use the native-image-maven-plugin to build a Java project but I'm getting the following error:
[ERROR] Failed to execute goal com.oracle.substratevm:native-image-maven-plugin:19.1.0:native-image (default) on project yolo-parent: Execution default of goal com.oracle.substratevm:native-image-maven-plugin:19.1.0:native-image failed: A required class was missing while executing com.oracle.substratevm:native-image-maven-plugin:19.1.0:native-image: jdk/vm/ci/services/Services
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.oracle.substratevm:native-image-maven-plugin:19.1.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/johndoe/.m2/repository/com/oracle/substratevm/native-image-maven-plugin/19.1.0/native-image-maven-plugin-19.1.0.jar
[ERROR] urls[1] = file:/Users/johndoe/.m2/repository/com/oracle/substratevm/svm-driver/19.1.0/svm-driver-19.1.0.jar
[ERROR] urls[2] = file:/Users/johndoe/.m2/repository/com/oracle/substratevm/library-support/19.1.0/library-support-19.1.0.jar
[ERROR] urls[3] = file:/Users/johndoe/.m2/repository/org/graalvm/sdk/graal-sdk/19.1.0/graal-sdk-19.1.0.jar
[ERROR] urls[4] = file:/Users/johndoe/.m2/repository/com/oracle/substratevm/svm/19.1.0/svm-19.1.0.jar
[ERROR] urls[5] = file:/Users/johndoe/.m2/repository/com/oracle/substratevm/svm-hosted-native-linux-amd64/19.1.0/svm-hosted-native-linux-amd64-19.1.0.tar.gz
[ERROR] urls[6] = file:/Users/johndoe/.m2/repository/com/oracle/substratevm/svm-hosted-native-darwin-amd64/19.1.0/svm-hosted-native-darwin-amd64-19.1.0.tar.gz
[ERROR] urls[7] = file:/Users/johndoe/.m2/repository/com/oracle/substratevm/svm-hosted-native-windows-amd64/19.1.0/svm-hosted-native-windows-amd64-19.1.0.tar.gz
[ERROR] urls[8] = file:/Users/johndoe/.m2/repository/com/oracle/substratevm/pointsto/19.1.0/pointsto-19.1.0.jar
[ERROR] urls[9] = file:/Users/johndoe/.m2/repository/org/graalvm/truffle/truffle-nfi/19.1.0/truffle-nfi-19.1.0.jar
[ERROR] urls[10] = file:/Users/johndoe/.m2/repository/org/graalvm/truffle/truffle-nfi-native-linux-amd64/19.1.0/truffle-nfi-native-linux-amd64-19.1.0.tar.gz
[ERROR] urls[11] = file:/Users/johndoe/.m2/repository/org/graalvm/truffle/truffle-nfi-native-linux-aarch64/19.1.0/truffle-nfi-native-linux-aarch64-19.1.0.tar.gz
[ERROR] urls[12] = file:/Users/johndoe/.m2/repository/org/graalvm/truffle/truffle-nfi-native-darwin-amd64/19.1.0/truffle-nfi-native-darwin-amd64-19.1.0.tar.gz
[ERROR] urls[13] = file:/Users/johndoe/.m2/repository/com/oracle/substratevm/objectfile/19.1.0/objectfile-19.1.0.jar
[ERROR] urls[14] = file:/Users/johndoe/.m2/repository/org/graalvm/compiler/compiler/19.1.0/compiler-19.1.0.jar
[ERROR] urls[15] = file:/Users/johndoe/.m2/repository/org/graalvm/truffle/truffle-api/19.1.0/truffle-api-19.1.0.jar
[ERROR] urls[16] = file:/Users/johndoe/.m2/repository/jline/jline/2.14.6/jline-2.14.6.jar
[ERROR] urls[17] = file:/Users/johndoe/.m2/repository/org/codehaus/plexus/plexus-archiver/3.3/plexus-archiver-3.3.jar
[ERROR] urls[18] = file:/Users/johndoe/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
[ERROR] urls[19] = file:/Users/johndoe/.m2/repository/org/codehaus/plexus/plexus-io/2.7.1/plexus-io-2.7.1.jar
[ERROR] urls[20] = file:/Users/johndoe/.m2/repository/commons-io/commons-io/2.5/commons-io-2.5.jar
[ERROR] urls[21] = file:/Users/johndoe/.m2/repository/org/apache/commons/commons-compress/1.11/commons-compress-1.11.jar
[ERROR] urls[22] = file:/Users/johndoe/.m2/repository/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
[ERROR] urls[23] = file:/Users/johndoe/.m2/repository/org/tukaani/xz/1.5/xz-1.5.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : jdk.vm.ci.services.Services
The jdk.vm.ci.services.Services should come from the JDK you are using to build the native image. You need to make sure the JAVA_HOME environment variable points to a GraalVM.
You can find useful information about using this plugin on this page.
Related
This is what I have so far:
m_dest_set_sel = maya.api.OpenMaya.MSelectionList()
m_dest_set_sel.add('lambert4SG')
m_dest_set_obj = m_dest_set_sel.getDependNode(0)
m_dest_set = maya.api.OpenMaya.MFnSet(m_dest_set_obj)
ss = maya.api.OpenMaya.MSelectionList()
ss.add('pCube3.f[2]')
m_dest_set.addMembers(ss)
And it gives me this error:
# Error: Cannot add the following items to the set since they would break the exclusivity constraint: pCube3.f[2] #
# Error: RuntimeError: file <maya console> line 1: (kFailure): Unexpected Internal Failure #
i tried removing it from the "initialShadingGroup" to no avail:
m_dest_set_sel = maya.api.OpenMaya.MSelectionList()
m_dest_set_sel.add('initialShadingGroup')
m_dest_set_obj = m_dest_set_sel.getDependNode(0)
m_dest_set = maya.api.OpenMaya.MFnSet(m_dest_set_obj)
ss = maya.api.OpenMaya.MSelectionList()
ss.add('pCube3.f[2]')
m_dest_set.removeMembers(ss)
# Error: RuntimeError: file <maya console> line 8: (kInvalidParameter): Cannot find item of required type #
This works for me:
import maya.api.OpenMaya as om2
m_dest_set_sel = om2.MSelectionList()
m_dest_set_sel.add('initialShadingGroup')
m_dest_set_obj = m_dest_set_sel.getDependNode(0)
m_dest_set = om2.MFnSet(m_dest_set_obj)
ss = om2.MSelectionList()
ss.add('pCubeShape1')
m_dest_set.removeMembers(ss)
m_dest_set_sel = om2.MSelectionList()
m_dest_set_sel.add('lambert2SG')
m_dest_set_obj = m_dest_set_sel.getDependNode(0)
m_dest_set = om2.MFnSet(m_dest_set_obj)
ss = om2.MSelectionList()
ss.add('pCube1.f[2]')
m_dest_set.addMembers(ss)
I want to use mssql in a vue-electron project.
I installed mssql with npm.
When i want to run the app, i get the following error:
ERROR Failed to compile with 2 errors
error in ./node_modules/mssql/lib/tedious/connection-pool.js
Module parse failed: Unexpected token (39:63)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| cfg.options.database = cfg.options.database || this.config.database
| cfg.options.port = cfg.options.port || this.config.port
> cfg.options.connectTimeout = cfg.options.connectTimeout ?? this.config.connectionTimeout ?? this.config.timeout ?? 15000
| cfg.options.requestTimeout = cfg.options.requestTimeout ?? this.config.requestTimeout ?? this.config.timeout ?? 15000
| cfg.options.tdsVersion = cfg.options.tdsVersion || '7_4'
# ./node_modules/mssql/lib/tedious/index.js 4:23-51
# ./node_modules/mssql/index.js
# ./src/modules/db.js
# ./src/background.js
# multi ./src/background.js
error in ./node_modules/mssql/lib/tedious/request.js
Module parse failed: Unexpected token (446:15)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| const req = new tds.Request(command, err => {
| // tedious v15 has started using AggregateErrors to wrap multiple errors into single error objects
> (err?.errors ? err.errors : [err]).forEach((e, i, { length }) => {
| // to make sure we handle no-sql errors as well
| if (e && (!errors.length || (errors.length && errors.length >= length && e.message !== errors[errors.length - length + i].message))) {
# ./node_modules/mssql/lib/tedious/index.js 6:16-36
# ./node_modules/mssql/index.js
# ./src/modules/db.js
# ./src/background.js
# multi ./src/background.js
Can someone please help me?
Trying to build my first app on react-native , of an existing project but unfortunately getting an error while building the app by react-native run-android
seems everything working fine but getting this error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-music-control:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
can anybody hints me whats wrong ?
Full error log =>
cd android && ./gradlew installDebug --stacktrace
Configure project :realm
WARNING: The following project options are deprecated and have been removed:
android.enableAapt2
This property has no effect, AAPT2 is now always used.
WARNING: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.0.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Task :react-native-music-control:compileDebugJavaWithJavac FAILED
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlModule.java:26: error: package androidx.media.app.NotificationCompat does not exist
import androidx.media.app.NotificationCompat.MediaStyle;
^
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:4: error: package androidx.media does not exist
import androidx.media.VolumeProviderCompat;
^
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:92: error: cannot find symbol
public static class VolumeListener extends VolumeProviderCompat {
^
symbol: class VolumeProviderCompat
location: class MusicControlListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlModule.java:122: error: incompatible types: VolumeListener cannot be converted to VolumeProviderCompat
session.setPlaybackToRemote(volume);
^
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlModule.java:135: error: cannot find symbol
nb.setStyle(new MediaStyle().setMediaSession(session.getSessionToken()));
^
symbol: class MediaStyle
location: class MusicControlModule
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlModule.java:298: error: cannot find symbol
int maxVol = info.hasKey("maxVolume") ? info.getInt("maxVolume") : volume.getMaxVolume();
^
symbol: method getMaxVolume()
location: variable volume of type VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlModule.java:299: error: cannot find symbol
int vol = info.hasKey("volume") ? info.getInt("volume") : volume.getCurrentVolume();
^
symbol: method getCurrentVolume()
location: variable volume of type VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlModule.java:323: error: incompatible types: VolumeListener cannot be converted to VolumeProviderCompat
session.setPlaybackToRemote(volume.create(null, maxVol, vol));
^
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlModule.java:385: error: incompatible types: VolumeListener cannot be converted to VolumeProviderCompat
if(remoteVolume) session.setPlaybackToRemote(volume);
^
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlModule.java:390: error: incompatible types: VolumeListener cannot be converted to VolumeProviderCompat
session.setPlaybackToRemote(volume);
^
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:96: error: cannot find symbol
super(changeable ? VOLUME_CONTROL_ABSOLUTE : VOLUME_CONTROL_FIXED, maxVolume, currentVolume);
^
symbol: variable VOLUME_CONTROL_ABSOLUTE
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:96: error: cannot find symbol
super(changeable ? VOLUME_CONTROL_ABSOLUTE : VOLUME_CONTROL_FIXED, maxVolume, currentVolume);
^
symbol: variable VOLUME_CONTROL_FIXED
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:101: error: cannot find symbol
return getVolumeControl() != VolumeProviderCompat.VOLUME_CONTROL_FIXED;
^
symbol: method getVolumeControl()
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:101: error: cannot find symbol
return getVolumeControl() != VolumeProviderCompat.VOLUME_CONTROL_FIXED;
^
symbol: variable VolumeProviderCompat
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:104: error: method does not override or implement a method from a supertype
#Override
^
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:106: error: cannot find symbol
setCurrentVolume(volume);
^
symbol: method setCurrentVolume(int)
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:110: error: method does not override or implement a method from a supertype
#Override
^
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:112: error: cannot find symbol
int maxVolume = getMaxVolume();
^
symbol: method getMaxVolume()
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:114: error: cannot find symbol
int volume = Math.max(Math.min(getCurrentVolume() + tick, maxVolume), 0);
^
symbol: method getCurrentVolume()
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:116: error: cannot find symbol
setCurrentVolume(volume);
^
symbol: method setCurrentVolume(int)
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:122: error: cannot find symbol
currentVolume = getCurrentVolume();
^
symbol: method getCurrentVolume()
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:124: error: cannot find symbol
setCurrentVolume(currentVolume);
^
symbol: method setCurrentVolume(Integer)
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:128: error: cannot find symbol
if(maxVolume == null) maxVolume = getMaxVolume();
^
symbol: method getMaxVolume()
location: class VolumeListener
/root/SCRIPTLOCATION/Social and Sharing/codecanyon-23049351-musicengine-mobile-applications/app/node_modules/react-native-music-control/android/src/main/java/com/tanguyantoine/react/MusicControlListener.java:130: error: cannot find symbol
if(changeable == isChangeable() && maxVolume == getMaxVolume()) return this;
^
symbol: method getMaxVolume()
location: class VolumeListener
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
24 errors
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-music-control:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':react-native-music-control:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:74)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.execute(DefaultTaskExecutionGraph.java:143)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:40)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:40)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:24)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:46)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:49)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:40)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:33)
at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:355)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:219)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:124)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:77)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:74)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:154)
at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:38)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:96)
at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:74)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildActionRunner.java:50)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:44)
at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:79)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:44)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:62)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:81)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:52)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:36)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:100)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:52)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:49)
at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:35)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:39)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:110)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:106)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:59)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:43)
at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:153)
at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:121)
at com.android.build.gradle.tasks.AndroidJavaCompile.compile(AndroidJavaCompile.kt:233)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
at
If you are using React Native >= 0.60 please ensure to migrate your dependencies from android.support to androidx by running npx jetify. Make sure that gradle.properties file contains following lines:
android.useAndroidX=true
android.enableJetifier=true
I would like to use Slick (3.2.3) to connect to a MSSQL database.
Currently, my project is the following.
In application.conf, I have
somedbname = {
driver = "slick.jdbc.SQLServerProfile$"
db {
host = "somehost"
port = "someport"
databaseName = "Recupel.Datawarehouse"
url = "jdbc:sqlserver://"${somedbname.db.host}":"${somedbname.db.port}";databaseName="${somedbname.db.databaseName}";"
user = "someuser"
password = "somepassword"
}
}
The "somehost" looks like XX.X.XX.XX where X's are numbers.
My build.sbt contains
name := "test-slick"
version := "0.1"
scalaVersion in ThisBuild := "2.12.7"
libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.2.3",
"com.typesafe.slick" %% "slick-hikaricp" % "3.2.3",
"org.slf4j" % "slf4j-nop" % "1.6.4",
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.0.0.jre10"
)
The file with the "main" object contains
import slick.basic.DatabaseConfig
import slick.jdbc.JdbcProfile
import slick.jdbc.SQLServerProfile.api._
import scala.concurrent.Await
import scala.concurrent.duration._
val dbConfig: DatabaseConfig[JdbcProfile] = DatabaseConfig.forConfig("somedbname")
val db: JdbcProfile#Backend#Database = dbConfig.db
def main(args: Array[String]): Unit = {
try {
val future = db.run(sql"SELECT * FROM somettable".as[(Int, String, String, String, String,
String, String, String, String, String, String, String)])
println(Await.result(future, 10.seconds))
} finally {
db.close()
}
}
}
This, according to all the documentation that I could find, should be enough to connect to the database. However, when I run this, I get
[error] (run-main-0) java.sql.SQLTransientConnectionException: somedbname.db - Connection is not available, request timed out after 1004ms.
[error] java.sql.SQLTransientConnectionException: somedbname.db - Connection is not available, request timed out after 1004ms.
[error] at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:548)
[error] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:186)
[error] at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:145)
[error] at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:83)
[error] at slick.jdbc.hikaricp.HikariCPJdbcDataSource.createConnection(HikariCPJdbcDataSource.scala:14)
[error] at slick.jdbc.JdbcBackend$BaseSession.<init>(JdbcBackend.scala:453)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:46)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.createSession(JdbcBackend.scala:37)
[error] at slick.basic.BasicBackend$DatabaseDef.acquireSession(BasicBackend.scala:249)
[error] at slick.basic.BasicBackend$DatabaseDef.acquireSession$(BasicBackend.scala:248)
[error] at slick.jdbc.JdbcBackend$DatabaseDef.acquireSession(JdbcBackend.scala:37)
[error] at slick.basic.BasicBackend$DatabaseDef$$anon$2.run(BasicBackend.scala:274)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] at java.base/java.lang.Thread.run(Thread.java:844)
[error] Nonzero exit code: 1
Perhaps related and also annoying, when I run this code for the second (and subsequent) times, I get the following error instead:
Failed to get driver instance for jdbcUrl=jdbc:sqlserver://[...]
which forces me to kill and reload sbt each time.
What am I doing wrong? Worth noting: I can connect to the database with the same credential from a software like valentina.
As suggested by #MarkRotteveel, and following this link, I found a solution.
First, I explicitly set the driver, adding the line
driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
in the db dictionary, after password = "somepassword".
Secondly, the default timeout (after one second) appears to be too short for my purposes, and therefore I added the line
connectionTimeout = "30 seconds"
after the previous driver line, still in the db dictionary.
Now it works.
I have two streams:
Measurements
WhoMeasured (metadata about who took the measurement)
These are the case classes for them:
case class Measurement(var value: Int, var who_measured_id: Int)
case class WhoMeasured(var who_measured_id: Int, var name: String)
The Measurement stream has a lot of data. The WhoMeasured stream has little. In fact, for each who_measured_id in the WhoMeasured stream, only 1 name is relevant, so old elements can be discarded if one with the same who_measured_id arrives. This is essentially a HashTable that gets filled by the WhoMeasured stream.
In my custom window function
class WFunc extends WindowFunction[Measurement, Long, Int, TimeWindow] {
override def apply(key: Int, window: TimeWindow, input: Iterable[Measurement], out: Collector[Long]): Unit = {
// Here I need access to the WhoMeasured stream to get the name of the person who took a measurement
// The following two are equivalent since I keyed by who_measured_id
val name_who_measured = magic(key)
val name_who_measured = magic(input.head.who_measured_id)
}
}
This is my job. Now as you might see, there is something missing: The combination of the two streams.
val who_measured_stream = who_measured_source
.keyBy(w => w.who_measured_id)
.countWindow(1)
val measurement_stream = measurements_source
.keyBy(m => m.who_measured_id)
.timeWindow(Time.seconds(60), Time.seconds(5))
.apply(new WFunc)
So in essence this is sort of a lookup table that gets updated when new elements in the WhoMeasured stream arrive.
So the question is: How to achieve such a lookup from one WindowedStream into another?
Follow Up:
After implementing in the way Fabian suggested, the job always fails with some sort of serialization issue:
[info] Loading project definition from /home/jgroeger/Code/MeasurementJob/project
[info] Set current project to MeasurementJob (in build file:/home/jgroeger/Code/MeasurementJob/)
[info] Compiling 8 Scala sources to /home/jgroeger/Code/MeasurementJob/target/scala-2.11/classes...
[info] Running de.company.project.Main dev MeasurementJob
[error] Exception in thread "main" org.apache.flink.api.common.InvalidProgramException: The implementation of the RichCoFlatMapFunction is not serializable. The object probably contains or references non serializable fields.
[error] at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:100)
[error] at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.clean(StreamExecutionEnvironment.java:1478)
[error] at org.apache.flink.streaming.api.datastream.DataStream.clean(DataStream.java:161)
[error] at org.apache.flink.streaming.api.datastream.ConnectedStreams.flatMap(ConnectedStreams.java:230)
[error] at org.apache.flink.streaming.api.scala.ConnectedStreams.flatMap(ConnectedStreams.scala:127)
[error] at de.company.project.jobs.MeasurementJob.run(MeasurementJob.scala:139)
[error] at de.company.project.Main$.main(Main.scala:55)
[error] at de.company.project.Main.main(Main.scala)
[error] Caused by: java.io.NotSerializableException: de.company.project.jobs.MeasurementJob
[error] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
[error] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
[error] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
[error] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[error] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[error] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
[error] at org.apache.flink.util.InstantiationUtil.serializeObject(InstantiationUtil.java:301)
[error] at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:81)
[error] ... 7 more
java.lang.RuntimeException: Nonzero exit code returned from runner: 1
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last MeasurementJob/compile:run for the full output.
[error] (MeasurementJob/compile:run) Nonzero exit code returned from runner: 1
[error] Total time: 9 s, completed Nov 15, 2016 2:28:46 PM
Process finished with exit code 1
The error message:
The implementation of the RichCoFlatMapFunction is not serializable. The object probably contains or references non serializable fields.
However, the only field my JoiningCoFlatMap has is the suggested ValueState.
The signature looks like this:
class JoiningCoFlatMap extends RichCoFlatMapFunction[Measurement, WhoMeasured, (Measurement, String)] {
I think what you want to do is a window operation followed by a join.
You can implement the a join of a high-volume stream and a low-value update-by-key stream using a stateful CoFlatMapFunction as in the example below:
val measures: DataStream[Measurement] = ???
val who: DataStream[WhoMeasured] = ???
val agg: DataStream[(Int, Long)] = measures
.keyBy(_._2) // measured_by_id
.timeWindow(Time.seconds(60), Time.seconds(5))
.apply( (id: Int, w: TimeWindow, v: Iterable[(Int, Int, String)], out: Collector[(Int, Long)]) => {
// do your aggregation
})
val joined: DataStream[(Int, Long, String)] = agg
.keyBy(_._1) // measured_by_id
.connect(who.keyBy(_.who_measured_id))
.flatMap(new JoiningCoFlatMap)
// CoFlatMapFunction
class JoiningCoFlatMap extends RichCoFlatMapFunction[(Int, Long), WhoMeasured, (Int, Long, String)] {
var names: ValueState[String] = null
override def open(conf: Configuration): Unit = {
val stateDescrptr = new ValueStateDescriptor[String](
"whoMeasuredName",
classOf[String],
"" // default value
)
names = getRuntimeContext.getState(stateDescrptr)
}
override def flatMap1(a: (Int, Long), out: Collector[(Int, Long, String)]): Unit = {
// join with state
out.collect( (a._1, a._2, names.value()) )
}
override def flatMap2(w: WhoMeasured, out: Collector[(Int, Long, String)]): Unit = {
// update state
names.update(w.name)
}
}
A note on the implementation: A CoFlatMapFunction cannot decide which input to process, i.e., the flatmap1 and flatmap2 functions are called depending on what data arrives at the operator. It cannot be controlled by the function. This is a problem when initializing the state. In the beginning, the state might not have the correct name for an arriving Measurement object but return the default value. You can avoid that by buffering the measurements and joining them once, the first update for the key from the who stream arrives. You'll need another state for that.