I make simple database of names. There are only three names: Adam , Arnold and Matin. And I want to get all names that contains letter “a”. I have in my repository this method: Let String letter = “a”; It returns all names(List of names), because it find some “a” or “…
Tag: java
Failed to read candidate component class when testing Spring Data Repository – IndexOutOfBoundsException
I’m trying to test a Spring Data JPA repository but when I run the test I always get the following error The class it talks about is a pretty simple entity If I comment the @Table annotation I get the same error on the next class. I also had the issue on a classe with @Cacheable and it gave me
java – Set final fields with reflection in Constructor
I’m trying to make a multi-language app with messages inside multiple *.properties files. I’ve started working on something like this: Now, there’s a lot of messages, and I don’t feel like typing the same thing each time (plus there could me typos which could be an issue…). The f…
SpringBoot app does not run with exceptions
I am new at Spring Boot so I’m trying to create a simple Crud but I keep getting this error when I run my application I spose it must be some version problem but I don’t know how to fix it. I created the project with STS on ubuntu using mostly default options Answer It looks like you have java
Why is my app Crashing with RecyclerView?
I’m doing a recycler method in my android studio project but i have a problem. Everytime i’m trying to findViewById my application is crashing. And i don’t understand why because i’m creating my view in the good way. And i’m trying to continue with that But i’m crashing at …
near “”: syntax error in SQL with android studio
I’m working on a SQL databse on java (android studio project) but i have a weird mistake. Basically, everytime i have I have tried like this My DBS is And i really don’t see where is the mistake. Because they’re saying “syntax error”, but for me, it’s look pretty OKAY. Anyo…
Maven install fails with type=pom dependency
I’m updating a maven dependency tika-parsers from v1.14 to v2.4.0. Changing the version alone causes maven to fail to find the jar: Could not resolve dependencies for project samm:samm:war:2.0.0: Could not find artifact org.apache.tika:tika-parsers:jar:2.4.0 in central (https://repo.maven.apache.org/mav…
In IntelliJ IDEA, while taking input in an array from console, character of enter key is accepted as an element
I was seeing an example of linear search in an array in Java, and I wrote this code: But while running this code, due to the System.out.println() at the 10th line, the carriage return (of the println() ) is taken as the element at index 0. Further, as I enter more elements, after each element I need to press …
How to search backward for substring of string (backword indexOf) starting from specific index
I would like to search for substring of string starting from specific index. Let’s say I have string: “PO DAD PO PE DA X PO ZA RA” Index from which I want to start is character X, so is 13. If I would like to search normally for ‘ZA’ I would do something like: “DAD PO PE DA…
BluetoothGattCallback onCharacteristicRead never called back
I’m still trying hard to read from a BLE device (laser meter) from an android (using java) Basically I’m trying to get which fields are those I’m interested into (aka the measures) So far i discovered 5 services (i found the usage here): 3ab10100-f831-4395-b29d-570977d5bf94 (I can’t fi…