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 ...

0
votes
0answers
13 views

Ramifications of setting the maxOutstandingElementCount in FlowControlSettings to be null?

In later versions of the Google PubSub client Java API, they have added a maxOutstandingElementCount value which defaults to 1000.maxOutstandingElementCount -- The maximum number of elements that ...
0
votes
0answers
13 views

spring testng: Failed to load ApplicationContext

I am getting failed to load applicationcontext. The class extending AbstractTestNGSpringContextTests which is applicationcontextaware. Any help what is missing here? It is a simple spring test file. ...
0
votes
2answers
26 views

get file from src/test/resources using getResourceAsStream()

file structure here++addi want to validate json based on json schema file.I currently save json as string , and try to read json schema file(which is test.json), then validate. however, reading ...
0
votes
1answer
20 views

gson parsing error when found same keys with different types of value in json

Getting large JSON response from API (generated by Jackson), and the object has its value only at its first occurrence in response. Second time when same object(with the same key) arrives it is ...
0
votes
0answers
9 views

Is Schema object necessary to validate XML when unmarshalling?

When I create a JAXBContext I provide the class that is the root of my message:JAXB CONTEXT=JAXBContext.newInstance(Message.class);Then get my Unmarshaller like so:Unmarshaller un=CONTEXT....
0
votes
0answers
5 views

JNA How to use IID_PPV_ARGS

