Compile Java and xStream. XML with gcj (exception: cannot create xmlpullparser)

I am strengthening a client, which is part of a larger project Due to insufficient speed, I was forced to switch to CNI, so I had to use the GNU gcj compiler to generate native code (GNU 4.6.3)

The compilation and linking work normally (thanks to the - findirect - dispatch flag), and I have no problem executing the output However, when it comes to communication between the client and the server, the client will immediately disconnect reason:

(this exception only appears in the gcj compiled version of the client. When I run the code using the Java interpreter – things are running well (but too slow ^ ^)) – > the challenging part is that I can't retrieve the source code where this exception occurs because it is located in the precompiled (Java class file) library used by the client (I can't contact the author of the Library)

I want the library to call xppreader and then try to create an xmlpullparser class and fail

I created it by extracting them and compiling * Class file and then link the target file to bind the xStream (vers. 1.4.3) library (and other required *. Jars) This seems to apply to all other libraries as well (my OS = Ubuntu)

What have I done to overcome this problem: I searched xStream / xmlpullparser and gcj and replaced "xmlpull" – and "kxml2" files with different versions But it had no effect Do any of you know what the possible solution is?

Edit:

I found that the reason why xmlpullparser creation failed is xmlpullparserfactory The newinstance function cannot find an instance with / services / org xmlpull. v1. The meta - inf directory of the xmlpullparserfactory file This is because I only compiled and linked * Jar * Class file Therefore, as long as I find a way to link the meta - inf directory to the function to find and access its executable, I should solve the problem Do any of you know how to do this?

Solution

I think xmlpull needs an implementation that can use xpp3 as its implementation

<dependency>
    <groupId>xmlpull</groupId>
    <artifactId>xmlpull</artifactId>
    <version>1.1.3.1</version>
</dependency>
<dependency>
    <groupId>xpp3</groupId>
    <artifactId>xpp3</artifactId>
    <version>1.1.3.3</version>
</dependency>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>