I have a simple java console application. pdfbox is utilized to extract text from PDF files. But there is continuous info printed in console: I really want to remove this information from the console. And I use logback for logging, the logback.xml is just like: I have find some answer say that should change the Level. I have changed the
Adding spring security to an existing Spring MVC
I have spent hours to look for answers and fix this problem. But after spending many hours it seems I might need to put this question for help. I saw many similar scenarios but none became an answer. I already have a spring web application that runs well with out authentication. I am trying to implement a simple spring security
IntelliJ Idea not resolving Mockito and JUnit dependencies with Maven
I am using IntelliJ idea for writing simple unit test cases using JUnit and Mockito. I am using Maven for dependency management. IntelliJ idea keeps complaining that following imports cannot be resolved: Following is the dependencies section of my project: Following is my project structure: Answer Try View -> Tool Windows -> Maven projects, then click the blue icon in
How to convert an interface with MapStruct?
I made some research in the mapStruct documentation but did not find or understood what I could do to achieve this: the conversation of an entity containing an interface to a flat DTO object. Here the entity with the attribute: Here the DTO: We try this mapping : With a classic mapping, mapStruct generates an error (IUser is abstract; cannot
“NoClassDefFoundError: javax/xml/bind/DatatypeConverter” with SQL Server JDBC
I recently switched to intellij but I’m finding it hard to connect to my localDB. The same code worked on eclipse fine. Also I have already added the sqljdbc42.jar as a module dependency. Error produced: Any help would be greatly appreciated. I’ve also tried the overloaded DriverManager.getConnection(url, user, pass) method and same error. Answer For Java 9+ compatibility, you need
How to move from deprecated Task to ApiFuture for firebase admin SDK 5.4 and above
I’m just trying to solve the deprecation notes from my Java code of new firebase-admin SDK, the code is written in version 5.3.1 but after upgrading the version into 5.5.0 the deprecation notes appeared, here is a sample of my code: Using FirebaseAuth (deprecatation on: Task, addOnSuccessListener and addOnFailureListener) : And for FirebaseDatabase (deprecatation on: Task, addOnSuccessListener, addOnFailureListener, updateChildren and
When not to use AsyncAppender in logback by default
Logback supports using an async appender with the class ch.qos.Logback.classic.AsyncAppender and according to the documentation, this will reduce the logging overhead on the application. So, why not just make it the default out of the box. What usecases are better served by using a sync appender. One problem I can see with the Async appender is that the log messages
Handling positions in FirebaseRecyclerAdapter
I have fiddled with the FirebaseRecyclerAdapter for quite some time now. It’s really a great tool to populate a custom list/recycler view very fast with all of its features. However, one thing that I would like to ask is how to handle positions of items inside the adapter itself. So for example, I want to mimic this small feature that
What is the difference between AccessLevel.PACKAGE and AccessLevel.MODULE?
In Lombok, what is the actual difference between and ? Answer That is a good question. I tried creating some setters for some test methods and all I got was (decompiled): So, on first look it appears that there is no difference. So, I looked into the source code and all I could verify is that for the time being
Convert Soap XML response to Object
i’m new to working with SOAP API’s I have a soap response from an API I’m trying to transform this into an object. From reading articles online I’m trying to use JAXB to do this, but my object is empty. Here’s the code for reading the response. I wrote the response to an xml file for test purposes: The LoginResult