# Java target error use lib hxbit

**URL:** https://community.haxe.org/t/java-target-error-use-lib-hxbit/1928
**Category:** Haxe
**Tags:** haxe-java
**Created:** [July 23, 2019, 6:34am UTC](https://community.haxe.org/t/java-target-error-use-lib-hxbit/1928 "2019-07-23T06:34:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Zhan](https://community.haxe.org/user_avatar/community.haxe.org/zhan/32/468_2.png) [@Zhan](https://community.haxe.org/u/Zhan)
#### Post date: [July 23, 2019, 6:34am UTC](https://community.haxe.org/t/java-target-error-use-lib-hxbit/1928/1 "2019-07-23T06:34:16Z")

</div>

```
/*var bm = new BMsg(1, "test", ["xxx" => "yyy"]);
        var s:Serializer = new Serializer();
        var bs:Bytes = s.serialize(bm);
        
        var c:String = bs.toHex();
        
        File.saveContent("c:/xxx.txt", c);
    */
        var c:String = "01010574657374020478787804797979";
        
        var bs:Bytes = Bytes.ofHex(c);
        
        var s:Serializer = new Serializer();
    var bs =	s.unserialize(bs, BMsg);
    
    trace(bs);//error.

```

///////////////////////////////  
class BMsg implements Serializable  
{

```
    @:s public var reqType:Int;
    @:s public var apiEnum:String;
    @:s public var map:Map<String,String>;

    public function new (rt:Int, api:String, map:Map<String,String>){
	
	this.reqType = rt;
	this.apiEnum = api;
	this.map = map;
}
}

```

///////////////////

I want post this issue to hxbit ,but it’s was close by **[ncannasse](https://github.com/ncannasse)**

and also got the same error

> <https://github.com/HeapsIO/hxbit/issues/24>
>
> I don't know if it is a bug of the cs and java target or of hxbit. But the following code...

it’s seem haxe still not fixed this bug.

haxe 4.0 rc3
