问:
Jmeter displays doubled results in html report and aggregate report when running in non gui mode
I have a Test plan which when I run in the Gui Mode execute the sampler one time, but when I start the Test Plan from the command line I get the sampler to be running twice.

I have deleted the result.jtl file to insure that the results are not accumulated.
Non gui command:

jmeter -n -t C:\Users\cthakor\Downloads\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\examples\Script.jmx -l C:\Users\cthakor\Downloads\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\examples\result.jtl

jmeter -g C:\Users\cthakor\Downloads\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\examples\result.jtl -o C:\Users\cthakor\Downloads\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\examples\HTMLReport

Test plan image

答:
It's hard to say what's wrong without seeing the .jtl results file contents

It might be the case you're getting an extra result due to redirection or to retrieval of the embedded resource

So most probably the dashboard contains correct number of requests, and in GUI the sub-result is being merged into the main sample result.

If this is not something you want to see in the dashboard you can add the next line to user.properties file:

```<code>jmeter.save.saveservice.subresults=false
</code>```

More information:

Configuring JMeter

Results file configuration

Body:
It's hard to say what's wrong without seeing the .jtl results file contents

It might be the case you're getting an extra result due to redirection or to retrieval of the embedded resource

So most probably the dashboard contains correct number of requests, and in GUI the sub-result is being merged into the main sample result.

If this is not something you want to see in the dashboard you can add the next line to user.properties file:

jmeter.save.saveservice.subresults=false

More information:

Configuring JMeter

Results file configuration


来源: stackexchange

问:
How can I fix this issue with flutter unity widget?
LOGS:

```<code>e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-4.2.5\android\src\main\kotlin\com\xraph\plugin\flutter_unity_widget\FlutterUnityWidgetController.kt: (14, 27): Unresolved reference: MultiWindowSupport
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-4.2.5\android\src\main\kotlin\com\xraph\plugin\flutter_unity_widget\FlutterUnityWidgetController.kt: (232, 17): Unresolved reference: MultiWindowSupport
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-4.2.5\android\src\main\kotlin\com\xraph\plugin\flutter_unity_widget\FlutterUnityWidgetController.kt: (239, 17): Unresolved reference: MultiWindowSupport
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-4.2.5\android\src\main\kotlin\com\xraph\plugin\flutter_unity_widget\FlutterUnityWidgetController.kt: (245, 13): Unresolved reference: MultiWindowSupport
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-4.2.5\android\src\main\kotlin\com\xraph\plugin\flutter_unity_widget\FlutterUnityWidgetController.kt: (250, 13): Unresolved reference: MultiWindowSupport

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_unity_widget:compileDebugKotlin'.
> Compilation error. See log for more details
</code>```

I've added this :

```<code>buildscript {
    ext.kotlin_version = '1.5.10'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
</code>```

Did : -flutter upgrade
-flutter clean
-flutter pub get
-flutter pub upgrade
-deleted android/.gradle

答:
This problem is from .pub-cache so just flutter clean, if the error still persist delete all the .pub-cache then

you can also check the link to related link

flutter clean

and pub get

ContentLicense: CC BY-SA 4.0

Body:
LOGS:

e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-4.2.5\android\src\main\kotlin\com\xraph\plugin\flutter_unity_widget\FlutterUnityWidgetController.kt: (14, 27): Unresolved reference: MultiWindowSupport
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-4.2.5\android\src\main\kotlin\com\xraph\plugin\flutter_unity_widget\FlutterUnityWidgetController.kt: (232, 17): Unresolved reference: MultiWindowSupport
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-4.2.5\android\src\main\kotlin\com\xraph\plugin\flutter_unity_widget\FlutterUnityWidgetController.kt: (239, 17): Unresolved reference: MultiWindowSupport
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-4.2.5\android\src\main\kotlin\com\xraph\plugin\flutter_unity_widget\FlutterUnityWidgetController.kt: (245, 13): Unresolved reference: MultiWindowSupport
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_unity_widget-4.2.5\android\src\main\kotlin\com\xraph\plugin\flutter_unity_widget\FlutterUnityWidgetController.kt: (250, 13): Unresolved reference: MultiWindowSupport

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_unity_widget:compileDebugKotlin'.
> Compilation error. See log for more details

I've added this :

