Category "java"

app crash due to android.content.res.Resources$NotFoundException:

I made my app and it work well in emulator and many actual device. Recently, I checked crash report on Google play console and found crash report "Caused by:

Flutter Unable to instantiate activity ComponentInfo Main Activity

I'm using vs code (to code) and android studio (to get virtual device). I just merged and pulled the project I'm working on this morning, and first, have a very

Convert ByteArray to Base64 in Kotlin

I am trying to convert a ByteArray to Base64 in a Spring project, written in Kotlin. I have checked existing posts but they didnt help me. Actually I am trying

Mockito mockStatic cannot resolve symbol

I'm using Spring Boot and in a unit test, I'm trying to mock the Files.delete(myFile.toPath()) method. To do so I'm trying to use the Mockito.mockStatic() metho

Proguard plugin is giving error: Failed to execute goal: proguard (default) on project X: Obfuscation failed (result=1)

I am working on an open source Java Maven project which is using proguard-maven-plugin to obfuscate the application code. It is working fine until I have added

How to wrap the return of @FindBy into another class

The usage of the annotation @FindBy of selenium is: @FindBy(xpath='//xpath/selector') private WebElement element; public void setText(String te

How to Update JSON value using Java

I have below json, i want to update each and every value of that json but sometimes only one value { "msgType": "NEW", "code": "205", "plid": "PLB52145", } I'

How to access images within a .Jar File

I've been trying for a couple of days to access an image within a .Jar file. I've taken a look at several solutions on this site and nothing seems to be working

Given a rectangular matrix of characters, add a border of asterisks(*) to it

Example For picture = ["abc", "ded"] the output should be addBorder(picture) = ["*****", "*abc*", "*ded*

Swing: Intercept click on a JRadiobutton

I want to intercept the click on a JRadioButton in a button group. More precise: When JRadioButton A is chosen and the user clicks on JRadioButton B, I want to

How to capture nullpointerexception,ftp connection issues via a log/output file talend job

My talend job is working perfectly now,but i would like to induce some basic quality validation checks and put them in place to capture the error right away wit

Firebase dynamic link doesn't invoke dynamic link on first launch after install

I have read a lot of question on stackoverflow but none of them answer the question. I am trying to set up dynamic links so that a link will deep link the user

Object created for another class opening as new web driver window

public class ListPage extends BaseTest {private ListPageManage Object; private Test Object1; public void getList() throws InterruptedException { this.Obje

Problem with java classes generation from wsdl

I am trying to generate Java classes from this WSDL https://sedo.fss.ru/sedo-gateway/api/soap/SedoGateway?wsdl. I tried to do it with wsdl2java util, wsimport u

IntelliJ does not recognize fillStateContainer, getDefaultState(), or getPlacementHorizontalFacing() Forge 1.16.5

I am making a custom two block long model called "littleguys:operating_table" and I watched tutorials to make it face the direction I want when it is placed. I

How to avoid NPE in below case?

List<User> sortedList = userList.stream() .sorted(Comparator.comparingInt(User::getAge).reversed()) .collect(Collectors.toList()); sortedL

mapper does not convert between dto to entity

I am new to mapsturct I just want to map between dto to entity those two; my bank class; @Id private int id; my bank dto class; private Integer bankId; my m

Implement own in memory cache mechanism in spring boot

I was asked to implement an in memory cache mechanism in my spring boot application. My application is related to social media. User can register and login User

URLConnection equivalent in Spring Webflux

Is there an equivalent class for URLConnection in Spring Webflux? I'd like to convert this in Spring Webflux: I tried using WebClient but didn't work, I can't

Convert from a pdf byte[] to Postscript using Java

I am looking into creating PostScript file from a pdf as byte[], to send to printer. I've checked this post and the reply from Dustin seem to be somewhat simila