Questions tagged [java]

Java (not to be confused with JavaScript or JScript or JS) is a general-purpose object-oriented programming language designed to be used in conjunction with the Java Virtual Machine (JVM). "Java platform" is the name for a computing system that has installed tools for developing and running Java ...

-4
votes
0answers
7 views

how to pass a string as method parameter

Hi i am a beginner java programmer am creating a java program that prints instructions to bake cookies given a certain string defining the size of the batch. Im getting identifier, and illegal type ...
0
votes
0answers
2 views

Java, Selenium: Verify URLs using HTTP Get - How long should it take

I have a test suite made up of 10 testcases. Each test case navigates to a section of the website and checks all the url's in that section. Each section has roughly 10 webpages and each webpage has ...
0
votes
0answers
2 views

How to use Cassandra Batch Operations using Spring-data?

I was using Datastax API earlier and now moving to spring-data. Using datastax api I was doing Batch operation using following way. I need to perform same thing using spring-data. Here table is ...
0
votes
0answers
7 views

Http status 400 Invalid JSON payload received when post data to google text to speech

Here is my code using jsoup to post json dataResponse resp=Jsoup.connect("https://texttospeech.googleapis.com/v1beta1/text:synthesize").header("Authorization", " Bearer "+credential....
0
votes
0answers
4 views

Elasticsearch error - While trying to search contents in the attachment

Am using ingest-attachment processor plugin to index my pdf files and am able to index also using java code. Now, i want to search some contents in my pdf files which is available in elasticsearch....
0
votes
0answers
18 views

Why is my AWS Lamba Java function returning 'Hello World'?

I'm following the tutorial here:https://docs.aws.amazon.com/lambda/latest/dg/get-started-step4-optional.htmland have pasted the code verbatim into my Java file:package example;import com....
0
votes
1answer
16 views

Convert two bytes to a signed integer in java

Question in shortIs there a way to read two bytes as a signed integer?Details & exampleGiven two bytes in java, each represents an integer, we can convert them to the int value they ...
1
vote
1answer
10 views

Annotations in TestNG are strongly typed. What does it mean?

In the book "Next Generation Java Testing: TestNG and Advanced Concepts", it is said that "Annotations are strongly typed, so the compiler will flag any mistakes right away.". I know that strongly ...
-1
votes
0answers
15 views

Getting Java.lang.nullpointerexception when Passing argument to method which passing it further to interface [duplicate]

I have a Main class.public class Retrigger {public static void main(String[] args){Long i=97944605L;com.armus.flow.Implement rdf=new com.armus.flow.Implement();try ...
-1
votes
0answers
15 views

Running concurrent threads in Java? [duplicate]

Assume that there are three concurrent threads that perform some kind of initialization work that a fourth thread needs to be able to continue. How can I make this fourth thread block until all three ...
0
votes
0answers
7 views

How to update item in DynamoDB from Android?

The title describes the question that's been surrounding my pain for three days. How to update an item stored in DynamoDB from an Android app?Below I left a list of links I already checked and ...
0
votes
0answers
13 views

List.contains is not working

I have a list of attributes declared in the xml file:<list maxlength="*" minlength="0" property="calltypeList" name="CALLTYPE_LIST" ><arg name="CALLTYPE" type="STRING" length="10"...
0
votes
1answer
11 views

how can i get thread by id?

I want to close the thread by id,but in closeThread() method, the thread object that get by id is null,plz help me Thankspublic static void main(String[] args) throws Exception {startThread();...
0
votes
0answers
16 views

Springboot submit not finding controller

When I click submit on my HTML form it is not hitting the /greeting endpoint@org.springframework.stereotype.Controller@EnableAutoConfigurationpublic class Controller {@Autowired...
0
votes
0answers
7 views

Is it possible to use Resteasy to post byte[] to invoke rest api?

I'm using Java EE7, wildfly 10, resteasy-jaxrs-3.0.19(bundled in wildfly10)I have invoked rest api successfully by post json or xml format. private byte[] request(String address, String api, byte[]...
0
votes
0answers
21 views

How do I implement game-loop using timeline in Javafx?

I am a beginner. I am making a simple color matching 2D game using Javafx where a circle will pass through obstacles of rectangles. The circle must pass through the rectangle which has the same color. ...
0
votes
0answers
6 views

java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook ERROR

public static void exportTable(JTable table, File file){try{TableModel model=table.getModel();// FileWriter out=new FileWriter(file);...
0
votes
0answers
6 views

Using hibernate 6.0.10 validation results in ConstraintDefinitionException from EachPattern

When I try to use an @EachPattern on a List with:@EachPattern(regexp="^[a-z]+",message="Invalid")public List<String> getTestItems(){return Arrays.asList( "aaaaa" );}I ...
-6
votes
0answers
14 views

Java web application licensing libraries [on hold]

Can anyone list out the currently available licensing libraries that can be used in Java Web applications? And also tell me which one would be the best?
0
votes
0answers
9 views

Could not load []. The following stack trace is thrown for debugging purposes

Both the local development environment and the test environment are operating normally. The production environment only replaced the database and redis configuration and then reported the following ...
0
votes
1answer
20 views

Android - Buttons take 2-3 seconds to be pressed

The activity loads flawlessly, and the countDownTimer on the activity has no issues, however the 4 buttons I have take 2-3 seconds to become depressed and complete the assigned task. Some worthy ...
0
votes
0answers
3 views

Dynamics AX on CXF throwing “An existing connection was forcibly closed by the remote host”

Dynamics AX server using NTLM authentication.Issue:When validating soap request using CXF library using(dispatch.invoke()), was throwing An existing connection was forcibly closed by the ...
0
votes
0answers
9 views

Do you have Tab fragments inside bottom navigation fragment Code?

I created a project something like this.But lot of errors.(see attached image)But I saw a project in github like this.Can anyone help me to find full project in github ?(I want to tabbed fragments ...
1
vote
0answers
9 views

in tomcat,how to get annotations on class in other project

in tomcat,there are two projects under webapps , A and B 。 In project A ,I want to get annotations on class in B,the same code ,I can get annotations in common java project,but in springmvc,I cannot ...
0
votes
0answers
10 views

como Cambiar salida predeterminada .jsp en eclipse en spring

como le hago para que no pueda depender de la configuracion de web.xml cuando creo mi vista jsp (index.jsp me reconoce lo que viene por default en el welcome-file-list) y cuando no lo encuentra me ...
-1
votes
2answers
29 views

Error: ';' expected - Not sure how to debug or what's causing the error

I've been working on another small project and have encountered a rather annoying bug that I can't seem to fix. Below is a method that takes a string and an integer and then returns character values ...
0
votes
0answers
10 views

What html tags can i put value in it from request attribute in controller aside from input?

I would like to display a ceratin set attribute from my controller to html, what kind of tag in html can i use that i can insert my code belowCodevalue=${resultNo}Controllerrequest....
-4
votes
0answers
18 views

Generate all orders of a list in java [duplicate]

Let's say I have a liststartingCombinations={objA, objB, objC, ...}How could I generate a list containing all possible combinations of the source list?returns{{objA, objB, objC, ...}{objA,...
0
votes
2answers
38 views

Take numbers from string array index, multiply them together?

So in this scenario I have an array with multiple cards within a deck. These cards in each index are ranked S1R1, S1R2, S1R3, S2R1, S2R2, S2R3. I need to be able to extract both numbers from each ...
1
vote
1answer
22 views

Java - read text file with specific jvm size

I have created a .txt test file containing only character 'a'. The file size is about 20 MB. I tried to read the file in three waysUsing BufferedReaderString fileName="C:\\testFile.txt";...
-2
votes
1answer
14 views

Java GUI Button Border

Can anyone tell me how to move the border of a button away from the button? In other words giving it some kind of outsets or giving some padding to the button from its border or stroke.
-4
votes
0answers
18 views

Debug enter java's classes [duplicate]

from some reason when I debugging, the compiler enter EVERY-SINGLE-METHOD.and I mean, every single one.This makes it almost impossible to debbug, I don't care to debug through the String ...
1
vote
1answer
19 views

Java: Unexpected runtime error in a recursive function

I'm trying to write my own version of MergeSort and wrote the following class:import java.util.List;import java.util.LinkedList;import java.lang.Comparable;public class Sort<E extends ...
-2
votes
0answers
7 views

Android studio (The objects defined in your code do not show in the design)

Android studio (The objects defined in your code do not show in the design)enter image description here
0
votes
0answers
14 views

ArrayLists calling wrong classes after going from web service to java application [duplicate]

I have the following issue , i have this method in my web services project. @WebMethod public ArrayList<clases.productoCo> buscarProductoRut(String rut){ String conexionBD=...
0
votes
0answers
6 views

Weld dependency injection issues

I have a POJO that I create to hold context for the client of a RESTful API, similar to this (actual class is proprietary).class MyPOJO {@Injectpublic AnInjectedInterface obj1;@...
0
votes
0answers
14 views

Java robot not working as expected as jar file

I have this code in eclipse, and when I run it, the robot clicks but doesn't move the mouse. However, when I exported it as a executable .jar file, whenever it clicks, the mouse moves to the spot ...
2
votes
3answers
33 views

Why do I get a Null Pointer Exception for an object Array? [duplicate]

I want to create an ArrayList of type CardMy Card class will have 2 instance variables of type Suit called suit and of type String called rank. The type Suit is its own subclass with 2 instance ...
-1
votes
0answers
15 views

stacks and reading through stacks to find relations

I'm working on homework and am having trouble. Just looking for insight or a point in the right direction. I need to trace through stacks and find a line of relation in between 2 names from a file. ...
0
votes
0answers
7 views

spark-submit & spark-shell not working

EDIT: I think it's because I have Java 10 installed instead of Java 8, I'll remedy that soon and see if it fixes the problems.I've been trying to run a Spark program locally outside of IntelliJ (...
-1
votes
0answers
24 views

python: replacement of 'treemap' in Java

I wonders if there is Python dict (or simulation) that has same feature as 'treemap' in Java, except 'sorted_container' (a third party library).Key feature includes: add/remove/find nth smallest (or ...
0
votes
0answers
14 views

OAuth: Send token to the client rather than the client requesting the token?

I struggled to word the title in a concise way so let me expand on it a little bit before expanding on the problem. From my knowledge of OAuth, after a user/client has been authenticated, that user/...
-5
votes
1answer
36 views

Is this an AntiPattern? [on hold]

I don't really want to talk too much, I just include this picture:I want to extend the proceed() functions (I didn't do it yet). I want to have it no matter what the actual implementation of the ...
0
votes
0answers
13 views

Spring Security 3.1 Run As Authentication

I have 2 Spring applications. The first is the core application contains list of services exported using RmiServiceExporter. The second is Spring MVC that consume services exported by the core ...
0
votes
0answers
17 views

How can I perform code inspection on generated code in Android Studio?

I want to run the "Analyze -> Inspect Code" task on some generated code and see if there are unused methods ("unused declaration" warnings).I tried to create a custom "scope" called "With Generated" ...
0
votes
1answer
24 views

So… I'm trying to replace a SupportFragment but it crashes on the onCreateView part [duplicate]

Fragment makes it out of onCreateView whenever I switch out the layout, leading me to believe the problem is within the xml file itself<?xml version="1.0" encoding="utf-8"?><LinearLayout...
-1
votes
0answers
9 views

What is the difference between transfer encoding chunked and SSE(server side events)?

Problem statement - I want to expose my rest service as streaming api's to the client. One option is to use Jersey's StreamingOutput response (transfer encoding-chunked) and other is to use ...
0
votes
1answer
17 views

how do I make eclipse not add javadoc tags in new method comments?

In my Eclipse configuration, when I create a new method comment, it doesn't add javadoc tags. This is how I want it. A colleague of mine gets javadoc tags added to the comment when he creates the ...
-1
votes
0answers
13 views

How to gather timezone of operating system from Oracle database in string format? (Migrate/convert date to ts with tz)

all! I want to update a database table which uses date type to 'timestamp with timezone' type in such way, that the old dates get correct timezone information. The plain cast is not good for me, ...
0
votes
1answer
13 views

How to parse song duration from media player to correct minutes in android

I call getDuration() method in MP Android. It returns ms value. For example 267180. This value equals to 04:27.The question: how do I can parse convert 267180 into 04:27 programmatically?Thanks.

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,