|
JohnCodding wrote: If localhost is used, then the transfer is not limited to 3 MB/s.
I meant that 'localhost' and 'network' should not have the same speed.
A connection, any connection, goes through actual hardware.
So your speedtest is connecting to a computer somewhere.
You client test app is connecting to a different computer somewhere.
So something is throttling it.
Best way is to test your app with another app that you control. You need two boxes. They can be local but you could also spin on a cloud box. Probably ideal on the cloud (internet connected.)
If that test shows a speed limitation then it is your apps problem (with I doubt.)
If not then it indicates that something at the other end is probably throttling it.
Also possible that your service provider is throttling it. They are 'faking' the results with speedtest by explicitly looking for it. Or you might be hitting a data limit with your app that the document (or don't.)
|
|
|
|
|
I made an app (Windows only) with which you can create a backup of a folder/file locally or to a server. I'm done with the copy/restore process, but when it comes to restoring I have a small technical problem. If the file in originally hidden, then this is easy as you can call Files.setAttribute(file.toPath(), "dos:hidden", true); which will make the file hidden on client side after it is created/restored, but there are files like desktop.ini which aren't simply hidden but are system protected hidden and the above code will only give it the hidden status, and not system protected hidden.
There is also Files.getAttribute() but as the name suggests it only returns the attribute value for a single attribute, and not all of them to easily be able to do Files.setAttributes(file.toPath(), Files.getAttributes(file.toPath())); . So my question is, is there a way to get a list will all the attributes a file has and then setting them in a more dynamically way and not having to call Files.getAttribute(); / Files.setAttribute(); for each of them line by line? If unfortunately there isn't one, and you do have to set them line by line, can someone give me a list with all the attributes for Windows OS like there is here for example with DateTimeFormatter[^] for pattern symbols?
modified 26-Sep-23 3:34am.
|
|
|
|
|
|
This doesn't look all that hard to do in C++, which makes me believe that there might be a way to do it in Java as well. If it was locally only (on the same machine) then I could make a dll and copy the attribues that way as both the backup and restored files are on the same machine, but the app also has the Socket part and sending the C++ attributes might give a a headache when trying to crate the code, compared to just sending java objects.
Even so, this is good info, thanks!
|
|
|
|
|
I found a solution for the information when you open the Properties of a file, from the General tab, as for Details tab, that info it is copied with the file.
Example for General tab:
DosFileAttributes dos = Files.readAttributes(original.toPath(), DosFileAttributes.class);
DosFileAttributeView dosView = Files.getFileAttributeView(copy.toPath(), DosFileAttributeView.class);
dosView.setArchive(dos.isArchive());
dosView.setHidden(dos.isHidden());
dosView.setReadOnly(dos.isReadOnly());
dosView.setSystem(dos.isSystem());
dosView.setTimes(dos.lastModifiedTime(), dos.lastAccessTime(), dos.creationTime());
modified 26-Sep-23 3:05am.
|
|
|
|
|
Hi,
My Junit test cases are compiled and running fine with
'zerocode-tdd', version: '1.3.1'
'rest-assured', version: '2.9.0'
'JAVA' version '1.8.0'
'gradle' version '6.9.2
Now it is upgraded to
'zerocode-tdd', version: '1.3.33'
'rest-assured', version: '5.3.0'
'JAVA' version '1.11.0'
'gradle' version '8.0.2
My test is compiled. while running getting below error
Test _mytest FAILED
java.lang.RuntimeException: ZeroCode Step execution failed. Details:java.lang.NullPointerException
snippet of code is myTest.java
@Test
@JsonTestCase("zerocode/11_Test.zero")
public void _11_Test() throws Exception {}
Could you please suggest what is wrong.
Thanks in Advance
|
|
|
|
|
You've provided no details of the affected code, so we can't tell you precisely what the problem is.
All we can tell you is that a NullPointerException means that somewhere in your code you are trying to access a member of an object which has not been initialized, and is set to null .
You need to debug your code to find out what object is null when it shouldn't be. Then work out why it hasn't been initialized.
We can't do that for you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
here is the file 11_Test.zero
{
"scenarioName": "Cleanup dr network",
"steps": [
// source1
{
"name": "step1_source1",
"url": "com.storvisor.backup.TestPreconditions",
"operation": "drNetworkCleanup",
"request": {
"____test_step": "1a_p001_cleanup_network_step1_source1",
"X-OperationID": "${RANDOM.NUMBER}", // actually System.currentTimeMillis()
"stdatasvcmgr": "http://10.198.74.45:9339/stdatasvcmgr",
"user": "[:]",
"rootsessionid": "564d1ec7-b0ec-e9d0-445f-7455b4d1bcdd-12532"
},
"assertions": {
"result": true
}
},
// source2
{
"name": "step1_source2",
"url": "com.storvisor.backup.TestPreconditions",
"operation": "drNetworkCleanup",
"request": {
"____test_step": "1a_p001_cleanup_network_step1_source2",
"X-OperationID": "${RANDOM.NUMBER}", // actually System.currentTimeMillis()
"stdatasvcmgr": "http://10.198.73.61:9339/stdatasvcmgr",
"user": "[:]",
"rootsessionid": "564dc67c-1f45-7270-6795-32a72f436514-23376"
},
"assertions": {
"result": true
}
},
// target
{
"name": "step1_target",
"url": "com.storvisor.backup.TestPreconditions",
"operation": "drNetworkCleanup",
"request": {
"____test_step": "1a_p001_cleanup_network_step1_target",
"X-OperationID": "${RANDOM.NUMBER}", // actually System.currentTimeMillis()
"stdatasvcmgr": "http://10.198.73.67:9339/stdatasvcmgr",
"user": "[:]",
"rootsessionid": "564dc295-844a-89ad-091e-6033987ce14b-29868"
},
"assertions": {
"result": true
}
}
]
}
under zerocode directory
File :myTest.java
------------------
package com.storvisor.backup;
import static org.junit.Assert.*;
import org.jsmart.zerocode.core.domain.JsonTestCase;
import org.jsmart.zerocode.core.domain.TargetEnv;
import org.jsmart.zerocode.core.runner.ZeroCodeUnitRunner;
import org.junit.FixMethodOrder;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
@TargetEnv("test.properties")
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@RunWith(PolicyTestUnitRunner.class)
public class myTest {
@Rule
public Timeout globalTimeout = Timeout.seconds(120);
@Test @JsonTestCase("zerocode/11_Test.zero")
public void _11_Test() throws Exception {}
}
---------------------------
PolicyTestUnitRunner.java
----------------------------
package com.storvisor.backup;
import org.jsmart.zerocode.core.runner.ZeroCodeUnitRunner;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.model.InitializationError;
public class PolicyTestUnitRunner extends ZeroCodeUnitRunner
{
public PolicyTestUnitRunner(Class klass) throws InitializationError
{
super(klass);
}
@Override
public void run(RunNotifier notifier)
{
PolicyTestListener failFastListener = new PolicyTestListener(notifier);
notifier.addListener(failFastListener);
super.run(notifier);
}
}
Thanks
|
|
|
|
|
Also Observed it is executing till source afterward it is throughing Java Runtime Exception
java.lang.RuntimeException: ZeroCode Step execution failed. Details:java.lang.NullPointerException
|
|
|
|
|
source1 is worked perfectly when it start consume soure2 it is througing
java.lang.RuntimeException: ZeroCode Step execution failed. Details:java.lang.NullPointerException.
Can you please let me know what is wrong on zero file
Thanking you
|
|
|
|
|
No one here can tell you what is wrong with your file since we have no idea what the data represents. Also we have no idea where ther exception occurs, or why the variable in question has not been initialised. You are the only person that can diagnose the problem, by using the debugger, and examining what is happening when the code runs.
|
|
|
|
|
Member 16085274 wrote: Could you please suggest what is wrong.
The stack trace will tell you the exact line with the null pointer.
|
|
|
|
|
This is the only stack Trace and these java files not the part of the code, it is part of used jars
* What went wrong:
Execution failed for task ':backup:integration_test'.
> There were failing tests. See the report at: file:
* 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 ':backup:integration_test'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:149)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:147)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:135)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:338)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:325)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:318)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:304)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
Caused by: org.gradle.api.tasks.VerificationException: There were failing tests. See the report at: file: at org.gradle.api.tasks.testing.AbstractTestTask.handleTestFailures(AbstractTestTask.java:621)
at org.gradle.api.tasks.testing.AbstractTestTask.handleCollectedResults(AbstractTestTask.java:483)
at org.gradle.api.tasks.testing.AbstractTestTask.executeTests(AbstractTestTask.java:478)
at org.gradle.api.tasks.testing.Test.executeTests(Test.java:685)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:242)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:227)
at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:210)
at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:193)
at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:166)
at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:93)
at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:57)
at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:54)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:54)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:67)
at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:37)
at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)
at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:28)
at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.executeDelegateBroadcastingChanges(CaptureStateAfterExecutionStep.java:100)
at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:72)
at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:50)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:40)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:29)
at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:166)
at org.gradle.internal.execution.steps.BuildCacheStep.executeAndStoreInCache(BuildCacheStep.java:139)
at org.gradle.internal.execution.steps.BuildCacheStep.lambda$executeWithCache$4(BuildCacheStep.java:106)
at org.gradle.internal.execution.steps.BuildCacheStep.lambda$executeWithCache$5(BuildCacheStep.java:106)
at org.gradle.internal.Try$Success.map(Try.java:164)
at org.gradle.internal.execution.steps.BuildCacheStep.executeWithCache(BuildCacheStep.java:80)
at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$0(BuildCacheStep.java:69)
at org.gradle.internal.Either$Left.fold(Either.java:115)
at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:59)
at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:68)
at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:46)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:36)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:25)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:91)
at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:55)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:37)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:65)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:36)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:76)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:37)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:94)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:49)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:71)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:45)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNonEmptySources(SkipEmptyWorkStep.java:177)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:53)
at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:32)
at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:21)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:75)
at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:41)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:32)
at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:287)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:21)
at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:42)
at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:31)
at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:64)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:146)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:135)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:338)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:325)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:318)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:304)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
|
|
|
|
|
Member 16085274 wrote: these java files not the part of the code, it is part of used jars
Then either there's a bug in the libraries you're using, or you're using them wrong.
Either way, there's still nothing we can do to help you. You need to contact the library authors for support.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
|
|
|
|
|
What is the difference between a static and an instance variable in Java?
|
|
|
|
|
|
I want to make it so that when the user launches the app, it will display the GUI but at the same time it will launch other threads (multithreading) that will do some calculations and when those are finished they will update some GUI elements (which are always created before the thread with calculations is launched, that is not a problem of getting null), also when a button is pressed same as before using multithreading it will do some calculation and update the GUI after each thread is done.
Now the problem I have is that if you are using Thread(new Runnable)/start(); to launch multiple threads (even one) you get into the error Not on FX application thread . As possible solutions I read about JavaFX Task and Service but those were freezing the GUI thread until they were done.
This is what I tried ("Functions.functionX" is the placeholder, the real function takes between 0-20 seconds to finish):
button.setOnAction(event -> {
Service<Void> doSomething = new Service<Void>() {
@Override
protected Task<Void> createTask() {
Functions.functionX("parameter");
return null;
}
};
doSomething.start();
});
Now the problem with this is like I said, when the button is pressed, the GUI is unusable until the function finishes. Using straight Task had the same effect unfortunately.
What do I need to change/add to make it so that I can launch multiple threads at a time, and inside them to change elements from GUI (right now I only want to update some Labels with .setText() inside those threads, each thread updates one Label)?
modified 21-Jul-23 13:02pm.
|
|
|
|
|
Where do you get the "Not on FX application thread" error? When trying to launch all those threads or when you try to update the GUI from within one of those threads? If it's the former, I can't help. If it's the latter, you simply need to run your update code on the UI thread. I don't use JavaFX but in my Java / Android, this works fine.
Thread worker = new Thread (new Runnable ()
{
@Override public void run ()
{
activity.runOnUiThread (new Runnable ()
{
@Override public void run ()
{
}
});
}
});
worker.start ();
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
modified 21-Jul-23 15:11pm.
|
|
|
|
|
I get the error when I call .setText() . Everything related to the GUI must run on FX thread, but if you are running something intensive on that, then the interface will freeze, that is why you should run that on a different thread and make the updates later.
|
|
|
|
|
And that is exactly what my code does. It creates the thread worker from the UI thread and starts it. It then exits that UI function, effectively releasing the UI thread. Meanwhile, worker is executing its Run method separately from the UI. After it finishes doing stuff, worker then creates and runs a UI thread that updates the UI. JavaFX may have a different method to call instead of runOnUiThread , but the logic is the same. JavaFX has to have an equivalent.
Don't be confused by the code appearing to all be in the initial UI function. Each of those Run methods is a chunk of code that executes in a separate and distinct thread.
One caveat -- when running on Android, I have found that this doesn't always work to release the UI when it is done from within view creation / fragment startup. I don't know if JavaFX has the same issue. What I've shown works when launched from the UI once the screen is up and established; for example, from a menu item click handler.
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
I managed to make it work but not with Task or Service. On button action I created a new Thread thread = new Thread(new Runnable() {...}); , and after I was done with the calculation, still inside thread run function I called:
Platform.runLater(new Runnable() {
@Override
public void run() {
label.setText(newValue);
}
});
I am still interested what I should do to make it work with those too, if someone can explain what I was doing wrong.
|
|
|
|
|
I am complete fresher at Java. Could You help me with https:
|
|
|
|
|
Asking the same question will not change the answers.
No, we're not doing your work for you, and you haven't described a problem you're having.
|
|
|
|
|
I am complete fresher at Java. Could You help me with https:
|
|
|
|