Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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
3 views

@Cacheable conditional caching on request fields

I have used spring @Cacheable for caching as shown below: @Cacheable public Response mycall(Request request) Now I want this method call to be cached only if request.getId()!=3, where getId() is a ...
0
votes
0answers
5 views

What is the best way to include lists of data for Android development, that are needed for the first opening of the application?

I am relatively new to Android development and I am creating an app that has 4 lists of about 100 strings each, these are needed to run the app itself, but the user also needs to be able to append ...
0
votes
0answers
6 views

Libgdx set ortho camera

I'm having problems setting my orthographic camera to the bottom middle part of my screen public GameScreen(Main game) { this.game = game; Width = 200; Height = 300; view = new ...
0
votes
0answers
8 views

How to send multiple edit text from add view to mysql?

i just want to send values from edit text parent and child layout with add view to mysql database. Any idea? i tried but i don't know i cannot get data from my child layout. i want to display in ...
0
votes
0answers
17 views

Regex or String operation to derive automatic module name from String

I need to find the Automatic Module name given a String filename, as: "common-io-1.2.3.jar" -> "common.io" "---apple...orange..jar" -> "apple.orange" "google-api-v1.34.jar" -> "google.api.v1"...
0
votes
0answers
6 views

Desktop client for a foreign app?

How would I, in theory, go about opening any webpage (in this case instagram.com) in my own application independent from any webbrowser? To further elaborate: I would like to display instagram's web ...
0
votes
0answers
6 views

Create custom android keyboard with keys that have one charcter above another

I need help getting a custom android keyboard to have keys with one character above the other, like the stock samsung keyboard. I understand i need to use ondraw, import.graphics.x and so on, ...
0
votes
0answers
4 views

button does not appear in design view android studio

