1,915,668 questions
0
votes
0
answers
41
views
Getting 401 instead of 200 as HTTP response
So I have created a REST API. Some of it protected and some are not. Strang thing is, even if I use permitAll() for these endpoints, I'm getting 401 response, instead of 200.
SecurityConfig:
public ...
-1
votes
0
answers
47
views
Session token won't be accepted
So im currently self learning and building a fullstack project. I built my Backend with Springboot and I am using Session based auth. The cors config already got all of the possible accepted origins I ...
-1
votes
0
answers
52
views
Why do I get "403 Forbidden" error when trying to use Google YouTube API Library in Java?
I was recently coding a Java app which could allow me to see latest videos from my friend's YouTube channel, including his livestreams. Checking for latest videos wasn't a big deal, but checking for ...
-3
votes
1
answer
47
views
Storing list using JPA [closed]
I'm working on a Springboot project. Trying to store a list in table column using JPA, but it is always failing. I have tried in various ways. The list is not of primitives, but a java class.
Always ...
0
votes
0
answers
39
views
How to share Avro scheme between projects in Kafka Java Spring
I have an Avro scheme, something like:
{
"type": "record",
"name": "NotificationEventAvro",
"namespace": "io.company.project1.dto....
-1
votes
1
answer
74
views
Android Capture Wi-Fi Channel utilization but always return stale/cache value [closed]
How to capture wi-fi channel utilization for system application which has carrier privilleged and also foreground service ?
AOSP ref : AOSP Wi-Fi Channel Utlization
These are the steps follow to ...
Tooling
1
vote
7
replies
138
views
Check if String only contains latin letters including accents
I want to check if a String only has latin letters (a-z / A-Z), but it may also contain letters with accents (á, à , ã, â, é, è, etc). What is the best way to do this?
If possible, I'd prefer to use ...
1
vote
0
answers
77
views
Spring Repository giving "ORA-02289: sequence does not exist" on an existent sequence, but shows lowercase name in error
I have a sequence with a schema name which does work manually in a SQL tool such as SqlDeveloper:
select CRI_API."ISEQ$$_159767".nextval from dual;
=> 22
The Java application connects to ...
4
votes
2
answers
151
views
JavaFX Clipboard.getImage() returns a fully transparent image when copying from Firefox on Windows 10
I'm reading images from the system clipboard using JavaFX:
Clipboard clipboard = Clipboard.getSystemClipboard();
if (clipboard.hasImage()) {
Image image = clipboard.getImage();
System.out....
1
vote
2
answers
152
views
With Spring Boot, a kafkaTemplate.send(topic, msg).join() returns a producer record and its metadata, but no message is in the topic
I'm using Apache Kafka 4.1.2 for a test. It has to send a message in a local-health-status-v0 topic.
The topic is created from a Spring Boot 4.0.6 @Config:
@Bean
public NewTopic healthStatusTopic() {
...
Best practices
0
votes
1
replies
66
views
Scaling of ReferenceQueue/Cleaner handling
I have a use case where many light objects share a large internal structure. In order to mitigate severe memory leaks, I want to track usage of the latter and possibly reduce its size if the ...
Best practices
0
votes
3
replies
98
views
Simplifying code operating on two similar but distinct classes
I am a Java newbie taking a 101 course. The final for the course is to complete a project, and I may have went a little more complex than I strictly needed to. I decided to build a very basic dnd ...
1
vote
0
answers
70
views
error "java.lang.AssertionError: Content type not set" when implementing controller unit test
I am implementing an integration test on a method of a controller
Here is the controller method
@PutMapping(value="/create", produces =
MediaType.APPLICATION_JSON_VALUE,
...
4
votes
1
answer
105
views
Using wildcards in Spring package-matching patterns
There are various Spring annotations that have package-matching attributes. Here are some examples from one of my test classes
@EnableJpaRepositories("com.mycompany.repositories")
@...
-2
votes
0
answers
100
views
DFS and BFS same traversal order on generic tree with Java ArrayDeque [closed]
DFS and BFS returning same traversal order on a generic tree using Java Collections (ArrayDeque)
Problem
I implemented DFS and BFS traversals for a generic tree using ArrayDeque in Java. Both ...