I have this method:SHCreateItemFromParsingName(L"Test.txt", NULL, IID_PPV_ARGS(&factory));and I want to create the equivalent Java method but I don`t know how to parse IID_PPV_ARGS.I hope ...
0
votes
2answers
50 views

Multi-threading: Continuous writing to shared data structure and periodically purging

I have an issue where I have multiple threads that are continuously writing to, for example a Concurrent HashMap. Now, I want to periodically process (via TimerJob) everything that is in that hashmap ...
-2
votes
0answers
18 views

The target type of this expression must be a functional interface error while casting for loop

userInt=scanner.nextInt();for (int y=0; y <=userInt; sum + y;) {}It gives the error "The target type of this expression must be a functional interface inside the for loop ...
-1
votes
1answer
24 views

How to find from JPA repository by any fields?

There is JPA entity User, this is just example: @EntityUser{@IdString name;@IdString surname;@Id String age;}It works and successfully saves.I use repository and for get by name, I ...
1
vote
1answer
20 views

ClassCastException: com.sun.proxy.$ProxyX cannot be cast to a class

I have a Spring bean (ChildBean extends Parent) which is extending an abstract class (Parent implements Runnable).public abstract class Parent implements Runnable {public final void run() {...
0
votes
0answers
10 views

Parsing Cumulocity Timezone from CEL

I created a CEL rule that gets triggered by a measurement. This rule creates an operation for an agent and includes a fragment like this:insert into CreateOperationselect"342348" as deviceId,{...
0
votes
0answers
26 views

Jackson: Deserialize map<String,Object> where keys have index into Custom nested Pojo

I have a simple Map and I would like to deserialize it to a Pojo with some internal nested classes.Example for map: Map=["total_errs"=20, "err_1_day"=3, "err_2_day"=1, ..., "err_30_day=5"]I ...
-1
votes
2answers
32 views

problem with java.util.NoSuchElementException: No line found

When I'm using Scanner to get character in java, compiler throws:Exception in thread "main" java.util.NoSuchElementException: No line foundat java.base/java.util.Scanner.nextLine(Scanner.java:...
0
votes
0answers
33 views

Activity Crashes after adding Realtime Database

I have a activity where i use a custom library for my gauges and here is my codepackage com.smart_farming.smart_farming_app;public class DeviceCards extends AppCompatActivity {View view=...
0
votes
0answers
17 views

Unexpected different page sizes when merging PDF's in Java using iText

I have the following code snippet to merge two single paged PDF files (first and second):byte[] codes=IOUtils.toByteArray(resource.getURI());PdfReader first=new PdfReader(firstBytes);PdfReader ...
0
votes
1answer
15 views

Java Webcrawler to extract emails

I want to write a web crawler that starts at one page and goes to each link on that page looking for an email address. This is what I have so far, but it's not doing anything other than going from ...
-5
votes
0answers
32 views

Can CLASS A object call the method defined in the Class B? [on hold]

MIXED_OPERATION is interface.As CreateorReplace method is in different class and that class implements a interface MIXED_OPERATION .My question is how BuildConfig method is able to call ...
1
vote
2answers
38 views

Attempting to rename a File in Java does not work (using java.io.File.renameTo method)

I have a method where I load a file, do some changes, and then save it again. However, as insurance against exceptions during saving I create a new File and save to that one first (since improperly ...
0
votes
0answers
10 views

How to inject CDI bean to Message Driven Consumer

I would like to ask how or what is the best way to implement CDI + message driven consumer. Sample codes below is the actual implementation of my application. Also, I use apache maven as the app build ...
0
votes
1answer
35 views

Don't set text value to AutoCompleteTextView on item click

I have an AutocompleteTextView on my screen. By default, when user clicks on an item of an autocompletetextviews's dropdown item, it sets the text of this autocompletetextview to this chosen item ...
-1
votes
0answers
17 views

Spring boot application with phone authentication

Good day to everyone. I'll start by saying that I'm quite new to Spring Boot and I'm wondering if the issue I'm facing isn't a simple matter that is missing something simple. However I'm at a loss at ...
0
votes
0answers
22 views

Trouble with adding content to tableview fxml (javafx)

I have a trouble adding content into tableview and don't know why, I wrote a code for it and it wont add to table or give me any exceptions I'm confused.Here is the code:FXML : <?xml version="...
3
votes
3answers
142 views

Error to update tzdata 2018f (Released 2018-10-18) with tzupdater-2.2.0

I'm trying to update JVM's Time Zone info using TZUpdater 2.2.0.> [root@local tzupdater-2.2.0]# java -jar tzupdater.jar -Vtzupdater version 2.2.0-b01JRE tzdata version: tzdata2018d...
0
votes
2answers
21 views

Totally disabling java net ssl debug logging

I've found tons of documentation on how to enable javax.net.debug for SSL, TLS and similar, but even in the reference documentation I've not found how to totally disable it overriding programmatically ...
0
votes
0answers
10 views

convert MultiLineString to MultiPolygon

I'm working with a postgres database and the postgis extension and a java application that saves geo data. I have a shape file that contains a MultiLineString consisting of one closed LineString. ...
-3
votes
0answers
16 views

Latest stable versions of Tomcat and JDK? [on hold]

Could you please provide details regarding the latest stable versions of Tomcat and JDK.
0
votes
0answers
35 views

Java Application with Single Instance per User

currently I am struggling with the problem of a single instance JavaFX application, packed into an .exe using install4j. The application should run on a Windows terminal server and every user should ...
0
votes
1answer
16 views

Data entered via selenium webdriver sendKeys() not registering

I am automating an insurance web application user journey. There are two fields which are based on list of matching selections from a hidden(initially) list. When the user starts entering text, it ...
0
votes
1answer
34 views

Is it correct to say that in a String variable all ASCII symbols can be stored?

I want to know whether by definition it would be correct to say "A string variable can contain every ASCII symbol" without relating to length limitations. Or is a String Variable unable to store some ...
0
votes
0answers
13 views

Compare all pixels of two Buffered Images for image processing

I have two greyscale images, one a background that remains constant and one an image where several particles are present in the foreground. I'm thresholding to produce a binary image using the ...
0
votes
0answers
5 views

Spring 2.x with micrometer and coda hale doesn't works

... 37 common frames omittedCaused by: java.lang.NoSuchMethodError: com.codahale.metrics.graphite.GraphiteReporter$Builder.build(Lcom/codahale/metrics/graphite/GraphiteSender;)Lcom/codahale/metrics/...
0
votes
1answer
25 views

Java : JSONObject.put looped gives wrong order?

Today I started writing a simple parser for a log file. I want to take the log file and transform it into a simple json structure.The log file is consistent and has 3 main parts (example below): ...
-1
votes
2answers
13 views

How to restrict directly invoking super type class's method and only can access through subtype class methode using subtype instance in java?

I am writing an algorithm that extends the ArrayList class.Here,using algorithm class's instance ,can invoke ArrayList's all the method.How can i restrict that only can invoke methode which is defined ...
0
votes
0answers
9 views

Use wkhtmltopdf to convert html pages to pdf, pdf and HTML pages are very different, how to solve?

param:wkhtmltopdf --disable-smart-shrinking --dpi 150 --margin-left 0mm --margin-right 0mm --margin-top 0mm --margin-bottom 0mm --page-size A4 file:///C:/Users/Arron/Desktop/1539856696888.html out.pdf...
0
votes
1answer
16 views

Expose Prometheus Metrics in Dropwizard

I have implemented a Java web service using Dropwizard. Now I want it to also expose Prometheus metrics.I have followed this pretty straight-forward example. However, the endpoint at http://...
4
votes
1answer
31 views

Java StackOverflowError at java.io.PrintStream.write(PrintStream.java:480) and no further stack trace

I am running a Java program written by another person on more data than the program was initially designed for, e.g. 10-times longer input files, roughly quadratic runtime. I encountered different ...
0
votes
0answers
24 views

Spring Boot Profiles - excluding properties file in WAR file for non active profiles

I'm using Spring Boot Profiles to pull in different properties depending on the environment specified (default and localhost). They work as expected but both the application.properties AND application-...
0
votes
0answers
28 views

Java Process only exits after a garbage collection

I've created an CLI application (using Spring) to read external APIs, store it in a database and process that data.To process data I'm using project reactor (https://projectreactor.io/) to do things ...
0
votes
0answers
18 views

Navigating back does not load page correctly

Good day, I have a problem in JSF(Primefaces). I am currently using ViewScope on my managed beans, when i try to access the page the user interacted before, the site is not correctly refreshed. ...
1
vote
1answer
20 views

Why doesn't my JComboBox's ComboBoxModel ever call seSelectedItem()?

I have 2 combo boxes in my swing application - In the code below you'll see elements of Spring as I'm using Spring with it too. I can't remove spring or the app would stop working without a lot of ...
0
votes
0answers
24 views

Access specific Html form from another Html page

I have two Html pages one called Validation and the other is a Header which I will import to the previous one (and will be used for some other pages as well). I want to access the specific form (Log ...
-1
votes
0answers
34 views

JPA query to retrieve data from selected column from table

I'm using Spring JPA to retrieve data from MySql.I need to get data from specific columns of a table.Following is the Entity class.@Entity@Table(name="item", catalog="cashitem")public class ...
-2
votes
0answers
26 views

Java Queue isEmpty() with (rear==-1) condition [on hold]

“rear==-1 condition can be used to find whether a linear queue is empty”. Do you agree with this statement? Justify your answer. How do I answer this question?
2
votes
1answer
26 views

Misunderstanding with asBoolean method of Matcher class

I have a problem with a tiny testing script:import java.util.regex.Pattern;import java.util.regex.Matcher;cfgText="PATTERN1=9\nPATTERN2=136.225.73.44\nPATTERN3=136.225.236.12"cfgLine=...
0
votes
1answer
16 views

Error accessing com.ibm.mq through Python

I am accessing the libraries of com.ibm.mq IBM MQ package, and get this error. I have no idea what it means as I am new to Java, any help would be much appreciated.openOptions=MQC.MQOO_INQUIRE + ...
0
votes
0answers
23 views

Eclipse comment auto-completion doesn't work

Auto generation/completion for comments is not working in my eclipse Photon workspace. At the moment I have resetted the code templates to defaults, which didn't help. To illustrate my problem ...
1
vote
1answer
24 views

Joda Time - repeating/weekly Interval

I want to convert a string like the following to an object that can evaluate an instant to be withing a periodic interval or not:Mon: 0800-1300I am looking for some kind of functionality that I ...
0
votes
0answers
25 views

how to call java controller method from jsp using ajax

i have implemented different solution of this problem but i am unable to access the controller method from jsp some solution that i have used are following <script type="text/javascript">var ...
0
votes
1answer
23 views

JPARepository in spring-boot maven multi-module application

My next application is a maven multi-module application with this structure: main-app model sub-projectservice sub-projectfront-end sub-project In the model sub-...
1
vote
2answers
25 views

Spring boot, how to read particular object from json file, what annotation do I need?

I'm studying Spring Boot and I know how to read JSON file from resources directory but I want to get particular data, not whole data.like localhost:8080/user returns user name.below is my current ...

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