Auties00 / Cobalt

Standalone unofficial fully-featured Whatsapp Web and Mobile API for Java and Kotlin
MIT License
625 stars 183 forks source link

NoSuchMethodException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf #345

Closed dgonzalez211 closed 1 year ago

dgonzalez211 commented 1 year ago

Machine information: Parrot OS x64 Java 17 LTS

I'm running a simple test code to make a connection:

public static void main(String... args) {
    // Create a new instance of WhatsappAPI
    Whatsapp.webBuilder()
            .newConnection()
            .build()
            .addLoggedInListener(() -> System.out.println("Connected!"))
            .addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))
            .connectAndAwait()
            .join();
}

}

and then this error appears:


    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: it.auties.protobuf.base.ProtobufSerializationException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:23)
    at it.auties.whatsapp.model.request.Request.of(Request.java:72)
    at it.auties.whatsapp.socket.SocketHandler.onOpen(SocketHandler.java:167)
    at it.auties.whatsapp.socket.SocketSession.lambda$connect$0(SocketSession.java:47)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
    ... 6 more
Caused by: java.lang.NoSuchMethodException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at java.base/java.lang.Class.getMethod(Class.java:2227)
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:20)
    ... 10 more

Process finished with exit code 1

Enabling "Delegate build actions to maven" doesnt not solve the problem:

![image](https://i.ibb.co/NyNh44H/2023-07-10-07-04.png)
![image](https://i.ibb.co/9cr4W3g/2023-07-10-07-05.png)
dgonzalez211 commented 1 year ago

Not working with that option "Delegate build actions to maven" enabled, keeps the same error:

image image

Auties00 commented 1 year ago

Machine information: Parrot OS x64 Java 17 LTS

I'm running a simple test code to make a connection:

public static void main(String... args) {
    // Create a new instance of WhatsappAPI
    Whatsapp.webBuilder()
            .newConnection()
            .build()
            .addLoggedInListener(() -> System.out.println("Connected!"))
            .addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))
            .connectAndAwait()
            .join();
}

}

and then this error appears:


  at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
  at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
  at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
  at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
  at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
  at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
  at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
  at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
  at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: it.auties.protobuf.base.ProtobufSerializationException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
  at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:23)
  at it.auties.whatsapp.model.request.Request.of(Request.java:72)
  at it.auties.whatsapp.socket.SocketHandler.onOpen(SocketHandler.java:167)
  at it.auties.whatsapp.socket.SocketSession.lambda$connect$0(SocketSession.java:47)
  at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
  ... 6 more
Caused by: java.lang.NoSuchMethodException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
  at java.base/java.lang.Class.getMethod(Class.java:2227)
  at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:20)
  ... 10 more

Process finished with exit code 1

Enabling "Delegate build actions to maven" doesnt not solve the problem:

![image](https://i.ibb.co/NyNh44H/2023-07-10-07-04.png)
![image](https://i.ibb.co/9cr4W3g/2023-07-10-07-05.png)

wait are you running it from the cobalt project or have you imported the dependency into a new project?

dgonzalez211 commented 1 year ago

Machine information: Parrot OS x64 Java 17 LTS I'm running a simple test code to make a connection:

public static void main(String... args) {
    // Create a new instance of WhatsappAPI
    Whatsapp.webBuilder()
            .newConnection()
            .build()
            .addLoggedInListener(() -> System.out.println("Connected!"))
            .addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))
            .connectAndAwait()
            .join();
}

} and then this error appears:

    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: it.auties.protobuf.base.ProtobufSerializationException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:23)
    at it.auties.whatsapp.model.request.Request.of(Request.java:72)
    at it.auties.whatsapp.socket.SocketHandler.onOpen(SocketHandler.java:167)
    at it.auties.whatsapp.socket.SocketSession.lambda$connect$0(SocketSession.java:47)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
    ... 6 more
Caused by: java.lang.NoSuchMethodException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at java.base/java.lang.Class.getMethod(Class.java:2227)
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:20)
    ... 10 more

Process finished with exit code 1

Enabling "Delegate build actions to maven" doesnt not solve the problem:

![image](https://i.ibb.co/NyNh44H/2023-07-10-07-04.png)
![image](https://i.ibb.co/9cr4W3g/2023-07-10-07-05.png)

wait are you running it from the cobalt project or have you imported the dependency into a new project?

Its a new project, that's not the groupId of the project 😄

Auties00 commented 1 year ago

Machine information: Parrot OS x64 Java 17 LTS I'm running a simple test code to make a connection:

public static void main(String... args) {
    // Create a new instance of WhatsappAPI
    Whatsapp.webBuilder()
            .newConnection()
            .build()
            .addLoggedInListener(() -> System.out.println("Connected!"))
            .addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))
            .connectAndAwait()
            .join();
}

} and then this error appears:

  at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
  at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
  at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
  at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
  at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
  at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
  at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
  at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
  at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: it.auties.protobuf.base.ProtobufSerializationException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
  at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:23)
  at it.auties.whatsapp.model.request.Request.of(Request.java:72)
  at it.auties.whatsapp.socket.SocketHandler.onOpen(SocketHandler.java:167)
  at it.auties.whatsapp.socket.SocketSession.lambda$connect$0(SocketSession.java:47)
  at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
  ... 6 more
Caused by: java.lang.NoSuchMethodException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
  at java.base/java.lang.Class.getMethod(Class.java:2227)
  at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:20)
  ... 10 more

