Posts

Showing posts from August, 2021

Gson / jackson Error with spring, Spring eureka client server error

 This is because of version mismatch Either add parent of spring in your pom file Or add seperate gson dependency in pom file or add jackson core, annotations etc or, json what ever error is arrived with its own version from maven repo manullay. Its not good idea to depend on spring parent to solve it. < dependency > < groupId >com.fasterxml.jackson.core</ groupId > < artifactId >jackson-annotations</ artifactId > < version >${jackson-version}</ version > </ dependency > < dependency > < groupId >com.google.code.gson</ groupId > < artifactId >gson</ artifactId > < version >${gson-version}</ version > </ dependency >

Error “Source option 5 is no longer supported. Use 6 or later” on Maven compile

Image
 https://stackoverflow.com/questions/53034953/error-source-option-5-is-no-longer-supported-use-6-or-later-on-maven-compile

save github username and password

  git config --global credential.helper store This could be the command i am not sure.  https://stackoverflow.com/questions/35942754/how-to-save-username-and-password-in-git

Fatjar and original jar. compile with command line in java spring boot

 https://www.baeldung.com/spring-boot-repackage-vs-mvn-package < build > < plugins > < plugin > < groupId >org.springframework.boot</ groupId > < artifactId >spring-boot-maven-plugin</ artifactId > < version >2.5.1</ version > < configuration > < mainClass >com.himal77.ExamPortal</ mainClass > </ configuration > < executions > < execution > < goals > < goal >repackage</ goal > </ goals > </ execution > </ executions > </ plugin > </ plugins > </ build >

Java gmail not sent

  https://www.google.com/settings/security/lesssecureapps Follow this link and turn on

Javascript "uncaught error $ is not defined"

  < script src = " https://code.jquery.com/jquery-3.5.1.min.js " > </ script > https://www.tutorialrepublic.com/faq/how-to-fix-dollar-is-not-defined-error-in-jquery.php The most common reason behind the error "Uncaught ReferenceError: $ is not defined" is executing the jQuery code before the jQuery library file has loaded. 

Spring security error hasRole User

. antMatchers ( "/user/**" ). hasRole ( "USER" ) This above is the main reason for the error.  This should be changed to    . antMatchers ( "/user/**" ). hasAuthority ( "USER" )

Maven local resource file not reading error

  is = getClass (). getClassLoader (). getResourceAsStream ( "Actuator.config" ); Properties properties = new Properties (); InputStream is ; try { // is = new FileInputStream(filePath); is = getClass (). getClassLoader (). getResourceAsStream ( "Actuator.config" ); properties . load ( is ); } catch ( IOException ex ) { ex . printStackTrace (); } return properties ;