Category "java"

Convert float to String and String to float in Java

How could I convert from float to string or string to float? In my case I need to make the assertion between 2 values string (value that I have got from table)

Peer not authenticated while importing Gradle project in eclipse

While I am importing gradle project in eclipse, it is giving me this error. FAILURE: Build failed with an exception. * What went wrong: A problem occurred con

jTable saving each row element in the new line in the .txt file

I have a problem with saving the jTable contents to a file. Every row data printed to file makes a new line along. So reading from .txt looks like this: Here

Multi-line block select using the keyboard in IntelliJ IDEA on a Mac OS X

I've recently switched from Eclipse to IntelliJ IDEA 13. I use the VI keybindings. One non-vi thing I am used to doing in Eclipse is using Shift + ↑ / Sh

Hibernate : Why is it trying to drop/create database on startup?

I'm new with Spring. I finally succeeded to build my application with no error but when i'm looking to the output i have a lot of information that i don't under

Getting a nullpointerexception for my EntityManager

Working with Wildfly 10 on the following: a JSON webservice accessing a postgresql db using hibernate through a DAO object. More specifically, my POJO User.jav

How to send post request with x-www-form-urlencoded body

How in java, can I send a request with x-www-form-urlencoded header. I don't understand how to send a body with a key-value, like in the above screenshot. I

Error in multipart file upload: Failed to parse multipart servlet request; nested exception is java.io.IOException

We have an API to upload document. We got a very strange error and we got this error for the first time on our server. This is the API structure. @PatchMapping(

jstack: Target process not responding

I am running Ubuntu server edition and I wanted to take a thread dump of Tomcat. So, I first tried to find out which PID tomcat uses: $ jps -l 5809 sun.tools.

No matching client found for package name "...." with different buildvariant

I want o implement push notification. I added to project level: dependencies { classpath 'com.android.tools.build:gradle:2.2.2' classpath 'com.

Can not run Elastic Search on ubuntu (Error opening log file)

I have problems with running Elastic Search on my ubuntu 20.04 server (I can do it locally). When I run ./bin/elasticsearch in terminal I get lines below Excep

Find element using explicit wait within another element

I have the following code: List<MobileElement> messages = driver.findElements (By.id ("body_bubble")); //find all messages MobileElement lastMessage = me

How to put Hover effect on jbutton?

I am trying to create a Java Desktop application where I am using two buttons. I want to add hover effect in those buttons. I want: When I click any button it s

How can I write to stdout using FlatFileItemWriter in spring batch?

I have the following writer configured in my beans definition file of a spring batch project : <bean id="writer" class="org.springframework.batch.item.file.

How to exclude class in TestNG [duplicate]

I have a test suite called Test.XML. If I want to exclude any one class, how can I do that? Here is the Test.XML: <?xml version="1.0" encod

Junit 5 @SpringBootTest executable jar

I am trying to create an executable jar with my test. I cannot use maven to run the tests so I am trying to create a jer that will execute them. I have a jar w

Getting `java.lang.ClassNotFoundException: org.apache.commons.pool.PoolableObjectFactory` when using Java reflection

I am trying to invoke a function using java reflection. My initial program is written in Ballerina which is given below. import ballerina/http; function __getQ

Filtering OCR Result [closed]

I'am working on OCR, which I have working, but now I'm stuck on how to filter the OCR Result to move each string into a set of text fields. F

True-way solution in Java: parse 2 numbers from 2 strings and then return their sum

Given the code: public static int sum(String a, String b) /* throws? WHAT? */ { int x = Integer.parseInt(a); // throws NumberFormatException int y = Integer

Java error: constructor in class cannot be applied to given types

I just added the constructor Building and I thought everything would work fine, but I'm getting an error on line 43. When I create the object, Building b = new