buildscript {
    ext.kotlin_version = '1.5.10'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

Did : -flutter upgrade
-flutter clean
-flutter pub get
-flutter pub upgrade
-deleted android/.gradle


问:
DISTINCT combined with CONCAT() not working
I am unable to resolve this issue. The 1st query below works and returns distinct values for the name column:

```<code>SELECT DISTINCT p.name
FROM products AS p
ORDER BY RAND() LIMIT 4;
</code>```

The 2nd query stops filtering DISTINCT values for name - when I use CONCAT() to return an sku:

```<code>SELECT DISTINCT p.name, CONCAT('B', p.id) AS sku
FROM products AS p
ORDER BY RAND() LIMIT 4;
</code>```

EDIT

Here is some sample data to test:

```<code>CREATE TABLE `products` (
`id` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(60) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

INSERT INTO `products` VALUES (1, 'Truck');
INSERT INTO `products` VALUES (2, 'Truck');
INSERT INTO `products` VALUES (3, 'Truck');
INSERT INTO `products` VALUES (4, 'Car');
INSERT INTO `products` VALUES (5, 'Car');
INSERT INTO `products` VALUES (6, 'Car');
INSERT INTO `products` VALUES (7, 'Bike');
INSERT INTO `products` VALUES (8, 'Plane');
INSERT INTO `products` VALUES (9, 'Train');
INSERT INTO `products` VALUES (10, 'Canoe');
</code>```

It seems like a simple enough problem, but I am unable to solve it. Any help would be greatly appreciated. Thanks.

答:
Instead of DISTINCT you can group by name and return the min id of each name:

```<code>SELECT name, CONCAT('B', MIN(id)) AS sku
FROM products
GROUP BY name
ORDER BY RAND() LIMIT 4;
</code>```

See the demo.

Body:
I am unable to resolve this issue. The 1st query below works and returns distinct values for the name column:

SELECT DISTINCT p.name
FROM products AS p
ORDER BY RAND() LIMIT 4;

The 2nd query stops filtering DISTINCT values for name - when I use CONCAT() to return an sku:

SELECT DISTINCT p.name, CONCAT('B', p.id) AS sku
FROM products AS p
ORDER BY RAND() LIMIT 4;

EDIT

Here is some sample data to test:

CREATE TABLE `products` (
`id` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(60) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

INSERT INTO `products` VALUES (1, 'Truck');
INSERT INTO `products` VALUES (2, 'Truck');
INSERT INTO `products` VALUES (3, 'Truck');
INSERT INTO `products` VALUES (4, 'Car');
INSERT INTO `products` VALUES (5, 'Car');
INSERT INTO `products` VALUES (6, 'Car');
INSERT INTO `products` VALUES (7, 'Bike');
INSERT INTO `products` VALUES (8, 'Plane');
INSERT INTO `products` VALUES (9, 'Train');
INSERT INTO `products` VALUES (10, 'Canoe');

It seems like a simple enough problem, but I am unable to solve it. Any help would be greatly appreciated. Thanks.

Body:
Instead of DISTINCT you can group by name and return the min id of each name:

SELECT name, CONCAT('B', MIN(id)) AS sku
FROM products
GROUP BY name
ORDER BY RAND() LIMIT 4;

See the demo.


问:
java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException while Generating Java Class from WSDL
I have a spring boot application with Gradle where I am trying to generate the Java classes from some WSDL file.
I am working with Java 1.8 and Gradle 6.7.

I have defined a Gradle task generateWsdlClasses and is working perfectly fine if I am executing this task individually but when I am building the project with "gardle build" I am getting some very unexpected error.

Looked into some suggestion like including "javax.xml.soap-api" dependency which is irrelevant since I am working with Java8 only but even that didn't work out for me.

build.gradle

```<code>plugins {
    id 'org.springframework.boot' version '2.4.3'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

group = 'com.test'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

configurations {
    axisGenAntTask
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation ('org.springframework.boot:spring-boot-starter-web'){
        exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
    }
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'

    //AXIS-ANT Dependencies
    axisGenAntTask "org.apache.axis:axis-ant:1.4",
            "org.apache.axis:axis:1.4",
            "org.apache.axis:axis-jaxrpc:1.4",
            "axis:axis-wsdl4j:1.5.1",
            "commons-codec:commons-codec:1.3",
            "commons-logging:commons-logging:1.1.1",
            "commons-discovery:commons-discovery:0.2"
}

//GEN WSDL task
task generateWsdlClasses(){
    ant.echo(message:"Generating java classes from WSDL")
    ant.taskdef(
            name: "genClassesFromWSDL",
            classname: "org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask",
            classpath: configurations.axisGenAntTask.asPath
    )
    ant.genClassesFromWSDL(url:"src/main/resources/wsdl/EntitlementService.wsdl",output:"src/main/java",deployscope:"session",serverSide:"false",
            noWrapped:"true",skeletonDeploy:"false",verbose:"true",typeMappingVersion:"1.2",testcase:"no") {
        mapping(namespace: "urn:TestNS:XML:Jbo/01:Types", package: "com.mypackage.runtime")

    }
}

test {
    useJUnitPlatform()
}

</code>```

Error Log

```> Configure project :
[ant:echo] Generating Classes for use with WSDL
[ant:genClassesFromWSDL] java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
[ant:genClassesFromWSDL]        at org.apache.axis.encoding.DefaultTypeMappingImpl.initMappings(DefaultTypeMappingImpl.java:119)
[ant:genClassesFromWSDL]        at org.apache.axis.encoding.DefaultTypeMappingImpl.<init>(DefaultTypeMappingImpl.java:91)
[ant:genClassesFromWSDL]        at org.apache.axis.encoding.DefaultTypeMappingImpl.getSingletonDelegate(DefaultTypeMappingImpl.java
:85)
[ant:genClassesFromWSDL]        at org.apache.axis.encoding.TypeMappingRegistryImpl.<init>(TypeMappingRegistryImpl.java:155)
[ant:genClassesFromWSDL]        at org.apache.axis.encoding.TypeMappingRegistryImpl.<init>(TypeMappingRegistryImpl.java:149)
[ant:genClassesFromWSDL]        at org.apache.axis.wsdl.toJava.Emitter.<init>(Emitter.java:144)
[ant:genClassesFromWSDL]        at org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask.createEmitter(Wsdl2javaAntTask.java:615)
[ant:genClassesFromWSDL]        at org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask.execute(Wsdl2javaAntTask.java:211)
[ant:genClassesFromWSDL]        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[ant:genClassesFromWSDL]        at jdk.internal.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
[ant:genClassesFromWSDL]        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.
java:43)
[ant:genClassesFromWSDL]        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ant:genClassesFromWSDL]        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
[ant:genClassesFromWSDL]        at groovy.util.AntBuilder.performTask(AntBuilder.java:333)
[ant:genClassesFromWSDL]        at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:278)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:80)
[ant:genClassesFromWSDL]        at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:151)
[ant:genClassesFromWSDL]        at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:213)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(BasicAntBuilder.java:107)
[ant:genClassesFromWSDL]        at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:43)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135)
[ant:genClassesFromWSDL]        at
[ant:genClassesFromWSDL]        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
[ant:genClassesFromWSDL]        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
[ant:genClassesFromWSDL]        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
[ant:genClassesFromWSDL]        at groovy.lang.Closure.call(Closure.java:405)
[ant:genClassesFromWSDL]        at groovy.lang.Closure.call(Closure.java:421)
[ant:genClassesFromWSDL]        at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71)
[ant:genClassesFromWSDL]        at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)
[ant:genClassesFromWSDL]        at org.gradle.util.ConfigureUtil.configureSelf(ConfigureUtil.java:130)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:599)
[ant:genClassesFromWSDL]        at org.gradle.api.DefaultTask.configure(DefaultTask.java:307)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProject.task(DefaultProject.java:1264)
[ant:genClassesFromWSDL]        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ant:genClassesFromWSDL]        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ant:genClassesFromWSDL]        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.
java:43)
[ant:genClassesFromWSDL]        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
[ant:genClassesFromWSDL]        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
[ant:genClassesFromWSDL]        at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject
.java:484)
[ant:genClassesFromWSDL]        at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:196)
[ant:genClassesFromWSDL]        at org.gradle.internal.metaobject.CompositeDynamicObject.tryInvokeMethod(CompositeDynamicObject.jav
a:98)
[ant:genClassesFromWSDL]        at org.gradle.internal.extensibility.MixInClosurePropertiesAsMethodsDynamicObject.tryInvokeMethod(M
ixInClosurePropertiesAsMethodsDynamicObject.java:34)
[ant:genClassesFromWSDL]        at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:134)
[ant:genClassesFromWSDL]        at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:163
)
[ant:genClassesFromWSDL]        at org.gradle.groovy.scripts.BasicScript.invokeMethod(BasicScript.java:83)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:71)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:176)
[ant:genClassesFromWSDL]        at build_5d316is2u43smhcq3uxe8jb0p.run(C:\ems\build.gradle:42)
[ant:genClassesFromWSDL]        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScript
RunnerFactory.java:91)
[ant:genClassesFromWSDL]        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScrip
tPluginFactory.java:133)
[ant:genClassesFromWSDL]        at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
[ant:genClassesFromWSDL]        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFa
ctory.java:136)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:29)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:26)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:75)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:153)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:
56)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationE
xecutor.java:71)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedB
uildOperationWrapper.java:45)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.j
ava:71)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.ja
va:62)
[ant:genClassesFromWSDL]        at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplica
tionContext.java:43)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutab
leState$0(DefaultProjectStateRegistry.java:248)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(De
faultProjectStateRegistry.java:275)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState
(DefaultProjectStateRegistry.java:247)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProje
ctEvaluator.java:35)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(Lifecycl
eProjectEvaluator.java:100)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutab
leState$0(DefaultProjectStateRegistry.java:248)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectL
ock$3(DefaultProjectStateRegistry.java:308)
[ant:genClassesFromWSDL]        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:178)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(Def
aultProjectStateRegistry.java:308)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(De
faultProjectStateRegistry.java:289)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState
(DefaultProjectStateRegistry.java:247)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectE
valuator.java:91)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:29)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:26)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:75)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:153)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:
56)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationE
xecutor.java:71)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedB
uildOperationWrapper.java:45)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.j
ava:71)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.ja
va:63)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:710)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:145)
[ant:genClassesFromWSDL]        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:36)
[ant:genClassesFromWSDL]        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:6
2)
[ant:genClassesFromWSDL]        at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:46
)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingPr
ojectsPreparer.java:57)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationF
iringProjectsPreparer.java:52)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:29)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:26)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:75)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:153)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:
56)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationE
xecutor.java:71)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedB
uildOperationWrapper.java:45)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.j
ava:71)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiri
ngProjectsPreparer.java:40)
[ant:genClassesFromWSDL]        at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:228)
[ant:genClassesFromWSDL]        at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:
165)
[ant:genClassesFromWSDL]        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
[ant:genClassesFromWSDL]        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:126)
[ant:genClassesFromWSDL]        at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:72)
[ant:genClassesFromWSDL]        at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
[ant:genClassesFromWSDL]        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:178)
[ant:genClassesFromWSDL]        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
[ant:genClassesFromWSDL]        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:
31)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildAc
tionRunner.java:63)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner
.java:32)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingB
uildActionRunner.java:67)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingB
uildActionRunner.java:41)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildAct
ionRunner.java:49)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildAct
ionRunner.java:44)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(
DefaultBuildOperationRunner.java:200)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(
DefaultBuildOperationRunner.java:195)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:75)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:153)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java
:62)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperation
Executor.java:76)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(Unmanaged
BuildOperationWrapper.java:54)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.
java:76)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildAction
Runner.java:44)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.InProcessBuildActionExecuter.lambda$execute$0(InProcessBuildActionExecu
ter.java:54)
[ant:genClassesFromWSDL]        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:87)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:
53)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:
29)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeSc
opeLifecycleBuildActionExecuter.java:33)
[ant:genClassesFromWSDL]        at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:49)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecy
cleBuildActionExecuter.java:32)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecy
cleBuildActionExecuter.java:27)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildAction
Executer.java:104)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildAction
Executer.java:55)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildAc
tionExecuter.java:64)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildAc
tionExecuter.java:37)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(S
essionScopeLifecycleBuildActionExecuter.java:54)
[ant:genClassesFromWSDL]        at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionSco
peLifecycleBuildActionExecuter.java:50)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionSco
peLifecycleBuildActionExecuter.java:36)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildAc
tionExecuter.java:36)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildAc
tionExecuter.java:25)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsVali
datingActionExecuter.java:59)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsVali
datingActionExecuter.java:31)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailur
eReportingActionExecuter.java:55)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailur
eReportingActionExecuter.java:41)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecut
er.java:47)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecut
er.java:31)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:
39)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.jav
a:29)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingle
UsedDaemon.java:35)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
[ant:genClassesFromWSDL]        at org.gradle.util.Swapper.swap(Swapper.java:38)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironme
nt.java:84)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWith
Busy.java:52)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
[ant:genClassesFromWSDL]        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.ja
va:64)
[ant:genClassesFromWSDL]        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
[ant:genClassesFromWSDL]        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[ant:genClassesFromWSDL]        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[ant:genClassesFromWSDL]        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.jav
a:56)
[ant:genClassesFromWSDL]        at java.base/java.lang.Thread.run(Thread.java:834)
[ant:genClassesFromWSDL] Caused by: java.lang.ClassNotFoundException: javax.xml.soap.SOAPException
[ant:genClassesFromWSDL]        at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1383)
[ant:genClassesFromWSDL]        at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1338)
[ant:genClassesFromWSDL]        at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1093)
[ant:genClassesFromWSDL]        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[ant:genClassesFromWSDL]        ... 198 more

FAILURE: Build failed with an exception.

```

答:
Add this dependency :

For gradle : implementation 'javax.xml.soap:javax.xml.soap-api:1.4.0'

For maven :

```<code><dependency>
    <groupId>javax.xml.soap</groupId>
    <artifactId>javax.xml.soap-api</artifactId>
    <version>1.4.0</version>
</dependency>
</code>```

Body:
I have a spring boot application with Gradle where I am trying to generate the Java classes from some WSDL file.
I am working with Java 1.8 and Gradle 6.7.

I have defined a Gradle task generateWsdlClasses and is working perfectly fine if I am executing this task individually but when I am building the project with "gardle build" I am getting some very unexpected error.

Looked into some suggestion like including "javax.xml.soap-api" dependency which is irrelevant since I am working with Java8 only but even that didn't work out for me.

build.gradle

plugins {
    id 'org.springframework.boot' version '2.4.3'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

group = 'com.test'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

configurations {
    axisGenAntTask
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation ('org.springframework.boot:spring-boot-starter-web'){
        exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
    }
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'

    //AXIS-ANT Dependencies
    axisGenAntTask "org.apache.axis:axis-ant:1.4",
            "org.apache.axis:axis:1.4",
            "org.apache.axis:axis-jaxrpc:1.4",
            "axis:axis-wsdl4j:1.5.1",
            "commons-codec:commons-codec:1.3",
            "commons-logging:commons-logging:1.1.1",
            "commons-discovery:commons-discovery:0.2"
}

//GEN WSDL task
task generateWsdlClasses(){
    ant.echo(message:"Generating java classes from WSDL")
    ant.taskdef(
            name: "genClassesFromWSDL",
            classname: "org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask",
            classpath: configurations.axisGenAntTask.asPath
    )
    ant.genClassesFromWSDL(url:"src/main/resources/wsdl/EntitlementService.wsdl",output:"src/main/java",deployscope:"session",serverSide:"false",
            noWrapped:"true",skeletonDeploy:"false",verbose:"true",typeMappingVersion:"1.2",testcase:"no") {
        mapping(namespace: "urn:TestNS:XML:Jbo/01:Types", package: "com.mypackage.runtime")

    }
}

test {
    useJUnitPlatform()
}

Error Log

> Configure project :
[ant:echo] Generating Classes for use with WSDL
[ant:genClassesFromWSDL] java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
[ant:genClassesFromWSDL]        at org.apache.axis.encoding.DefaultTypeMappingImpl.initMappings(DefaultTypeMappingImpl.java:119)
[ant:genClassesFromWSDL]        at org.apache.axis.encoding.DefaultTypeMappingImpl.<init>(DefaultTypeMappingImpl.java:91)
[ant:genClassesFromWSDL]        at org.apache.axis.encoding.DefaultTypeMappingImpl.getSingletonDelegate(DefaultTypeMappingImpl.java
:85)
[ant:genClassesFromWSDL]        at org.apache.axis.encoding.TypeMappingRegistryImpl.<init>(TypeMappingRegistryImpl.java:155)
[ant:genClassesFromWSDL]        at org.apache.axis.encoding.TypeMappingRegistryImpl.<init>(TypeMappingRegistryImpl.java:149)
[ant:genClassesFromWSDL]        at org.apache.axis.wsdl.toJava.Emitter.<init>(Emitter.java:144)
[ant:genClassesFromWSDL]        at org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask.createEmitter(Wsdl2javaAntTask.java:615)
[ant:genClassesFromWSDL]        at org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask.execute(Wsdl2javaAntTask.java:211)
[ant:genClassesFromWSDL]        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[ant:genClassesFromWSDL]        at jdk.internal.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
[ant:genClassesFromWSDL]        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.
java:43)
[ant:genClassesFromWSDL]        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ant:genClassesFromWSDL]        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
[ant:genClassesFromWSDL]        at groovy.util.AntBuilder.performTask(AntBuilder.java:333)
[ant:genClassesFromWSDL]        at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:278)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:80)
[ant:genClassesFromWSDL]        at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:151)
[ant:genClassesFromWSDL]        at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:213)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(BasicAntBuilder.java:107)
[ant:genClassesFromWSDL]        at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:43)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135)
[ant:genClassesFromWSDL]        at
[ant:genClassesFromWSDL]        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
[ant:genClassesFromWSDL]        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
[ant:genClassesFromWSDL]        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
[ant:genClassesFromWSDL]        at groovy.lang.Closure.call(Closure.java:405)
[ant:genClassesFromWSDL]        at groovy.lang.Closure.call(Closure.java:421)
[ant:genClassesFromWSDL]        at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71)
[ant:genClassesFromWSDL]        at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)
[ant:genClassesFromWSDL]        at org.gradle.util.ConfigureUtil.configureSelf(ConfigureUtil.java:130)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:599)
[ant:genClassesFromWSDL]        at org.gradle.api.DefaultTask.configure(DefaultTask.java:307)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProject.task(DefaultProject.java:1264)
[ant:genClassesFromWSDL]        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ant:genClassesFromWSDL]        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ant:genClassesFromWSDL]        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.
java:43)
[ant:genClassesFromWSDL]        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
[ant:genClassesFromWSDL]        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
[ant:genClassesFromWSDL]        at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject
.java:484)
[ant:genClassesFromWSDL]        at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:196)
[ant:genClassesFromWSDL]        at org.gradle.internal.metaobject.CompositeDynamicObject.tryInvokeMethod(CompositeDynamicObject.jav
a:98)
[ant:genClassesFromWSDL]        at org.gradle.internal.extensibility.MixInClosurePropertiesAsMethodsDynamicObject.tryInvokeMethod(M
ixInClosurePropertiesAsMethodsDynamicObject.java:34)
[ant:genClassesFromWSDL]        at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:134)
[ant:genClassesFromWSDL]        at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:163
)
[ant:genClassesFromWSDL]        at org.gradle.groovy.scripts.BasicScript.invokeMethod(BasicScript.java:83)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:71)
[ant:genClassesFromWSDL]        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:176)
[ant:genClassesFromWSDL]        at build_5d316is2u43smhcq3uxe8jb0p.run(C:\ems\build.gradle:42)
[ant:genClassesFromWSDL]        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScript
RunnerFactory.java:91)
[ant:genClassesFromWSDL]        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScrip
tPluginFactory.java:133)
[ant:genClassesFromWSDL]        at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
[ant:genClassesFromWSDL]        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFa
ctory.java:136)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:29)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:26)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:75)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:153)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:
56)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationE
xecutor.java:71)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedB
uildOperationWrapper.java:45)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.j
ava:71)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.ja
va:62)
[ant:genClassesFromWSDL]        at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplica
tionContext.java:43)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutab
leState$0(DefaultProjectStateRegistry.java:248)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(De
faultProjectStateRegistry.java:275)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState
(DefaultProjectStateRegistry.java:247)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProje
ctEvaluator.java:35)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(Lifecycl
eProjectEvaluator.java:100)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutab
leState$0(DefaultProjectStateRegistry.java:248)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$withProjectL
ock$3(DefaultProjectStateRegistry.java:308)
[ant:genClassesFromWSDL]        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:178)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(Def
aultProjectStateRegistry.java:308)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(De
faultProjectStateRegistry.java:289)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState
(DefaultProjectStateRegistry.java:247)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectE
valuator.java:91)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:29)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:26)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:75)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:153)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:
56)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationE
xecutor.java:71)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedB
uildOperationWrapper.java:45)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.j
ava:71)
[ant:genClassesFromWSDL]        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.ja
va:63)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:710)
[ant:genClassesFromWSDL]        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:145)
[ant:genClassesFromWSDL]        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:36)
[ant:genClassesFromWSDL]        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:6
2)
[ant:genClassesFromWSDL]        at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:46
)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingPr
ojectsPreparer.java:57)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationF
iringProjectsPreparer.java:52)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:29)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner
.java:26)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:75)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:153)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:
56)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationE
xecutor.java:71)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedB
uildOperationWrapper.java:45)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.j
ava:71)
[ant:genClassesFromWSDL]        at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiri
ngProjectsPreparer.java:40)
[ant:genClassesFromWSDL]        at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:228)
[ant:genClassesFromWSDL]        at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:
165)
[ant:genClassesFromWSDL]        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
[ant:genClassesFromWSDL]        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:126)
[ant:genClassesFromWSDL]        at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:72)
[ant:genClassesFromWSDL]        at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
[ant:genClassesFromWSDL]        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:178)
[ant:genClassesFromWSDL]        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
[ant:genClassesFromWSDL]        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:
31)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildAc
tionRunner.java:63)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner
.java:32)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingB
uildActionRunner.java:67)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingB
uildActionRunner.java:41)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildAct
ionRunner.java:49)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildAct
ionRunner.java:44)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(
DefaultBuildOperationRunner.java:200)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(
DefaultBuildOperationRunner.java:195)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:75)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner
.java:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:153)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.j
ava:68)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java
:62)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperation
Executor.java:76)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(Unmanaged
BuildOperationWrapper.java:54)
[ant:genClassesFromWSDL]        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.
java:76)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildAction
Runner.java:44)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.InProcessBuildActionExecuter.lambda$execute$0(InProcessBuildActionExecu
ter.java:54)
[ant:genClassesFromWSDL]        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:87)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:
53)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:
29)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeSc
opeLifecycleBuildActionExecuter.java:33)
[ant:genClassesFromWSDL]        at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:49)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecy
cleBuildActionExecuter.java:32)
[ant:genClassesFromWSDL]        at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecy
cleBuildActionExecuter.java:27)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildAction
Executer.java:104)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildAction
Executer.java:55)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildAc
tionExecuter.java:64)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildAc
tionExecuter.java:37)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(S
essionScopeLifecycleBuildActionExecuter.java:54)
[ant:genClassesFromWSDL]        at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionSco
peLifecycleBuildActionExecuter.java:50)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionSco
peLifecycleBuildActionExecuter.java:36)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildAc
tionExecuter.java:36)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildAc
tionExecuter.java:25)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsVali
datingActionExecuter.java:59)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsVali
datingActionExecuter.java:31)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailur
eReportingActionExecuter.java:55)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailur
eReportingActionExecuter.java:41)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecut
er.java:47)
[ant:genClassesFromWSDL]        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecut
er.java:31)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:
39)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.jav
a:29)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingle
UsedDaemon.java:35)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
[ant:genClassesFromWSDL]        at org.gradle.util.Swapper.swap(Swapper.java:38)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironme
nt.java:84)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java
:104)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWith
Busy.java:52)
[ant:genClassesFromWSDL]        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
[ant:genClassesFromWSDL]        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.ja
va:64)
[ant:genClassesFromWSDL]        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
[ant:genClassesFromWSDL]        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[ant:genClassesFromWSDL]        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[ant:genClassesFromWSDL]        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.jav
a:56)
[ant:genClassesFromWSDL]        at java.base/java.lang.Thread.run(Thread.java:834)
[ant:genClassesFromWSDL] Caused by: java.lang.ClassNotFoundException: javax.xml.soap.SOAPException
[ant:genClassesFromWSDL]        at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1383)
[ant:genClassesFromWSDL]        at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1338)
[ant:genClassesFromWSDL]        at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1093)
[ant:genClassesFromWSDL]        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[ant:genClassesFromWSDL]        ... 198 more

