Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6168569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:42:37+00:00 2026-05-23T22:42:37+00:00

I found this API called Kryonet . Well, i tried to implement the example

  • 0

I found this API called Kryonet. Well, i tried to implement the example provided in the project page. However, it wasn’t successful.

Server code:

public class KryoTest {

public KryoTest() throws IOException {
    Server server = new Server();
    server.start();
    server.bind(54555, 54777);
    server.addListener(new Listener() {

        public void received(Connection connection, Object object) {
            if (object instanceof SomeRequest) {
                SomeRequest request = (SomeRequest) object;
                System.out.println(request.text);

                SomeResponse response = new SomeResponse();
                response.text = "Thanks!";
                connection.sendTCP(response);
            }
        }
    });
    Kryo kryo = server.getKryo();
    kryo.register(SomeRequest.class);
    kryo.register(SomeResponse.class);
}

public static void main(String[] args) throws IOException {
    new KryoTest();
}}

Client Code:

    public class Kryoclient {

    public Kryoclient() throws IOException {
    Client client = new Client();
client.start();
client.connect(5000,"192.168.1.4", 54555, 54777);

SomeRequest request = new SomeRequest();
request.text = "Here is the request!";
client.sendTCP(request);

 Kryo kryo = client.getKryo();
kryo.register(SomeRequest.class);
kryo.register(SomeResponse.class);

}
    public static void main(String[] args) throws IOException {
        new Kryoclient();
    }
}

Exception:

run:
00:00  INFO: Connecting: /192.168.1.4:54555/54777
00:00  INFO: [kryonet] Connection 1 connected: /192.168.1.4
Exception in thread "main" java.lang.IllegalArgumentException: Class is not registered: client.SomeRequest
    at com.esotericsoftware.kryo.Kryo.getRegisteredClass(Kryo.java:319)
    at com.esotericsoftware.kryo.Kryo.writeClass(Kryo.java:374)
    at com.esotericsoftware.kryo.Kryo.writeClassAndObject(Kryo.java:484)
    at com.esotericsoftware.kryonet.TcpConnection.send(TcpConnection.java:196)
    at com.esotericsoftware.kryonet.Connection.sendTCP(Connection.java:68)
    at client.Kryoclient.<init>(Kryoclient.java:24)
    at client.Kryoclient.main(Kryoclient.java:30)

What is wrong with this code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:42:38+00:00Added an answer on May 23, 2026 at 10:42 pm

    I’ve never heard of Kryonet before now, but I’d assume you’ll need to move your kryo.register(...) lines to before the client or the server first tries to connect or accept a connection, respectively.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've found this page about the Twitter search API and some operators : http://search.twitter.com/operators
I found this via google: http://www.mvps.org/access/api/api0008.htm '******************** Code Start ************************** ' This code was
I found the following code to create a tinyurl.com url: http://tinyurl.com/api-create.php?url=http://myurl.com This will automatically
I found the Bitly API code below on this site. I'm having a hard
I found http://words.bighugelabs.com/api.php but nothing like this for definitions/dictionary. Ideally I'd grab a dictionary
I was reading over the Dropbox API and I found this line: NSString* title
I was playing around with some chrome extensions and I found this example: http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_url/
Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
found this regex: insert every 10 characters: $text = preg_replace(|(.{10})|u, \${1}. , $text); can
Found this rather strange bug in IE8; element.style.top is limited to 1342177 pixels. Even

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.