Process finished with exit code 1

Enabling "Delegate build actions to maven" doesnt not solve the problem:

![image](https://i.ibb.co/NyNh44H/2023-07-10-07-04.png)
![image](https://i.ibb.co/9cr4W3g/2023-07-10-07-05.png)

wait are you running it from the cobalt project or have you imported the dependency into a new project?

Its a new project, that's not the groupId of the project 😄

oh then it's a bug, delegating the build actions to maven isn't necessary on a new project. I'll have a patch by today with 3.4.10

dgonzalez211 commented 1 year ago

Machine information: Parrot OS x64 Java 17 LTS I'm running a simple test code to make a connection:

public static void main(String... args) {
    // Create a new instance of WhatsappAPI
    Whatsapp.webBuilder()
            .newConnection()
            .build()
            .addLoggedInListener(() -> System.out.println("Connected!"))
            .addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))
            .connectAndAwait()
            .join();
}

} and then this error appears:

    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: it.auties.protobuf.base.ProtobufSerializationException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:23)
    at it.auties.whatsapp.model.request.Request.of(Request.java:72)
    at it.auties.whatsapp.socket.SocketHandler.onOpen(SocketHandler.java:167)
    at it.auties.whatsapp.socket.SocketSession.lambda$connect$0(SocketSession.java:47)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
    ... 6 more
Caused by: java.lang.NoSuchMethodException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at java.base/java.lang.Class.getMethod(Class.java:2227)
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:20)
    ... 10 more

Process finished with exit code 1

Enabling "Delegate build actions to maven" doesnt not solve the problem:

![image](https://i.ibb.co/NyNh44H/2023-07-10-07-04.png)
![image](https://i.ibb.co/9cr4W3g/2023-07-10-07-05.png)

wait are you running it from the cobalt project or have you imported the dependency into a new project?

Its a new project, that's not the groupId of the project smile

oh then it's a bug, delegating the build actions to maven isn't necessary on a new project. I'll have a patch by today with 3.4.10

tysm man

Auties00 commented 1 year ago

Machine information: Parrot OS x64 Java 17 LTS I'm running a simple test code to make a connection:

public static void main(String... args) {
    // Create a new instance of WhatsappAPI
    Whatsapp.webBuilder()
            .newConnection()
            .build()
            .addLoggedInListener(() -> System.out.println("Connected!"))
            .addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))
            .connectAndAwait()
            .join();
}

} and then this error appears:

  at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
  at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
  at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
  at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
  at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
  at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
  at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
  at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
  at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: it.auties.protobuf.base.ProtobufSerializationException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
  at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:23)
  at it.auties.whatsapp.model.request.Request.of(Request.java:72)
  at it.auties.whatsapp.socket.SocketHandler.onOpen(SocketHandler.java:167)
  at it.auties.whatsapp.socket.SocketSession.lambda$connect$0(SocketSession.java:47)
  at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
  ... 6 more
Caused by: java.lang.NoSuchMethodException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
  at java.base/java.lang.Class.getMethod(Class.java:2227)
  at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:20)
  ... 10 more

Process finished with exit code 1

Enabling "Delegate build actions to maven" doesnt not solve the problem:

![image](https://i.ibb.co/NyNh44H/2023-07-10-07-04.png)
![image](https://i.ibb.co/9cr4W3g/2023-07-10-07-05.png)

wait are you running it from the cobalt project or have you imported the dependency into a new project?

Its a new project, that's not the groupId of the project smile

oh then it's a bug, delegating the build actions to maven isn't necessary on a new project. I'll have a patch by today with 3.4.10

tysm man

Should be fixed in 3.4.10

dgonzalez211 commented 1 year ago

Machine information: Parrot OS x64 Java 17 LTS I'm running a simple test code to make a connection:

public static void main(String... args) {
    // Create a new instance of WhatsappAPI
    Whatsapp.webBuilder()
            .newConnection()
            .build()
            .addLoggedInListener(() -> System.out.println("Connected!"))
            .addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))
            .connectAndAwait()
            .join();
}

} and then this error appears:

    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: it.auties.protobuf.base.ProtobufSerializationException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:23)
    at it.auties.whatsapp.model.request.Request.of(Request.java:72)
    at it.auties.whatsapp.socket.SocketHandler.onOpen(SocketHandler.java:167)
    at it.auties.whatsapp.socket.SocketSession.lambda$connect$0(SocketSession.java:47)
    at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
    ... 6 more
Caused by: java.lang.NoSuchMethodException: it.auties.whatsapp.model.signal.auth.HandshakeMessage.toEncodedProtobuf()
    at java.base/java.lang.Class.getMethod(Class.java:2227)
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:20)
    ... 10 more

Process finished with exit code 1

Enabling "Delegate build actions to maven" doesnt not solve the problem:

![image](https://i.ibb.co/NyNh44H/2023-07-10-07-04.png)
![image](https://i.ibb.co/9cr4W3g/2023-07-10-07-05.png)

wait are you running it from the cobalt project or have you imported the dependency into a new project?

Its a new project, that's not the groupId of the project smile

oh then it's a bug, delegating the build actions to maven isn't necessary on a new project. I'll have a patch by today with 3.4.10

tysm man

Should be fixed in 3.4.10

yes it is! Now is working as expected, thank you Alessandro