# ClassCastException for opcua.datatype.ubyte

**URL:** <https://forum.inductiveautomation.com/t/classcastexception-for-opcua-datatype-ubyte/5259>\
**Category:** Module Development\
**Created:** [October 10, 2012, 7:58pm UTC](https://forum.inductiveautomation.com/t/classcastexception-for-opcua-datatype-ubyte/5259 "2012-10-10T19:58:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [October 10, 2012, 7:58pm UTC](https://forum.inductiveautomation.com/t/classcastexception-for-opcua-datatype-ubyte/5259/1 "2012-10-10T19:58:03Z")

</div>

Hi,  
in my opcua driver i use the datatype ubyte (i think this this was new introduced in 7.5).  
Now i updated my testsystem to 7.5.4beta1 and get the following error when i try to add a opc tag with this datatype:

```auto
java.lang.ClassCastException: Cannot coerce value '[Ljava.lang.Byte;@1e190e2' into type: class java.lang.Byte
```

I’m sure this worked in one of the previous 7.5 versions. Is the 7.5.4 api incompatible with 7.5.3 or is this a bug?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 10, 2012, 8:04pm UTC](https://forum.inductiveautomation.com/t/classcastexception-for-opcua-datatype-ubyte/5259/2 "2012-10-10T20:04:51Z")

</div>

Can you give me a little more context? What does the surrounding code look like? I know there were a few attributes like AccessLevel on UA nodes that were modified to require unsigned byte instead of byte’s as per the spec.

The error you’re showing me looks like an error casting a Byte[] into a Byte, which seems a little unrelated.

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [October 10, 2012, 8:30pm UTC](https://forum.inductiveautomation.com/t/classcastexception-for-opcua-datatype-ubyte/5259/3 "2012-10-10T20:30:17Z")

</div>

Thank you very much, this was an error on my side. The byte[] was the clue. I dragged an opc array item from the OPCBrowser to the SQLTags Browser, and did not remember that it was an array 😊 .  
Is my memory wrong, or did Ignition automatically create a string tag for arrays in earlier versions?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 10, 2012, 8:36pm UTC](https://forum.inductiveautomation.com/t/classcastexception-for-opcua-datatype-ubyte/5259/4 "2012-10-10T20:36:53Z")

</div>

At some point it may have created a useless string tag that had the contents “[Ljava.lang.Byte;@1e190e2” or something like that… I can’t remember exactly.

Adding support for arrays has been on our list forever, it just hasn’t ever been a high enough priority to actually get done. 😢

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [October 10, 2012, 8:43pm UTC](https://forum.inductiveautomation.com/t/classcastexception-for-opcua-datatype-ubyte/5259/5 "2012-10-10T20:43:15Z")

</div>

When i manually change the datatype of the created tag to string, it works perfect. The string then contains the comma seperated values and can be evaluated with a split expression, so it actually is usefull.

Thanks again for your fast help.
