Authentication fails from last connection
See original GitHub issueHi @Auties00,
I’m using this piece of code to get a connection. When I removed all the serialized connections, I get a QR code and everything seems fine. But when I restart my application, it’s using the “lastConnection” and I got the error below.
Seems like something is off at serializing/deserializing the connections?
Whatsapp api;
if (Whatsapp.listConnections().isEmpty()) {
var configuration = Whatsapp.Options.newOptions()
.description("MyApp")
.create();
api = Whatsapp.newConnection(configuration);
} else {
api = Whatsapp.lastConnection();
}
api.connect().get();
Error
Caused by: java.lang.NullPointerException: Cannot invoke "it.auties.whatsapp.model.media.MediaConnection.auth()" because the return value of "it.auties.whatsapp.controller.Store.mediaConnection()" is null
at it.auties.whatsapp.util.Medias.upload(Medias.java:51)
at it.auties.whatsapp.model.message.standard.ImageMessage.simpleBuilder(ImageMessage.java:179)
at it.auties.whatsapp.model.message.standard.ImageMessage$SimpleImageBuilder.create(ImageMessage.java:172)
at be.geertdebaets.camera.service.WhatsAppService.sendImageMessageToGroup(WhatsAppService.java:147)
... 1 more
Version:
<version>3.0-RC13</version>
(but was also on RC12)
Is this a bug/problem, or i’m a doing something wrong in setting up the connections?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:34 (14 by maintainers)
Top Results From Across the Web
5 Ways to Fix Wi-Fi Authentication Problems on Android
1. Start the Settings app. · 2. Go to your Wi-Fi settings. · 3. Tap and hold the Wi-Fi network you are trying...
Read more >How to Fix Wi-Fi Authentication Problems on Android - Lifewire
Wi-Fi authentication errors happen when your phone or tablet won't fully connect to the Wi-Fi network. Here are several ways to get back ......
Read more >Authentication Error Occurred? -10 Proven Fixes - Dr.Fone
Learn how to overcome Wifi authentication error in this extensive post. We have listed stepwise solutions to fix authentication error occurred on Android....
Read more >Troubleshooting Authentication / Log in Failure with Systems ...
If you received the error like: Authentication failure: Invalid username or password" after you've correctly entered in your NetID and password, you maybe ......
Read more >"Authentication failed" error when you try to log on to Unified ...
Fixes a problem in which you receive an "Authentication failed" error message when you use the UPN format to log on to a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
just fixed it, it will be available in the next update
Hi @19Maury85 , I’ve struggled aslo with getting a QRCode at first.
The easiest way to start is running one of the examples and see if you can get a QRCode there. There you will see the easiest way to get a connection is this one (I believe):
It wil create a new connection if no connection was saved before. Check also your {user.home}/.whatsappweb4j folder and perhaps try to delete everything from there On windows C:/users/<your_username>/.whatsappweb4j On Linux /home/<your_username>/.whatsappweb4j
My problem ended up using a too recent dependency version of “jakarta.websocket-api” See issues (but this when working with Spring Boot) : https://github.com/Auties00/WhatsappWeb4j/issues/111 https://github.com/Auties00/WhatsappWeb4j/issues/105
Kind regards