Building an android app. The idea is to open a second activity. When building get an error class interface or enum expected where it says Activity { Button button ... and also where it says void I ...
0
votes
0answers
10 views

Connecting node client side to maven server side

I made a maven project and coded both client side and server side on this maven project. Server side code is in src/main/java and client side code is in src/main/webapp, so when I go to localhost:...
0
votes
0answers
11 views

How do I add a mailto:name hyperlink into JOptionPane? [duplicate]

I am trying to get a mailto:person hyperlink to work (which would open Outlook with the email address populated in the To field), but I am having difficulty. I tried using the standard HTML way to ...
0
votes
0answers
7 views

Issue to pass JSON string from fragment to adapter

I am a newbie to android Development, I was trying to implement a list view with items, by which when an item clicked it should display another list view with lists of specific items, I used JSON ...
-1
votes
3answers
48 views

Need suggestion about the name of the class [on hold]

There is some object say, ABC, which I get in different ways. I have added all these methods to get the object ABC in a separate class. Now my question is how should I name this class? I have named it ...
1
vote
2answers
23 views

Convert Java Object to String in SpringBoot JPA Method

I am working on Springboot MySQL example(Similar example). In one of the methods, I want to log JSON data but I am getting, com.example.employee.model.Employee@1595ddd2 @RequestMapping(value="/...
0
votes
0answers
6 views

creating a file inside a SOAP service project

I am working on a java project where I have created a SOAP service. What I have a problem with is when I want to create a file from the service class, while communicating with a client, it gets ...
-2
votes
3answers
33 views

Array with random integers

I need and array that generates 10 random numbers between 1 and 5, inclusive. I then need to display the number of times 1-5 shows up in the array. This is what I have so far, it runs fine, it's just ...
0
votes
0answers
6 views

Override not working on onNewTask() in FirebaseMessagingService

I've just installed Firebase in my Android app to enable push notifications. I confirmed it's working by sending a push notification from the Firebase console to all devices running the app. Now I'm ...
0
votes
1answer
16 views

Access database that is outside the docker environment

I created a microservice environment, more precisely 5 services, where they are connected to each other and access the same database (PostgreSQL). After development, I started to create the docker ...
0
votes
0answers
4 views

Hibernate, @JoinTable & JoinColumns make an insert that doesnt include a not null

So I have a function: @ManyToMany(cascade = CascadeType.ALL) @JoinTable(name = "tablename", joinColumns = @JoinColumn(name = "idvalue1"), inverseJoinColumns = @JoinColumn(name = "idvalue2")) ...
0
votes
0answers
10 views

How can i use different slot to make a call in Android Studio

need help to make an application who let me make a call with any slot for dual sim devices in android Studio .
-1
votes
2answers
26 views

Generic Before Retun type

Whats really mean the <T> Parameter before the return type? public interface Listener<T, R> { <T>Listener<T, R> get(); I understand the meaning in the class declaration ...
0
votes
0answers
8 views

Manage Timeout with Apache Camel

I have the following Route definition: @Override public void configure() throws Exception { from(String.format("direct:%s", this.connector)) .id("Route1") .threads() .maxPoolSize(10) ...
0
votes
0answers
8 views

java.lang.IncompatibleClassChangeError: org.apache.neethi.AssertionBuilderFactory on WAS server

Before posting here, I have found other link for solution but that doesnot work for me. Already provided solution I have a Spring CXF Ear (CXF Version : 3.1.5). When I build the Ear and deploy it in ...
0
votes
1answer
12 views

Connect tomcat and mysql in docker-compose

I'm working on project for studies. Now I am at the stage of moving project to docker containers. I have placet tomcat with my website and mysql with database do docker-compose.yml. Unfortunately ...
0
votes
0answers
5 views

Maven Assembly Plugin Merge Strategy

I am trying to convert a Scala/Java project build from sbt to Maven. I have gotten the project running with no issues except when trying to package the fat jar. I am running into some problems ...
-3
votes
0answers
23 views

In Java, how can I read an IBM alpha data area

The data area in in JDEMOD94.Dates, it was created in RPG LE. I am using Java, how can I read the content of this data area? Thanks Carlos
0
votes
0answers
14 views

scheduleAtFixedRate doesn't repeat runnable [duplicate]

It's my first attempt to create an action in activity, which should repeat periodically. My snippet looks like this private void setBackground(final ConstraintLayout mainActivityLayout) { //...
-1
votes
4answers
31 views

Superclass and class having the same method

I have a superclass called Base, that implements two functions: protected void callSomething() { doSomething(); } protected void doSomething() { } The second class only exists because I need it....
0
votes
1answer
29 views

How to throw Checked Exception inside lambda Java8?

I am trying to throw an exception inside lambda but it keeps giving me an error saying that Unhandled IOException. private <T> T getResponse(final RestURI query, final Class<T> ...
0
votes
0answers
10 views

Java - Scanner Method that opens, reads a single line, then closes? [duplicate]

How do I make a method that reads a single line then return the String input to assign to a variable? I tried to make a method that reads a single line and return the input as a String . It ran into ...
1
vote
1answer
22 views

Update files insite Jar file

Basically I have a Jar file capable of parsing Java files and do some calculations based on the parsed values. The problem is that the grammar in this Jar is old and only supports version 1.5 of Java....
0
votes
1answer
19 views

Postgres JDBC connection as app user instead of system user

I'm using flyway to migrate my integration test DB as part of my maven build. I have flyway configured to run during the pre-integration-test phase. It cleans and then rebuilds the DB each time. &...
1
vote
1answer
22 views

Ids for this class must be manually assigned before calling save on String ID

Already read lots of questions about the same issue, but I still not be able to solve this problem. I need to have a String primary key on my database. import javax.persistence.Entity; import javax....
0
votes
1answer
16 views

Notifications oreo api 26 - were working perfectly, now they're not

thanks for your time. I had notifications working perfectly after implementing channels etc, but then they suddenly stopped working. I'm wondering is it the dependencies or something? Notification ...
-4
votes
0answers
16 views

How to list the default and available thread schedulers for java programs through command line?

What command should be entered to read about default thread scheduler, and available alternatives?
0
votes
0answers
12 views

Use of Consul over Spring Profiles and JNDI

In our application, we are using consul for storing values for properties like datasource username, password(in encrypted form) etc. I was reading on Spring Profiles and JNDI, as per my understanding,...
-4
votes
0answers
18 views

Java API to work with Apache Spark and OrientDB [on hold]

I was reading on working with Apache Spark and OrientDB. I could see examples for scala api. However i am trying to write in java and couldnt find much examples regarding that. Are there any examples?
0
votes
0answers
21 views

Create image files which don't appear in galley

I'm creating some image files from bitmaps in my android app and I don't like them to be shown in device gallery. Just like Telegram that saves images in Telegram folder but they never show up in ...
-5
votes
0answers
24 views

I'm getting error while submission otherwise it is giving desired output [on hold]

https://ide.geeksforgeeks.org/mcgc7lhVyy Input: 8 Hi Hello HelloWorld HiTech HiGeek HiTechWorld HiTechCity HiTechLab HT Its Correct output is: HiTech HiTechCity HiTechLab HiTechWorld And my Code's ...
0
votes
0answers
11 views

Attempting to connect to a deployed Cassandra DB behind Authentication

I have a deployed Cassandra DB that I've been trying to connect to but I get the below error message: Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for ...
0
votes
0answers
12 views

Elastic data won't display properly in android

I have created an elastic index with products And every product has a Category, Sub category, Sub Sub Category. I have hardcoded name of all Category, Sub Category and Sub Sub category in my ...
0
votes
1answer
28 views

Convert HTML's font size attribute to CSS font-size attribute

My question is pretty much a duplicate question from Convert font tag (size attribute) to css I see the answers there are from 2014. So I wasn't sure to continue to ask there or to make this new ...
-3
votes
0answers
19 views

How to fix “Expecting a top level declaration” in Android studio

How do I fix the error of "Expecting a top level declaration" in Android studio activity_main
1
vote
3answers
42 views

How to create a custom exception which wraps mutliple exceptions in java

How to create a custom exception which wraps three different exceptions like InvalidContextException, IllegalArgumentException. For example, let's say there is a method: public void method() throws ...
0
votes
2answers
24 views

NullPointerException for LatLng GPS location

I am using Google Maps to obtain my current location and display a red marker on my location. So far it only the mMap.setMyLocation(true); works for my location. I am getting NullPointerException for ...
0
votes
0answers
10 views

Using eclipse & tomcat to test a war

I have several web services packaged as a .war file that is build by ant. I would like to test these wars as an Eclipse Dynamic Web Service. All the examples and help I've seen are based on Eclipse ...
-1
votes
0answers
32 views

Passing dynamic values to Java annotations

Consider the following scenario: public void someMethod() { } I want to annotate someMethod() with a custom annotation say @CustomAnnotation. I want to take take dynamic parameter into ...
1
vote
2answers
42 views

Is there a Map object with takes index and key and object? Java

I'm trying to emulate a rotor of an enigma machine in Java. I need an object which takes an index, a key and an object, because I unsuccessfully tried HashMaps like this: private HashMap<Integer,...
0
votes
2answers
17 views

javax.mail.AuthenticationFailedException: 535 5.7.3 Cannot send mail

I'm having trouble with error javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication when trying to send an email. I've tried using two different email accounts. One using Office365 ...
0
votes
0answers
16 views

Jackson 2 @JsonConstructor with partial json deserialization

Given: The following bean: public class A { private final int a; private final int b; public A(int a, int b) { this.a = a; this.b = b; } } The following json: {"a":1} A ...
-3
votes
0answers
15 views

Spring-boot web application integration with zebra printer

my requirement is to print barcodes using spring-boot web application printers from zebra printers I got the IP address of the printer does any one have exp in this kind of work if so could you please ...