FAILURE: Build failed with an exception.

Body:
Add this dependency :

For gradle : implementation 'javax.xml.soap:javax.xml.soap-api:1.4.0'

For maven :

<dependency>
    <groupId>javax.xml.soap</groupId>
    <artifactId>javax.xml.soap-api</artifactId>
    <version>1.4.0</version>
</dependency>


问:
how to know the mouse click position is in element or out of element
I want to close the popup window if user click the mouse outside the window in google chrome extension. But how to know the user current mouse click in the popup window of out of the popup window? I could capture the click event in google chrome extension script like this:

```<code>document.addEventListener(TransGlobal.MOUSE_CLICK, mouseClick);
</code>```

and do something in the mouseClick function:

```<code>export async function mouseClick(e: MouseEvent) {
  if( click out of the popup window){
    // close popup window
  }
}
</code>```

what is the way do to this logic? This is the popup:

```<code><div id="pop-container">
      <div id="translate-panel">
        <div class="header">
          <div class="left"></div>
          <div class="right">
            <button type="button" title="Close" @click="closePopWindow">
              <span icon="cross">
                <svg data-icon="cross" width="18" height="18" viewBox="0 0 16 16">
                  <path d="M9.41 8l3.29-3.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L8 6.59l-3.29-3.3a1.003 1.003 0 00-1.42 1.42L6.59 8 3.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71L8 9.41l3.29 3.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L9.41 8z" fill-rule="evenodd"></path>
                </svg>
              </span>
            </button>
          </div>
        </div>
        <div class="body">
          <div id="reddwarf-translate-result"></div>
        </div>
      </div>
    </div>
</code>```

