Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts tagged java

36 child tags

Use for questions about Java, a high-level programming language. Consider tagging the question with more specific tags related to the actually used framework (e.g. [spring], [spring-boot], [jakarta-ee], [android], [javafx], [gradle] and [maven]).

This tag doesn't have a detailed wiki yet.

80%
+6 −0
Q&A Java record with final keyword

Although record classes in Java are implicitly final, it's valid to add the final modifier/keyword when declaring a record: final public record Person(String name, String location) {} Does fina...

1 answer  ·  posted 1mo ago by Matthias Braun‭  ·  edited 1mo ago by Matthias Braun‭

Question java
50%
+0 −0
Q&A Proguard induced : No enum constants for class while deserializing using jackson

I'm getting the following exception with deserializing a json file using jackson. Any tips on how to fix it? com.fasterxml.jackson.databind.JsonMappingException: No enum constants for class com.dp...

1 answer  ·  posted 3mo ago by Abbas Gadhia‭  ·  edited 3mo ago by Abbas Gadhia‭

Question jackson proguard
60%
+1 −0
Q&A Scanner fails when executing Java with admin rights (sudo) in Eclipse in Linux

(Brought over from SE.) The problem I have followed this procedure in order to run Java applications as root when needed from Eclipse (as I use Xubuntu, for instance, when using jnetpcap to cap...

1 answer  ·  posted 3mo ago by aura-lsprog-86‭  ·  edited 3mo ago by aura-lsprog-86‭

Question java linux Eclipse sudo jnetpcap
60%
+1 −0
Q&A How can I set a private class instance variable to the File object used by an unmarshaller?

(Brought over from SE) The problem I'm coding a Java Swing application dealing with XML files, so I'm using JAXB in order to marshal classes into documents and unmarshal the other way around. ...

1 answer  ·  posted 3mo ago by aura-lsprog-86‭  ·  last activity 3mo ago by aura-lsprog-86‭

Question java event-handling callback jaxb
60%
+1 −0
Q&A How to do function composition in Spring Cloud Stream when using classes

I'm working on a proof of concept for a Spring Cloud Stream application. I want to define my processing logic using classes that implement Function, Consumer, or Supplier. I understand that Spring...

0 answers  ·  posted 5mo ago by ɯıpɐʌ‭  ·  last activity 4mo ago by Monica Cellio‭

Question spring-boot spring-cloud spring-cloud-stream
66%
+2 −0
Q&A Unable to configure enhanced route discovery in Apache Camel

I'm currently working with Apache Camel in a Quarkus application. I would like to configure the application to not discover any routes by default, and only include those defined in specific package...

0 answers  ·  posted 5mo ago by ɯıpɐʌ‭  ·  edited 5mo ago by Alexei‭

Question java quarkus apache-camel enterprise-integration-patterns
77%
+5 −0
Q&A Why does a lack of object encapsulation constitute a security breach?

In the current version of OpenJDK's JEP 401: Value Classes and Objects (Preview), it is said that value classes can leak data stored in their fields, and that this is potentially a security concern...

2 answers  ·  posted 10mo ago by Andreas demands justice for humanity‭  ·  last activity 5mo ago by LAFK‭

Question java security encapsulation
50%
+1 −1
Q&A How can I properly implement Hexagonal Architecture and Domain Driven Design in the same application?

I'm trying to use the "hexagonal architecture" and "domain-driven design" paradigms together, in a Java application using Spring. I understand that my application should have a structure with 3 la...

1 answer  ·  posted 7mo ago by rudahee‭  ·  edited 6mo ago by Karl Knechtel‭

Question java spring hexagonal-architecture domain-driven-design
66%
+2 −0
Q&A LocalDate format in fields stored as json via Hibernate

Setup I have a database table with field of JSONB type. I access said database using Hibernate. In hibernate I have entity mapped on said table. Entity contains field marked with @JdbcTypeCode(...

1 answer  ·  posted 7mo ago by talex‭  ·  last activity 7mo ago by talex‭

Question java json spring hibernate
66%
+2 −0
Q&A Multiple versions of scala libraries detected!

While compiling my scala project I'm getting following error. org.scala-lang.modules:scala-parser-combinators_2.13:2.4.0 requires scala version: 2.13.13 org.scalatest:scalatest_2.13:3.2.19 requ...

0 answers  ·  posted 7mo ago by talex‭

Question maven scala
77%
+5 −0
Q&A Json deserialization of enum, forbid int

I have a DTO that contains an enum field: @Getter @Setter static class Foo { Bar bar; } enum Bar { X, Y } When I deserialize a JSON, it allows int as values: var objectMapper ...

2 answers  ·  posted 8mo ago by talex‭  ·  edited 8mo ago by hkotsubo‭

Question java json jackson
66%
+2 −0
Q&A SQL scripts referenced in persistence configuration must have each statement on its own line

I'm currently working on a Java application using Jakarta Persistence with EclipseLink and PostgreSQL. While setting up the application to test the database layer, the persistence configuration is ...

0 answers  ·  posted 8mo ago by ɯıpɐʌ‭  ·  edited 8mo ago by ɯıpɐʌ‭

Question java sql jpa jakarta-ee jakarta-persistence
83%
+8 −0
Q&A Map<?, Optional<T>> to Map<?, T>

I have a Map with Optional values. I want to filter it to remove empty values. Map<K, Optional<T>> input; Map<K, T> result = input. // here is some code I'm looking for ...

2 answers  ·  posted 8mo ago by talex‭  ·  last activity 8mo ago by hkotsubo‭

Question java stream
71%
+3 −0
Q&A Prevent anonymously subclassing

Is it possible to somehow prohibit anonymously subclassing of a specific class? For instance, with a plain public parent class: public class Parent { } Extending this class should not be pos...

1 answer  ·  posted 10mo ago by Andreas demands justice for humanity‭  ·  last activity 9mo ago by Antares‭

Question java inheritance
66%
+2 −0
Q&A Spring Boot application not excluding Jdbi bean when running tests using WebFluxTest

I have a simple Spring Boot 3.x reactive application that exposes a RESTful API. The application uses Jdbi in the persistence layer, and the configuration for Jdbi is straightforward: @EnableTrans...

0 answers  ·  posted 9mo ago by ɯıpɐʌ‭

Question java spring spring-boot jdbi
66%
+2 −0
Q&A Maven JPA integration: processor not found

My annotation processor "cannot be found" but everything ~looks okay. In Eclipse IDE, I created a new Maven project with the "quickstart-architype" resulting in a project with this structure: ___...

1 answer  ·  posted 1y ago by tylerbakeman‭  ·  edited 11mo ago by Andreas demands justice for humanity‭

Question java xml jpa
66%
+2 −0
Q&A Maven exec:exec fails to see executables

I am stumped at Maven exec plugin. Running mvn exec:exec -Dexec.executable="curl" (or "echo") works. But when running mvn exec:exec or mvn exec:exec@b (or @a) it fails saying The parameter 'exe...

1 answer  ·  posted 2y ago by LAFK‭  ·  last activity 1y ago by mirabilos‭

Question maven maven-exec-plugin
60%
+1 −0
Q&A ServletContext matched by more than 1 path

The javadoc for ServletContext.getContextPath() says that It is possible that a servlet container may match a context by more than one context path. I was trying to find any explanation how t...

0 answers  ·  posted 1y ago by morgwai‭

Question java servlets jakarta-ee
77%
+5 −0
Q&A How can one import two classes with the same name in Java8?

Some development tools provide an error message when a user tries to import two things (classes, packages) with the same name. Some programming languages offer a syntax to import one of those thing...

2 answers  ·  posted 1y ago by tarhalda‭  ·  last activity 1y ago by Michael‭

Question java java-8
40%
+0 −1
Q&A Eclipse Custom Errors for Annotation Processing

In Eclipse, is it possible to setup custom errors or markers in the editor, for annotation processing? For example, the standard squiggly lines with descriptions. This question is not important. ...

0 answers  ·  posted 1y ago by tylerbakeman‭

Question java jpa Eclipse
60%
+1 −0
Q&A How to log first n lines of a stack trace in Java?

How to log first n lines of a stack trace in Java?

2 answers  ·  posted 1y ago by propatience‭  ·  last activity 1y ago by hkotsubo‭

Question java logging stacktrace
60%
+1 −0
Q&A MongoDB Java Morphia case insensitive criteria query?

So I googled some on how to make a case insensitive criteria query but could not find the solution very easily. So I basically have code that looks like this: ... query.criteria("fieldName").con...

1 answer  ·  posted 1y ago by propatience‭  ·  edited 1y ago by propatience‭

Question java mongodb morphia case-insensitive
66%
+2 −0
Q&A What is the purpose of having a wrapper class for JarFile in Spring-boot-loader?

My question relates to Spring-boot-loader v2.6.15. For the purposes of this question, I will refer to Spring's custom JarFile class as CustomJarFile to avoid confusion. Context I am reusing so...

1 answer  ·  posted 1y ago by Miss Skooter‭  ·  last activity 1y ago by Miss Skooter‭

Question java spring spring-boot
66%
+2 −0
Q&A Escape both reserved characters and curly braces in a URI in Spring Boot

I need to pass URI's that contain special characters, using Spring Boot. The characters include spaces, curly braces ({ and }), square brackets ([ and ]), and hash signs (#). The problem is that ...

1 answer  ·  posted 1y ago by FractionalRadix‭  ·  last activity 1y ago by FractionalRadix‭

Question spring-boot escaping uri
50%
+1 −1
Q&A How do I properly render a quad in OpenGL using a GL_TRIANGLE_STRIP primitive?

I am currently working with LWJGL and the obstacle I face right now on my project is rendering textures to a cube, e.x a set of 8 vertices with position, color, and UV information. For now, I am st...

1 answer  ·  posted 1y ago by cuzzo‭  ·  last activity 1y ago by djm‭

Question java game-development graphics OpenGL lwjgl
71%
+3 −0
Q&A Clear selectManyMenu component if user unselects item in JSF 2

I am working with JSF 2.3 and have a selectManyMenu component that is marked as required but that I want to be cleared if the user unselects all items. Currently, the user can unselect all items, b...

1 answer  ·  posted 2y ago by tarhalda‭  ·  edited 1y ago by BalusC‭

Question java ajax jsf selectmanymenu
66%
+4 −1
Q&A How do I remove an element from a Java array?

One way to remove element from array is to replace element with zero. Below is a rough snippet I am sharing: int N = sc.nextInt(); int pos = sc.nextInt(); int A[] = new int[N]; if(pos == i) { ...

1 answer  ·  posted 1y ago by abhinavxyz‭  ·  edited 1y ago by E_net4‭

Question java array
60%
+1 −0
Q&A How to put text next to my ImageIcon on a cell in a JTable

I have an application that works with a JTable, and in this JTable, I want each cell to have both an ImageIcon and some text. I see at this link, JTable supports ImageIcon OR text, but seemingly n...

1 answer  ·  posted 2y ago by davidalayachew‭  ·  edited 2y ago by Alexei‭

Question java swing JLabel ImageIcon
77%
+5 −0
Q&A How to trigger an error/warning immediately upon compile/run if an item on my class-path is missing

I have a very simple source file -- HelloWorld.java public class HelloWorld { public static void main(String[] args) { System.out.println("hello world"); } } I have th...

0 answers  ·  posted 2y ago by davidalayachew‭  ·  edited 2y ago by davidalayachew‭

Question java compiler-errors compiler-warnings javac classpath
66%
+2 −0
Q&A Log4j2 not looking for log4j.properties even with the system property set

I am migrating an application from Log4j1 to Log4j2 using the API bridge jar. All references to the log4j1.jar have already been removed. I set the system property in Websphere as a JVM argument -...

1 answer  ·  posted 2y ago by tarhalda‭  ·  edited 2y ago by Alexei‭

Question java log4j
71%
+3 −0
Q&A Running mvn validate does not show rules passed message though it should

My large, multi-module Maven project validation (Maven Enforcer plug-in) is playing tricks on me. moduleA> mvn validate correctly finds all modules runs enforcer on all of them displays co...

0 answers  ·  posted 2y ago by LAFK‭

Question maven maven-enforcer-plugin
75%
+4 −0
Q&A DocuSign eSignature API SDK: java.lang.NoClassDefFoundError errors.

I am trying to implement DocuSign's eSignature REST API by using Java SDK. I am following instructions here: https://developers.docusign.com/docs/esign-rest-api/sdks/java/setup-and-configuration/ ...

1 answer  ·  posted 2y ago by Vanity Slug ❤️‭  ·  last activity 2y ago by Vanity Slug ❤️‭

Question java sdk docusignapi maven
77%
+5 −0
Q&A Is it worth using the Java Platform Module System in application code?

Is it worth using the Java Platform Module System introduced in Java 9 to structure application code? Given that the Java Platform Module System introduced in Java 9 doesn't manage dependency vers...

1 answer  ·  posted 4y ago by meriton‭  ·  edited 2y ago by __blackjack__‭

Question java architecture
81%
+7 −0
Q&A How to verify if a year is leap in Java?

How to verify if a year is leap? Given a numeric value (such as 2023) or some object that represents a date (such as Date, Calendar, LocalDate, etc), how can I do it?

1 answer  ·  posted 2y ago by hkotsubo‭  ·  last activity 2y ago by hkotsubo‭

Question java date
50%
+1 −1
Q&A Rest service doesn't find @GET Method (Jersey Rest service in Gradle).

I have to implement a JSON based REST web service for querying literature. Ordinary users should be able to query data and process it in their clients. The "main user" can adapt database entries vi...

0 answers  ·  posted 2y ago by Gagamelius‭  ·  edited 2y ago by Alexei‭

Question java json rest gradle jersey
55%
+3 −2
Q&A How to proportionally convert a number in the range of -1 and 1 to a number in the range of 0 and 319

I have float noise values, between -1 and 1, for every x,y coordinate in a 2D area and I am trying to convert that to a whole number between 0 and 319 which represents a vertical z coordinate to re...

3 answers  ·  posted 2y ago by cuzzo‭  ·  last activity 2y ago by Dirk Herrmann‭

Question java 3d math
66%
+2 −0
Q&A How would I avoid textures being blurred when mapped to a TriangleMesh?

I am making a game using JavaFX and the Fxyz library. I have chunks which are made of Point3D's, these points are then passed to a ScatterMesh and that is used to generate a TriangleMesh so I can m...

0 answers  ·  posted 2y ago by cuzzo‭  ·  edited 2y ago by Alexei‭

Question java 3d javafx fxyz3d
33%
+0 −2
Q&A Deep linking from another app isn't working for Amazon prime and disney+hotstar

It's not possible to send data to amazon prime and disney+hotstar. I was trying to send user to amazon prime when they click a (video) link (e.g. https://www.amazon.com/gp/video/detail/B01MSPI8JN/r...

1 answer  ·  posted 2y ago by billy‭  ·  last activity 2y ago by billy‭

Question java android deep-linking
28%
+0 −3
Q&A How would I go about chunk loading around player in a 3 dimensional cartesian coordinate space [closed]

So I am in the process of creating a voxel sandbox survival game (minecraft clone) in javaFX. I am at a point where I need to come up with a way to load the chunks in my surrounding given a render ...

1 answer  ·  posted 2y ago by cuzzo‭  ·  closed 2y ago by cuzzo‭

Question java javafx
66%
+2 −0
Q&A Why is IntelliJ not finding these modules?

So to preface I started a new JavaFX project in IntelliJ and all of this is from what was auto-generated out of the box. The modules I'm having trouble with are Edit to make this post more query...

1 answer  ·  posted 2y ago by cuzzo‭  ·  last activity 2y ago by cuzzo‭

Question java intellij-idea
37%
+1 −3
Q&A Java cannot find class within same package

I've written a class object, QueueObject, but when I try to construct it inside of my main class, it says it cannot find the symbol on compilation. I've read lots of pages saying how misspellings o...

1 answer  ·  posted 3y ago by cuzzo‭  ·  last activity 2y ago by cuzzo‭

Question java class
42%
+1 −2
Q&A How to solve missing JAR files error from Ant

I keep getting this error: Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec was not found. This looks like one of Ant's optional components. Action: Check that the ap...

1 answer  ·  posted 3y ago by Megan‭  ·  last activity 3y ago by Megan‭

Question linux jenkins ant jar
77%
+5 −0
Q&A How to open a file and edit its content in groovy script

I have a Makefile in my Jenkins job's workspace, that I want to edit out certain parts from and then save it, before running next part of the script that uses this Makefile. The part that I want t...

2 answers  ·  posted 3y ago by Megan‭  ·  last activity 3y ago by Alexei‭

Question jenkins shell groovy
75%
+7 −1
Q&A How to avoid "exception is never thrown" when commenting out a line while debugging

I have a code block like this: try { ... x.foo(); // This is the line that forces us to have the try block ... } catch (ArrayIndexOutOfBoundsException e) { logger.error(e.getM...

1 answer  ·  posted 3y ago by klutt‭  ·  last activity 3y ago by anatolyg‭

Question java exception
57%
+2 −1
Q&A How can the Caesar cipher be implemented in Java?

The Caesar cipher is a substitution cipher in which the letters of an ordered alphabet are cyclically shifted by a given number. A detailed description can be found e.g. here. Let u be the index o...

2 answers  ·  posted 3y ago by Holden‭  ·  last activity 3y ago by hkotsubo‭

Question java encryption caesar-cipher
37%
+1 −3
Q&A Mocking methods with arguments

Let's say I have this class I want to mock class A { public void add(T arg) { B b = A.getB(); U val = somefunc(arg); V ret = b.add(val); } } I have a spy o...

3 answers  ·  posted 3y ago by klutt‭  ·  last activity 3y ago by klutt‭

Question java mocking junit mockito
42%
+1 −2
Q&A How to create an object, call one of it's methods and pass it as an argument as a oneliner?

Assume I have this class Foo class Foo { private int x; void setX(int x) { this.x = x; } } And I have a Junit test like this: Bar bar; @BeforeEach void setu...

3 answers  ·  posted 3y ago by klutt‭  ·  last activity 3y ago by Alexei‭

Question java junit
72%
+6 −1
Q&A How to unittest method that involves contacting remote servers?

Let's say I have this class: class myService { private boolean foo(T arg) { return arg == 42; } public Response bar(U arg) { if(foo(U.field)) { return Response.st...

1 answer  ·  posted 3y ago by klutt‭  ·  last activity 3y ago by meriton‭

Question java unit-testing junit
66%
+2 −0
Q&A How to check if a ldap username is valid without contacting the active directory via ldap?

I have some code connecting to an active directory via ldap. Something like this: public Response add(User user) { try { LDAPConnectionPool ldapPool = ldapConnectionPool.getPool();...

0 answers  ·  posted 3y ago by klutt‭  ·  edited 3y ago by klutt‭

Question java spring-boot ldap active-directory
40%
+2 −4
Q&A How do I properly format a String for parsing with a com.google.gson.JsonParser

I am trying to check a JSON array for a certain element. However, when I try to instantiate a JsonElement to search the list for: JsonElement builderElement = JsonParser.parseString( "{\"disc...

0 answers  ·  posted 3y ago by cuzzo‭  ·  edited 3y ago by Stephen C‭

Question java json json-parser