Category "java"

What does joinPoint.proceed() do?

It is my first approaching to AOP. I've a spring-boot application with one Aspect, a Logger. Searching i reach to the conclusion that the @Around method execute

Why can an Object member variable not be both final and volatile in Java?

If in a class I have a ConcurrentHashMap instance that will be modified and read by multiple threads I might define like this: public class My Class { pri

DuplicateMappingException represented by different logical column names

I'm using OneToMany mapping for two classes MasavNew and MasavRow : @Entity @Table(name = "ArgoCHFileHdr") public class MasavNew { @OneToMany(fetch = Fetch

How to find the product and sum of digits of a number in java?

I need to find the sum and the product of the digits of the number entered. I have the sum part down but the only problem with it is that when I enter a number

protobuf - field name with special characters

I'm trying to manually model a .proto file representing a JSON which has one of the field names with a dot and an @ sign. I'm getting an error that doesn't expl

TestNG Cannot find class in classpath once a new scala class is added to the suite.xml file

Seems like this is a very "popular" question on SO with no definitive way to fix it but I'm asking the question anyway because I can provide some more details.

How to mock ResourceBundle.getString()?

I'm failing to mock ResourceBundle.getString(). This is my code: ResourceBundle schemaBundle = Mockito.mock(ResourceBundle.class); Mockito.when(schemaBundle.g

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z

trying to run MR program version(2.7) in windows 7 64 bit in eclipse while running the above exception occurring . I verified that using 64 bit 1.8 java versi

Solr 8 not working when trying to start Solr: java.lang.IllegalStateException: /opt/solr-8.11.1/server/NONE is not a valid keystore?

I am trying to setup Solr 8.11.1 on a new server that is running RHEL 8. I followed all of the steps listed in the Solr guide (https://solr.apache.org/guide/8_1

535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Tenant

I am sending e email using an SMTP error . I am getting Authentication unsuccessful. The username and password are correct. Am I doing something wrong. public

What is wrong with my Preorder traversal?

I am trying to solve this problem https://oj.leetcode.com/problems/binary-tree-preorder-traversal/ , i.e. preorder traversal with recursive slution. EDIT: The

Trying to understand Abstract class inheritance and subclass object comparison

I'm working on a project for my data structures class and I've been having a hard time wrapping my head around Abstract class inheritance and how it can be mani

Best way to "negate" an instanceof

I was thinking if there exists a better/nicer way to negate an instanceof in Java. Actually, I'm doing something like: if(!(myObject instanceof SomeClass)) { /*

JPA (Hibernate) Native Query for Prepared Statement SLOW

Having strange performance issue using Hibernate 3.3.2GA behind JPA (and the rest of the Hibernate packages included in JBoss 5.) I'm using Native Query, and a

ChromeDriver Does not find the element on the page with selenium JAVA

I am trying to find an element on the page, I want to sorter the result list but my result show me that is not attached on the page: Exception in thread "main"

How to Add Java VM Arguments in JBoss EAP 6.1.1 Management Console

Does anyone know how to add Java VM arguments for a web application (*.war file) via the JBoss EAP 6.1.1 Management Console? For example, I want to specify th

What unicode characters are best for drawing a squarewave in a string

I am trying to represent a square wave pulse train in a string, from an array of stored GPIO events and timings. the code is working but I need better Unicode c

REST Assured: Deserialization and Inheritance to cater to varied Responses being returned by an API endpoint

I have a situation where sometimes the response of an API is { "SuccessCode": "OPERATION_SUCCESS", "Message": "Operation completed successfully" } a

Eclipse Java Project - Open Declaration always opens class file instead of .java

I'm posting this query after doing lots of googling and trying out different options for last few days. Is there an easy way to attach source in Eclipse? is the

Assert to check string contains only numeric values

I want to write a JUNIT test case for checking that a String contains only numeric values. Can anybody suggest me to do so. I am new to junit test case and i cu