答:
The idea is to intercept the click, obtain the clicked element, and traverse through it's parents to see if any of them is the popup.

Try following....

```<code>document.onclick = processDocumentClick;

function processDocumentClick(clickEvent: MouseEvent) {

  let clickTarget: HTMLElement | null = clickEvent.target as HTMLElement;
  let isClicked = isPopupClicked(clickTarget);
  console.log(isClicked ? 'Popup Clicked' : 'Click Outside Popup');

  function isPopupClicked(clickTarget: HTMLElement): boolean {
    const popupContainer = document.querySelector('#pop-container') as HTMLDivElement;
    return isAncestorOf(popupContainer, clickTarget);
  }

  function isAncestorOf(parentElement: HTMLElement, childElement: HTMLElement) {
    let traversalElement: HTMLElement | null = childElement;

    let isParent = false;

    if (traversalElement) {
      while (traversalElement) {
        if (traversalElement === parentElement) {
          isParent = true;
          break;
        } else {
          traversalElement = traversalElement.parentElement;
        }
      }
    }
    return isParent;
  }
}

</code>```

Here is an illustration. Run the code

document.onclick = processDocumentClick;

function processDocumentClick(clickEvent) {

  let clickTarget = clickEvent.target;
  let isClicked = isPopupClicked(clickTarget);
  console.log(isClicked ? 'Popup Clicked' : 'Click Outside Popup');

  function isPopupClicked(clickTarget) {
    const popupContainer = document.querySelector('#pop-container');
    return isAncestorOf(popupContainer, clickTarget);
  }

  function isAncestorOf(parentElement, childElement) {
    let traversalElement = childElement;
    let isParent = false;
    if (traversalElement) {
      while (traversalElement) {
        if (traversalElement === parentElement) {
          isParent = true;
          break;
        } else {
          traversalElement = traversalElement.parentElement;
        }
      }
    }
    return isParent;
  }
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><body>
  <div id="area-which-is-not-popup" style="width: 100px; height: 100px; background-color: blue; margin: 10px">

  </div>
  <div id="pop-container" style="width: 200px; height: 200px; border: 3px; background-color: yellow">
    <div id="translate-panel">
      <div class="header">
        <div class="left"></div>
        <div class="right">
          <button type="button" title="Close" @click="closePopWindow">
              <span icon="cross">
                <svg data-icon="cross" width="18" height="18" viewBox="0 0 16 16">
                  <path d="M9.41 8l3.29-3.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L8 6.59l-3.29-3.3a1.003 1.003 0 00-1.42 1.42L6.59 8 3.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71L8 9.41l3.29 3.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L9.41 8z" fill-rule="evenodd"></path>
                </svg>
              </span>
            </button>
        </div>
      </div>
      <div class="body">
        <div id="reddwarf-translate-result" style="color: red">POPUP AREA</div>
      </div>
    </div>
  </div>
</body></code>```

On Stackoverflow, WYSIWYG => WHAT YOU SHOW IS WHAT YOU GET

Body:
I want to close the popup window if user click the mouse outside the window in google chrome extension. But how to know the user current mouse click in the popup window of out of the popup window? I could capture the click event in google chrome extension script like this:

document.addEventListener(TransGlobal.MOUSE_CLICK, mouseClick);

and do something in the mouseClick function:

export async function mouseClick(e: MouseEvent) {
  if( click out of the popup window){
    // close popup window
  }
}

what is the way do to this logic? This is the popup:

            <button type="button" title="Close" @click="closePopWindow">

                <svg data-icon="cross" width="18" height="18" viewBox="0 0 16 16">
                  <path d="M9.41 8l3.29-3.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L8 6.59l-3.29-3.3a1.003 1.003 0 00-1.42 1.42L6.59 8 3.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71L8 9.41l3.29 3.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L9.41 8z" fill-rule="evenodd"></path>
                </svg>

            </button>

Body:
The idea is to intercept the click, obtain the clicked element, and traverse through it's parents to see if any of them is the popup.

Try following....

document.onclick = processDocumentClick;

function processDocumentClick(clickEvent: MouseEvent) {

  let clickTarget: HTMLElement | null = clickEvent.target as HTMLElement;
  let isClicked = isPopupClicked(clickTarget);
  console.log(isClicked ? 'Popup Clicked' : 'Click Outside Popup');

  function isPopupClicked(clickTarget: HTMLElement): boolean {
    const popupContainer = document.querySelector('#pop-container') as HTMLDivElement;
    return isAncestorOf(popupContainer, clickTarget);
  }

  function isAncestorOf(parentElement: HTMLElement, childElement: HTMLElement) {
    let traversalElement: HTMLElement | null = childElement;

    let isParent = false;

    if (traversalElement) {
      while (traversalElement) {
        if (traversalElement === parentElement) {
          isParent = true;
          break;
        } else {
          traversalElement = traversalElement.parentElement;
        }
      }
    }
    return isParent;
  }
}

Here is an illustration. Run the code

document.onclick = processDocumentClick;

function processDocumentClick(clickEvent) {

  let clickTarget = clickEvent.target;
  let isClicked = isPopupClicked(clickTarget);
  console.log(isClicked ? 'Popup Clicked' : 'Click Outside Popup');

  function isPopupClicked(clickTarget) {
    const popupContainer = document.querySelector('#pop-container');
    return isAncestorOf(popupContainer, clickTarget);
  }

  function isAncestorOf(parentElement, childElement) {
    let traversalElement = childElement;
    let isParent = false;
    if (traversalElement) {
      while (traversalElement) {
        if (traversalElement === parentElement) {
          isParent = true;
          break;
        } else {
          traversalElement = traversalElement.parentElement;
        }
      }
    }
    return isParent;
  }
}

<body>
  <div id="area-which-is-not-popup" style="width: 100px; height: 100px; background-color: blue; margin: 10px">

  </div>
  <div id="pop-container" style="width: 200px; height: 200px; border: 3px; background-color: yellow">
    <div id="translate-panel">
      <div class="header">
        <div class="left"></div>
        <div class="right">
          <button type="button" title="Close" @click="closePopWindow">
              <span icon="cross">
                <svg data-icon="cross" width="18" height="18" viewBox="0 0 16 16">
                  <path d="M9.41 8l3.29-3.29c.19-.18.3-.43.3-.71a1.003 1.003 0 00-1.71-.71L8 6.59l-3.29-3.3a1.003 1.003 0 00-1.42 1.42L6.59 8 3.3 11.29c-.19.18-.3.43-.3.71a1.003 1.003 0 001.71.71L8 9.41l3.29 3.29c.18.19.43.3.71.3a1.003 1.003 0 00.71-1.71L9.41 8z" fill-rule="evenodd"></path>
                </svg>
              </span>
            </button>
        </div>
      </div>
      <div class="body">
        <div id="reddwarf-translate-result" style="color: red">POPUP AREA</div>
      </div>
    </div>
  </div>
</body>

On Stackoverflow, WYSIWYG => WHAT YOU SHOW IS WHAT YOU GET


问:
Get month name from input date
I have created a function for user to input his birthdate and display some info like month name from his birth date entered, however with following code I am getting month number but I need month name, can anyone help me out here? Thanks!</p>
```<code>import calendar
import datetime

def birth_day():
    date = input("Please enter your birthdate in format:'1991,03,15' :")
    birthdate = datetime.datetime.strptime(date, '%Y,%m,%d').weekday()
    print("You were born on:", calendar.day_name[birthdate])
    print("-------------------------")

    birth_sign(date)

def birth_sign(date):
    monthname = datetime.datetime.strptime(date, '%Y,%m,%d').month
    print(monthname)

birth_day()
</code>```

答:
I am not very familiar with the library but the task to get month name would be very easy</p>
```<code>month_number = 2
lst1 = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
month = lst1[month_number-1]
</code>```

Title: Get month name from input date

Body:
I have created a function for user to input his birthdate and display some info like month name from his birth date entered, however with following code I am getting month number but I need month name, can anyone help me out here? Thanks!

import calendar
import datetime

def birth_day():
    date = input("Please enter your birthdate in format:'1991,03,15' :")
    birthdate = datetime.datetime.strptime(date, '%Y,%m,%d').weekday()
    print("You were born on:", calendar.day_name[birthdate])
    print("-------------------------")

    birth_sign(date)

def birth_sign(date):
    monthname = datetime.datetime.strptime(date, '%Y,%m,%d').month
    print(monthname)

birth_day()

Body:
I am not very familiar with the library but the task to get month name would be very easy

month_number = 2
lst1 = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
month = lst1[month_number-1]


问:
Is there anyway to add same index multiple times in one operation?
Let's say that I have two tensors value and index, which contain the data and all indexes we need. I want to add one to data in value with the corresponding index. If an index shows k times in tensor index, then this data should be added by k, instead of one.

Here's an example:

```<code>value = torch.zeros(3) # [0, 0, 0]
index = torch.zeros(10).long() #[0,0,0,0,0,0,0,0,0,0]
ret = some_func(value, index) # [10, 0, 0]
</code>```

I know that using a for loop to go through all indexes in index could solve the problem, but I just wanna ask if there is more elegant way?

答:
One way you can do this is with scatter_add:

```<code>In [54]: value = torch.zeros(3)

In [55]: index = torch.tensor([0, 0, 1, 0, 2, 2, 1, 1, 1])

In [56]: value.scatter_add(0, index, torch.ones_like(index, dtype=value.dtype))
Out[56]: tensor([3., 4., 2.])
</code>```

You can use scatter_add_ to operate on value in place.

You might find it more efficient to use bincount():

```<code>In [63]: index = torch.tensor([0, 0, 1, 0, 2, 2, 1, 1, 1])

In [64]: counts = index.bincount(minlength=value.shape[0])

In [65]: counts
Out[65]: tensor([3, 4, 2])
</code>```

If in your actual problem, value is initialized with 0s, then you're done--just use counts as the result.  Otherwise, add counts to value.

Body:
Let's say that I have two tensors value and index, which contain the data and all indexes we need. I want to add one to data in value with the corresponding index. If an index shows k times in tensor index, then this data should be added by k, instead of one.

Here's an example:

value = torch.zeros(3) # [0, 0, 0]
index = torch.zeros(10).long() #[0,0,0,0,0,0,0,0,0,0]
ret = some_func(value, index) # [10, 0, 0]

I know that using a for loop to go through all indexes in index could solve the problem, but I just wanna ask if there is more elegant way?

Body:
One way you can do this is with scatter_add:

In [54]: value = torch.zeros(3)

In [55]: index = torch.tensor([0, 0, 1, 0, 2, 2, 1, 1, 1])

In [56]: value.scatter_add(0, index, torch.ones_like(index, dtype=value.dtype))
Out[56]: tensor([3., 4., 2.])

You can use scatter_add_ to operate on value in place.

You might find it more efficient to use bincount():

In [63]: index = torch.tensor([0, 0, 1, 0, 2, 2, 1, 1, 1])

In [64]: counts = index.bincount(minlength=value.shape[0])

In [65]: counts
Out[65]: tensor([3, 4, 2])

If in your actual problem, value is initialized with 0s, then you're done--just use counts as the result.  Otherwise, add counts to value.


问:
How to show real time data from from realtime database?
I'm making this realy simple project where when you click a button, it increments a value in the realtime databse. This works, but I want a Text widget to update everytime the value changes. I've really new to this so please excuse my lack of knowledge. I have noticed that there's no snapshots methods available that would let me do something like this, so how I update a label to be the data in the realtime storage eveyime it changes? Here's the code which I use to increment the values-</p>
```<code>Future<void> addData(int id) async {
    DatabaseReference pointsRef = FirebaseDatabase.instance.ref("$id");
    DataSnapshot snapshot = await pointsRef.get();
    pointsRef.set((snapshot.value as int) + 1);
  }

</code>```

答:
Use StreanBuilder like so:

```<code> StreamBuilder(
   stream: FirebaseDatabase.instance.ref("id").onValue,
   builder: (context, snapshot) {
     if (!snapshot.hasData) {
       return Center(
          child: CircularProgressIndicator(),
        );
      }
      return Text(snapshot.data.toString());
      },
    )
</code>```

Body:
I'm making this realy simple project where when you click a button, it increments a value in the realtime databse. This works, but I want a Text widget to update everytime the value changes. I've really new to this so please excuse my lack of knowledge. I have noticed that there's no snapshots methods available that would let me do something like this, so how I update a label to be the data in the realtime storage eveyime it changes? Here's the code which I use to increment the values-

Future<void> addData(int id) async {
    DatabaseReference pointsRef = FirebaseDatabase.instance.ref("$id");
    DataSnapshot snapshot = await pointsRef.get();
    pointsRef.set((snapshot.value as int) + 1);
  }

Body:
Use StreanBuilder like so:

 StreamBuilder(
   stream: FirebaseDatabase.instance.ref("id").onValue,
   builder: (context, snapshot) {
     if (!snapshot.hasData) {
       return Center(
          child: CircularProgressIndicator(),
        );
      }
      return Text(snapshot.data.toString());
      },
    )


问:
(TypeScript) Type Alias / Interface defined by object literal
I am making some schema of JSON message to transfer between server & client, for serialization I created an object literal as a template such as below

```<code>type uint8 = number;

const schema1 = {
    type: 'object',
    fields: {
        type: { type: 'uint8' },
        title: { type: 'string', optional: true }
    }
};

// can below automatically defined by schema1?
type schema1Type = {
    type: number,
    title?: string
};

const data1: schema1Type = {
    type: 1,
    title: 'Hello World'
};
</code>```

It is alright to validate the message format by object literal schema (type alias seems cannot do this job in runtime), but for more comprehensive usage, I wish to define a type alias according to the object literal template, to guard message format in compile time, is it possible to do so? please sharing some hints for me, thank you.

答:
First of all, you're going to need to the type for your schema definitions. I'm thinking something like this:

```<code>interface SchemaOptional { optional?: boolean }

interface SchemaNumber extends SchemaOptional { type: 'uint8' | 'int8' | 'float' }
interface SchemaString extends SchemaOptional { type: 'string' }
interface SchemaObject extends SchemaOptional {
    type: 'object',
    fields: Record<string, SchemaEntry>
}

type SchemaEntry = SchemaObject | SchemaNumber | SchemaString
</code>```

Here we have a type for each type that each entry can be. And that SchemaEntry is a union of all possible types.

Note that SchemaObject here has fields that are a dictionary of keys and other schema entries. This should allow for recursive nesting.

Next up we need a type that will transform each entry to its proper type.

```<code>type SchemaToType<T extends SchemaEntry> =
    // Does this entry extend the number schema type? Then return number
    T extends SchemaNumber ? number :

    // Does this entry extend the string schema type? Then return string
    T extends SchemaString ? string :

    // Does this entry extend the object schema type? Then return an object
    T extends SchemaObject ? SchemaObjectToType<T> :

    // No match, return never
    never
</code>```

This conditional type checks to see if T is a specific kind of entry, and then returns a type for that kind of entry. If the entry is a string or number, then those types are returned. But if it's an object, we have more work to do, so we invoke the SchemaObjectToType type which looks like this:

```<code>type SchemaObjectToType<T extends SchemaObject> = {
    // For each key in the `fields` object
    [K in keyof T['fields']]:

        // return a union of the type for that entry and...
        | SchemaToType<T['fields'][K]>

        // ...and undefined if the property is optional or never if it's required
        | SchemaEntryIsOptional<T['fields'][K]>
}
</code>```

This mapped type maps over all properties in the fields object, and invokes SchemaToType on that field to get its real type. This allows the type to be recursive, since SchemaToType can call SchemaObjectToType, and SchemaObjectToType can call SchemaToType.

The last line will check if the entry is optional. Let's look at that type:

```<code>type SchemaEntryIsOptional<T extends SchemaEntry> =
    T['optional'] extends true ? undefined : never
</code>```

This type will return undefined if it's optional, or never if it's required. A union with undefined is more or less the same thing as optional, so that should work fine.

Let's give that some simple tests:

```<code>type TestA = SchemaToType<{ type: 'string' }>
// string

type TestB = SchemaToType<{ type: 'uint8' }>
// number

type TestC = SchemaToType<{ type: 'object', fields: { a: { type: 'string' }}}>
// { a: string }

type TestD = SchemaToType<{ type: 'object', fields: { a: { type: 'string', optional: true }}}>
// { a: string | undefined }
</code>```

So far so good. How about your schema1 object?

```<code>const schema1 = {
    type: 'object',
    fields: {
        type: { type: 'uint8' },
        title: { type: 'string', optional: true }
    }
} as const; // the `as const` here is important

type Schema1Type = SchemaToType<typeof schema1>
/*
type Schema1Type = {
    readonly type: number;
    readonly title: string | undefined;
}
*/
</code>```

Looks like it works!

Playground

Body:
I am making some schema of JSON message to transfer between server & client, for serialization I created an object literal as a template such as below

type uint8 = number;

const schema1 = {
    type: 'object',
    fields: {
        type: { type: 'uint8' },
        title: { type: 'string', optional: true }
    }
};

// can below automatically defined by schema1?
type schema1Type = {
    type: number,
    title?: string
};

const data1: schema1Type = {
    type: 1,
    title: 'Hello World'
};

It is alright to validate the message format by object literal schema (type alias seems cannot do this job in runtime), but for more comprehensive usage, I wish to define a type alias according to the object literal template, to guard message format in compile time, is it possible to do so? please sharing some hints for me, thank you.

Body:
First of all, you're going to need to the type for your schema definitions. I'm thinking something like this:

interface SchemaOptional { optional?: boolean }

interface SchemaNumber extends SchemaOptional { type: 'uint8' | 'int8' | 'float' }
interface SchemaString extends SchemaOptional { type: 'string' }
interface SchemaObject extends SchemaOptional {
    type: 'object',
    fields: Record<string, SchemaEntry>
}

type SchemaEntry = SchemaObject | SchemaNumber | SchemaString

Here we have a type for each type that each entry can be. And that SchemaEntry is a union of all possible types.

Note that SchemaObject here has fields that are a dictionary of keys and other schema entries. This should allow for recursive nesting.

Next up we need a type that will transform each entry to its proper type.

type SchemaToType<T extends SchemaEntry> =
    // Does this entry extend the number schema type? Then return number
    T extends SchemaNumber ? number :

    // Does this entry extend the string schema type? Then return string
    T extends SchemaString ? string :

    // Does this entry extend the object schema type? Then return an object
    T extends SchemaObject ? SchemaObjectToType<T> :

    // No match, return never
    never

This conditional type checks to see if T is a specific kind of entry, and then returns a type for that kind of entry. If the entry is a string or number, then those types are returned. But if it's an object, we have more work to do, so we invoke the SchemaObjectToType type which looks like this:

type SchemaObjectToType<T extends SchemaObject> = {
    // For each key in the `fields` object
    [K in keyof T['fields']]:

        // return a union of the type for that entry and...
        | SchemaToType<T['fields'][K]>

        // ...and undefined if the property is optional or never if it's required
        | SchemaEntryIsOptional<T['fields'][K]>
}

This mapped type maps over all properties in the fields object, and invokes SchemaToType on that field to get its real type. This allows the type to be recursive, since SchemaToType can call SchemaObjectToType, and SchemaObjectToType can call SchemaToType.

The last line will check if the entry is optional. Let's look at that type:

type SchemaEntryIsOptional<T extends SchemaEntry> =
    T['optional'] extends true ? undefined : never

This type will return undefined if it's optional, or never if it's required. A union with undefined is more or less the same thing as optional, so that should work fine.

Let's give that some simple tests:

type TestA = SchemaToType<{ type: 'string' }>
// string

type TestB = SchemaToType<{ type: 'uint8' }>
// number

type TestC = SchemaToType<{ type: 'object', fields: { a: { type: 'string' }}}>
// { a: string }

type TestD = SchemaToType<{ type: 'object', fields: { a: { type: 'string', optional: true }}}>
// { a: string | undefined }

So far so good. How about your schema1 object?

const schema1 = {
    type: 'object',
    fields: {
        type: { type: 'uint8' },
        title: { type: 'string', optional: true }
    }
} as const; // the `as const` here is important

type Schema1Type = SchemaToType<typeof schema1>
/*
type Schema1Type = {
    readonly type: number;
    readonly title: string | undefined;
}
*/

Looks like it works!

<a href="https://www.typescriptlang.org/play?target=1#code/JYOwLgpgTgZghgYwgAgMoIBYQLZwPIAOYwA9iHADbIDeyJRp5FA-AFzIBGJJFEcIyAL4AoYaEixEKdFlwA5AK7YO0ZBAAekEABMAzmkw58DMpRrIwATwIR2AcgXiAHHeQAfZHeeuPdmBRI4MFcRcWh4JANZOFQwKFAAczVNCB19GSNCYlMqWisbe104xJCxcHCpKMyOACsIBDBkrT0q3CzGM2phZB6La1tPElr64IAabt6YYAgKPXYAJXqSKG0AHiL4kATR1rgAUXAoSwA+YRFhfOlDXAO4y2QAXl28YYb3XcVlVQ8M3FjNhKiS7PV5gAAqJDB-VWYKaqRav3woOOjxoEx6AG0ANLIUDIADWEEsJBgyDBGL801mujsAF1aax0b0ej9rnAIVCbDCKVMZno6djaadmczWdFbkcAJK6do5bmUvk02mC07nYGIiWWaWypgwuFpXaalEPJnkuz0bJMOn6lpxBQoZjIBQ6CBTEAQbTIdjugBu0CB-V2HOhsI0zXSbKNj1NNoj0U+KigyEdICUia9MbD8LjRn+iWTyA2+cZzNDKQNiJedTejsroODXLBKJLvV9-ougbBECKAEFUYiGxBVnl+oVilsQqcAPRTwvjwEdmxk7tgABC-bZg+HfQKnkc4BcQmns9TXygAaXXaKAGEN9EtyPd+bQXYdrzqexaHBPzuBnYixOQiCIIx7mN+c4AkIF4oFeYAACJ3kYD6-vYQzVmMyDvnMYE-pcY4Aq+dAmEw7B2igwEgcIM44RB+YeM62iuqAHpQcICBkEUhZsgAjKiXTMnhgwvuMzJYbon5MgJo7mIJDjeEIIkij0xBgLwuHSf+86ERaHQUKRUD2lBzIiIIyBwPo7EgEUADc0G7NxnIoE8A6QtClwklx0TcdOABUi5XF5jl8UyUB8NoZAUPcgmnomtnMqFcDhSAkUWMAqkDABST0S6boerZIg+VOwhAA" rel="nofollow noreferrer">Playground


问:
Can I create a DataGrid of an object containing a List<KeyValuePair> in horizontal view?
I have a list of items which I want to present in a datagrid. But each item contains a list of KeyValuePairs which I want to view horizontally. Is there any way?

The object I want to present:

```<code> public class ItemModel
    {
        public string Model { get; set; }

        public List<KeyValuePair<string, int>> DetailsList { get; set; }
    }
</code>```

My xaml looks like this, but it returns a datagrid with Key and Value as columns instead of Key1, Key2, Key3 etc as columns:

```<code><DataGrid x:Name="PurchaseOrder" CanUserAddRows="False" AutoGenerateColumns="False" CellEditEnding="PurchaseOrder_CellEditEnding">
                <DataGrid.Columns>
                <DataGridTextColumn Header="Model" Binding="{Binding Path=Model}" />
                   <DataGridTemplateColumn Header="">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                <DataGrid ItemsSource="{Binding DetailsList}" CanUserAddRows="False"
                  AutoGenerateColumns="True" CellEditEnding="Models_CellEditEnding">
                                    </DataGrid>
                                </StackPanel>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
        </DataGrid>
</code>```

答:
this is a simple example how you bind to a keyvaluepair + horizontal view</p>
```<code>        <DataGrid x:Name="PurchaseOrder" CanUserAddRows="False" AutoGenerateColumns="False" CellEditEnding="PurchaseOrder_CellEditEnding">
        <DataGrid.Columns>
            <DataGridTextColumn Header="Model" Binding="{Binding Path=Model}" />
            <DataGridTemplateColumn Header="">
                <DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <ItemsControl ItemsSource="{Binding DetailsList}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <VirtualizingStackPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>

                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Key}"/>
                                        <TextBlock Text="{Binding Value}"/>
                                    </StackPanel>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>

                    </DataTemplate>
                </DataGridTemplateColumn.CellTemplate>
            </DataGridTemplateColumn>
        </DataGrid.Columns>
    </DataGrid>
