Category "java"

Difference between jar and war in Java

What is the difference between a .jar and a .war file? Is it only the file extension or is there something more?

Is there any way of having maven scp wagon work consistently on linux/mac/windows platform?

Given the very poor documentation about scp/ssh and maven I tried different approaches, basically falling in two main categories: using scpexe wagon and scp wag

Anyone experienced in real-time Java on embedded systems? [closed]

Has anyone out there implemented a real-time embedded Java system? I am very interested to see if this could work for a new product I'm devel

How is if/while condition evaluated when we use assignments instead of comparison?

I discovered this surprising thing while learning OCA/OCP for Java. Below is the first piece of code of which the if(test condition) part surprises me. public

How can I add a filter class in Spring Boot?

Is there any annotation for a Filter class (for web applications) in Spring Boot? Perhaps @Filter? I want to add a custom filter in my project. The Spring Boot

Apache Arrow in Scala: AbstractMethodError on loadBatch

I'm trying to load Arrow file into scala. But every time I call ethier arrowStreamReader.loadNextBatch() nor arrowFileReader.loadRecordBatch(arrowBlock), the JV

How to get line number of an instance variable from a java object during runtime

I want to find line number of an instance variable in Java file during run time. So far my understanding, it can be done through java reflection but don't know

Why does my ArrayList contain N copies of the last item added to the list?

I'm adding three different objects to an ArrayList, but the list contains three copies of the last object I added. For example: for (Foo f : list) { System

Drools flow persistence - Named query not found: ProcessInstancesWaitingForEvent

I have a problem with drools flow persistence (MySQL), I get the following exception: 2011-04-15 14:38:27,244 INFO [STDOUT] (http-0.0.0.0-8000-5) Hibernate: i

What Exception to throw when a web element is found in Selenium Automation [closed]

Currently, I am working on a "Selenium Wrapper Library", where a set of methods are created in order to perform automation on a particular Web

How to do the equivalent of pass by reference for primitives in Java

This Java code: public class XYZ { public static void main(){ int toyNumber = 5; XYZ temp = new XYZ(); temp.play(toyNumbe

extract word from string that have combination of letter and number in java?

this is my first question and sorry for my bad English I want to extract only word from String that have combination of letter and number and store it in array

How to set corner radius to imageview

I want to set corner radius to imageview and control the radius on seekbar. As the seekbar progresses the corner radius should increase and vice-versa. Currentl

How to set a button onclick event and link to Thymeleaf controller?

I am trying to write some code where, once the user clicks a button, it will do some set of code in my Thymeleaf controller class. I tried looking on other vari

Java equivalent of #ifdef that allows non-compilable code

Is it possible in Java to do a sort of #ifdef thing, like in C/C++? Example: class Test { public static final boolean ANDROID = false; public Test()

Force log rollover in tomcat log4j2 even if no traffic

Is there an option in tomcat log4j2 to force the logs to roll over after a defined interval even though there is no traffic at the time of rollover. Usual behav

Evaluate command line argument as boolean expression

I'm trying to take a string, passed as an argument, and evaluate it as a boolean expression in an if conditional statement. For example, the user invokes MyPro

LdapInvalidDnException: unexpected token:

I am getting the below exception while doing a ldap search and wondering if it is a problem with api or something I need to fix ? 16:41:19,290 ERROR [com.sync

Maven toolchain not getting triggered in build

I'm using the latest maven 3.3.9 which enforces java 8, and trying to compile a project in java 7 using a java 7 maven toolchain. As per: The maven guide I'

import sun.misc.BASE64Encoder results in error compiled in Eclipse

For this two imports; import sun.misc.BASE64Encoder; import sun.misc.BASE64Decoder; I got this error: Access restriction: The type BASE64Decoder is not acce