Questions tagged [java]

Java (not to be confused with JavaScript or JScript or JS) is a general-purpose, statically typed, 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 programs. Use this tag for questions referring to the Java programming language or Java platform tools.

0
votes
0answers
5 views

how can i draw gantt chart with date from database in java

i have problem in taking from the database the startdate and the finaldate of task to draw the chart public IntervalCategoryDataset getCategoryDataset() { conn= ConnectDB.ConnectDB(); ...
-2
votes
0answers
12 views

The method flush() from the type JspWriter refers to the missing type IOException

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isErrorPage="true"%> <jsp:include page="header.jsp"> <jsp:param name="pageTitle" value="...
-5
votes
0answers
23 views

No encuentro las extensiones Netlogo.jar cuando ejecuto un archivo desde Eclipse … HEELP

I have created a netlogo file and I am using Eclipse to run it from this application using the netlogo-6.0.4.jar library in the build path. The problem is that the netlogo file uses extensions, so ...
0
votes
0answers
6 views

Remove duplicates from ListView adapter

I have created a number of array adapters to filter a ListView from Firebase. Whenever I select a filter ("In-Progress Tasks") on the UI it works, however when I click on the same filter again ("In-...
0
votes
2answers
22 views

How to stop execution when working queue is empty and all threads have stopped working?

While writing a state-space search like algorithm, I have a working queue with node elements. I have multiple threads with access to that queue that pop an element, do some transformations and checks ...
0
votes
0answers
5 views

Cannot resolve method 'setOnItemClickListener(anonymous com.app.app.adapters.ServerApater.OnItemClickListener)?

So I'm trying to create an intent which would play current streaming video in an external player but I'm stuck with this setOnItemClickListener being red and can't fix it. Here's my code: public ...
0
votes
1answer
15 views

how to customize Date in jackson serialization , @JsonSerialize not working

i want to change the date format in a json that is delivered by a java rest webservice, that is because the json have the dates like this: 2019-05-23T06:00:00Z[UTC] , so the client confuse the [...
1
vote
2answers
19 views

How to find only the exact pattern matches in java?

String "description" has both 5digit, 7digit substrings. I would like match 5digit, 7digit with 5digit, 7digit respectively only. But, 5digit substring extracts the whole 5 digit string and first 5 ...
0
votes
0answers
9 views

How to affiancate horizontally 2 images in the same Bitmap image?

I have 2 images as android.graphics.Bitmap object. The size of each image is unknown and It could be different each other. I want to affiancate horizontally the two images in a single Bitmap ...
1
vote
1answer
14 views

Why is Cassandra taking this much memory, despite -Xmx heap option?

I'm running Cassandra (a Java process) on my server, which has limited memory. I edit Cassandra's configuration (config/jvm.options) to pass these arguments to the Java virtual machine, to limit the ...
0
votes
0answers
12 views

HTTP response code: 400 while making SOAP call

We are using HttpURLConnection object to make SOAP Call. For testing I am using below wsdl which can be easily accessed using SoapUI- http://www.dneonline.com/calculator.asmx I am using Add operation ...
-2
votes
0answers
33 views

How to compare objects inside two List's with only one loop?

I have two lists of objects with the same type (Transaction), and i need to compare them. My goal is, first of all, compare "id" and secondly, if they matched, check if matches "amount". How can i do ...
0
votes
0answers
13 views

How to get all the cucumber scenario steps in before hook

I want to access all the cucumber scenario steps in @before hook. Is there a way to do this? I have tried passing the cucumber scenario object in the before hook method but it only provides the ...
0
votes
0answers
10 views

Other layouts atop of navigation view while open

I have managed to set up a left navigation menu but am having trouble setting the drawerlayout to open up above the the relativelayout and 2 linear layouts below the navigation view.These layouts seem ...
0
votes
0answers
6 views

How can i use telegram lib to auth and send message to my phone number in java?

Im trying to connect my java project to my phone number, i already have the app_id and the hash generated by Telegram. Im using https://github.com/rubenlagus/TelegramBots this library imported to my ...
0
votes
0answers
7 views

Android Notification Channel Description

Public method setDescription of the NotificationChannel class suppose to set the user visible description of this channel. public void setDescription (String description) Could anyone help me find ...
1
vote
0answers
8 views

How to add a second datasource to a Micronaut project?

I have a java Micronaut project and want to add a second datasource. My Code is working fine as long, as I add the second Datasource. The documentation just said, that I have to add a new source under ...
-1
votes
0answers
16 views

Limited Data written to file [duplicate]

Is there a limit to the file size when using PrintWriter? I am currently trying to write to a file. The data I have in a 2 dimensional array of doubles. The data I am working with currently has one ...
1
vote
2answers
35 views

Why does this method that throws an exception not have to be in a try catch block when invoked?

I invoke a method that throws exceptions, but I don't need to place this method inside a try catch block in static void main(String args[]), even though this tutorial says I should get an error. Why ...
0
votes
0answers
16 views

StringEscapeUtils.escapeHtml/escapeHtml4 inconsistent between commons-lang and commons-lang3

unit test shows StringEscapeUtils.escapeHtml/escapeHtml4 don't produce same results. trying to upgrade commons-lang(2.6) to commons-lang3(3.9) and found parity-mismatch in escapeHtml/escapeHtml4 ...
-1
votes
0answers
12 views

Case sensitive resources directory

Currently working on a mixed scala/java project. In my scala project the resources directory was name "Resources" instead of "resources". When I built the project using sbt locally there was no ...
0
votes
1answer
6 views

httpClient connection pool manager validateAfterInactivity

I am looking at the documentation of PoolingHttpClientConnectionManager https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/PoolingHttpClientConnectionManager....
0
votes
0answers
6 views

How to clone ppt template shapes to new slide with apache poi - java?

I have a ms powerpoint template .pptx file with several slides. Each slide has a group shape. I need to: read a group shape from a slide on the template pptx file (the shapes in my template have ...
0
votes
0answers
17 views

Why is Bufferedimage equaling null after a few iterations?

After a few iterations through my for loop, the Bufferedimage variable just receives a null. The first 2-3 times are usually fine. I tried different mp4 files to see if it was just the videos having ...
0
votes
1answer
14 views

Implementing Spring ThreadPoolTaskExecutor and providing the best possible configuration values

I have a for loop in which I need to make a REST call. This loop will iterate over 20,000 times as per my requirement. So, I implemented multithreading by Spring framework's ThreadPoolTaskExecutor. ...
0
votes
2answers
11 views

ViewPage swipe is hard in some android devices

I Have a view pager for image slider in my activity I have a problem when I try to swipe to another page in some android device like xiaomim, note 8 devices, the movement of the viewPager became ...
0
votes
0answers
25 views

Customize body error message - Spring boot REST

I am trying to customize my body error message. My springboot version is 2.1.5.RELEASE I want this: { "This should be application specific" } but I'm receiving this: { "timestamp": "2019-05-...
-2
votes
0answers
15 views

What is the optimal Java7 garbage collector for code with high memory usage?

I have an application running on a JBoss server based on Java7. I cannot upgrade the Java version. It has only 1GB of memory and currently uses the ParallelGC. I do not want to increase the memory if ...
1
vote
0answers
18 views

One issue using socket and threads

I'm working with sockets and threads, and I have a problem that I don't understand. After the accept(), I call thread (using pool created with ThreadPoolExecutor). The thread called (waitReplay) does ...
0
votes
0answers
8 views

Can a SOAP client in Java handle WCF message credential

Need to communicate from a Java platform with a SOAP server implemented in .NET with transport security and message credentials. A working .net client has the following setups to talk to the server ...
-2
votes
1answer
26 views

ByteBuffer Assignment Operator

What does the ByteBuffer assignment operator (=) do? Ex: public void someMethod(ByteBuffer b){ ByteBuffer buffer = b; } Does this make a copy? A deep copy? Is it just reference reassignment? ...
1
vote
0answers
11 views

Improve the working flow of multiple synchronized functions in the same class access by multiple instance of the class

I am new to the multithreading programming. I am having a problem in understanding the behaviour of synchronized method access by multiple instance of the class. In the below code am trying to ...
-5
votes
0answers
14 views

MediaPlayer + RecylerView.Разные item [on hold]

Я создал 2 item в RecyleView. На этих item кнопки play(воспроизведение аудиофайла). Есть код который проверят MediaPlayer, меняет иконки плэй на паузу и тд. Но так как у меня 2 item этот код я ...
-2
votes
0answers
19 views

Toolbar menu item disappearing after rotation

When activity+fragment are recreated on rotation the toolbar menu is inflated properly in the fragment, but then gets cleared mysteriously. I've traced the toolbar.getMenu().size() through all of the ...
-3
votes
0answers
20 views

spring-boot Unable to start embedded container NullPointerException [duplicate]

I have a program that uses spring-boot version 1.5.8.RELEASE which exposes a SOAP service via a embedded Tomcat 8.0.33. Assuming that this module works in a development environment (eclipse + windows ...
0
votes
0answers
16 views

Using @Value with Gauge framework

How can I use @Value with static Application context? I built application using gauge spring demo https://github.com/getgauge-examples/ioc-spring. App is started using ...
0
votes
0answers
10 views

A vertical seekbar to show “before-and-after” image in ImageView

Currently what I am doing is that there is a seekbar on top of the imageView. It is free to slide. Left part is the original image and right part is the processed image. There is another seekbar to ...
0
votes
0answers
25 views

Selection Sort Array in Array list [duplicate]

I want to sort name in an array in array list. Here is my code: System.out.print("Enter number of students? "); Scanner firstscan = new Scanner (System.in); int numStudents = ...
0
votes
0answers
14 views

Spring Data JPA createCountQueryFor replacement?

I have an abstract repository class, in which I compute a hibernate query (as String) and for this String I also have to create a count query. Until recently I have used QueryUtils.createCountQueryFor(...
-3
votes
1answer
30 views

Why do default values overwrite values that have been set through an overridden method

Setting a variable which has a default value, like public boolean test = false; from the example, through an overridden method causes it to be set to the default value once it gets to the constructor. ...
0
votes
0answers
8 views

how two different quartz schedulers can share the job details without db interactions?

I am creating two Quartz schedulers in my spring boot application where each scheduler is having one job.scheduler is configured in cluster mode and other scheduler is non clustered. I am trying to ...
0
votes
0answers
34 views

Spring boot: how to correctly configure and use multiple datasources

I am trying to setup multiple datasources correctly in Spring Boot with JPA 2.1.4.RELEASE. Setup is something like below: DEV: 1 server with 2 dbs: DB1 and DB2. DB1 has ABC table and DB2 has XYZ ...
1
vote
0answers
15 views

IntelliJ generated jar artifact doesn't work

I've recently finished my project and now I would like to build the artifact for it. During the process I've followed the guide provided by jetbrains which can be found here: https://blog....
0
votes
0answers
11 views

Why tx annotation-driven make a conflict?

Hi everyone I working with Spring MVC and I have a question. I have this bean definition for transaction: <tx:annotation-driven transaction-manager="txManager"/> <bean id="txManager" ...
0
votes
1answer
10 views

Deriving the DistanceMatrix from Google DistanceMatrix API

I am trying to use the calculate the Traveling Salesman Problem with Google OR-Tools. According to this tutorial. According to it, the algorithm expects a DistanceMatrix, the distance matrix in a ...
0
votes
0answers
8 views

How way around it, my behavior OnContentRead executed when uploading files? I don't need it

I configured behavior "onContentRead", and I wanna that is executed only when I read files. And now it also has been executing this behavior when I upload files:( Anyone could help me? Any ideas? ...
0
votes
0answers
9 views

Html input type=“color” crashes Java WebView android app

I have an html/css/js code with which one can design a background for your phone. It works perfectly in the browser, also on my phone, just not when I try to run it using WebView. I uploaded the ...
-4
votes
0answers
27 views

PreparedStatement issue on java

I got an error on my pstmt.executeUpdate().. I can not find the reason for the mistake, thanks to the helpers public void createCoupon(Coupon coupon) throws Exception { Connection connection = ...
0
votes
0answers
12 views

IBM Integration bus, parsing json

Hello I have a problem to parse any JSON in IIB Toolkit. The exception thrown by java compute node is: 'java.lang.NoClassDefFoundError: org.json.JSONObject I am parsing incoming json messages in UTF-...
0
votes
0answers
16 views

Zuul Configurations in Spring-boot

I'm trying to figure out how to configure below 2 values if I have an application with 1.6 millions user and with 25 zuul instances, any recommendations? also do I need to change anything else in ...