</code>```

Body:
I have a list of items which I want to present in a datagrid. But each item contains a list of KeyValuePairs which I want to view horizontally. Is there any way?

The object I want to present:

 public class ItemModel
    {
        public string Model { get; set; }

        public List<KeyValuePair<string, int>> DetailsList { get; set; }
    }

My xaml looks like this, but it returns a datagrid with Key and Value as columns instead of Key1, Key2, Key3 etc as columns:

<DataGrid x:Name="PurchaseOrder" CanUserAddRows="False" AutoGenerateColumns="False" CellEditEnding="PurchaseOrder_CellEditEnding">
                <DataGrid.Columns>
                <DataGridTextColumn Header="Model" Binding="{Binding Path=Model}" />
                   <DataGridTemplateColumn Header="">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                <DataGrid ItemsSource="{Binding DetailsList}" CanUserAddRows="False"
                  AutoGenerateColumns="True" CellEditEnding="Models_CellEditEnding">
                                    </DataGrid>
                                </StackPanel>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
        </DataGrid>

Body:
this is a simple example how you bind to a keyvaluepair + horizontal view

        <DataGrid x:Name="PurchaseOrder" CanUserAddRows="False" AutoGenerateColumns="False" CellEditEnding="PurchaseOrder_CellEditEnding">
        <DataGrid.Columns>
            <DataGridTextColumn Header="Model" Binding="{Binding Path=Model}" />
            <DataGridTemplateColumn Header="">
                <DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <ItemsControl ItemsSource="{Binding DetailsList}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <VirtualizingStackPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>

                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Key}"/>
                                        <TextBlock Text="{Binding Value}"/>
                                    </StackPanel>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>

                    </DataTemplate>
                </DataGridTemplateColumn.CellTemplate>
            </DataGridTemplateColumn>
        </DataGrid.Columns>
    </DataGrid>