gpt4 book ai didi

java - eclipse 米洛 : writing to an object member variable

转载 作者:行者123 更新时间:2023-11-30 01:58:07 30 4
gpt4 key购买 nike

当我向作为另一个对象的子对象的变量写入值(使用 UaExpert)时,我从提供的 ExampleServer 收到此错误。我打印了引发异常的访问级别,并且 CurrentWrite 访问权限似乎已被删除,正如您在下面的堆栈跟踪中看到的那样。有人可以帮忙吗?

变量配置:

UaVariableNode foo = UaVariableNode.builder(server.getNodeMap())
.setNodeId(new NodeId(namespaceIndex, "ObjectTypes/MyObjectType.Foo"))
.setAccessLevel(ubyte(AccessLevel.getMask(AccessLevel.READ_WRITE)))
.setBrowseName(new QualifiedName(namespaceIndex, "Foo"))
.setDisplayName(LocalizedText.english("Foo"))
.setDataType(Identifiers.Int16)
.setTypeDefinition(Identifiers.BaseDataVariableType)
.build();

堆栈跟踪:

//  System.out.println(""+node.getDisplayName()+" "+accessLevels); prints:
LocalizedText{text=Foo, locale=en} [CurrentRead]
// Rest of the stack trace
10:16:24.096 [ua-shared-pool-8] ERROR o.e.m.e.server.ExampleNamespace - Unable to write value=DataValue{value=Variant{value=1}, status=StatusCode{name=Good, value=0x00000000, quality=good}, sourceTime=DateTime{utcTime=0, javaDate=Mon Jan 01 08:00:00 SGT 1601}, serverTime=DateTime{utcTime=0, javaDate=Mon Jan 01 08:00:00 SGT 1601}}
org.eclipse.milo.opcua.stack.core.UaException: status=Bad_NotWritable, description=The access level does not allow writing to the Node.
at org.eclipse.milo.opcua.sdk.server.util.AttributeWriter.writeAttribute(AttributeWriter.java:72)
at org.eclipse.milo.opcua.sdk.server.nodes.ServerNode.writeAttribute(ServerNode.java:174)
at org.eclipse.milo.opcua.sdk.server.nodes.ServerNode.writeAttribute(ServerNode.java:153)
at org.eclipse.milo.examples.server.ExampleNamespace.write(ExampleNamespace.java:793)
at org.eclipse.milo.opcua.sdk.server.services.AttributeServices.lambda$8(AttributeServices.java:199)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

Ua专家访问级别:

enter image description here

最佳答案

看起来这个问题已经修复了in this commit .

关于java - eclipse 米洛 : writing to an object member variable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53716525/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com