Monday 19 August 2019

Eclipse Maven Error | No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

Faced below error while trying to maven build in Eclipse.

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?


Solution :


  1. Eclipse -> window -> preference.
  2. Select installed JREs -> Edit
  3. Add External Jars
  4. select tools.jar from java/JDKx.x/lib folder.
  5. Click Finish

Friday 16 August 2019

Spring Boot | Disable the Spring Banner in logs

When we start spring application below banner appears in logs.


You can remove this by using below properties in application.properties.


spring.main.banner-mode=off

Clean logs after applying this change.



Thursday 15 August 2019

Spring Boot RESTful Web Service Complete Example

While exploring spring boot, I have decided to implement simple REST service to demonstrate GET, POST, PUT, and DELETE calls.

Prerequisite for this project :

- Eclipse with STS (Spring tool Suite) plugin
- SOAPUI
- JAVA 8
- Maven

1. Create Eclipse project.
Select File->New-> Project->Spring Starter Project
Follow the wizards and finally click on finish




2. Define Employee bean.

Monday 29 July 2019

Common git issues and their solution

While using git, I faced some small issues and found their solution online. Here is the consolidated list.

1. Refusing to merge unrelated histories.
Command : git pull
Error : fatal: refusing to merge unrelated histories
Solution : git pull --allow-unrelated-histories

2. There is no tracking information for the current branch.
Command : git pull
Error : There is no tracking information for the current branch. Please specify which branch you want to merge with.
Solution : git branch --set-upstream-to=origin/master master

3. Not a git repository.
Command : git remote add origin https://github.com/jagdevsingh87/ATG-REST-case-study.git
Error : fatal: not a git repository (or any of the parent directories): .git
Solution : git init

Saturday 18 May 2019

jdeps | Great JDK 8 Command-line Static Dependency Checker tool

While exploring new technical stuff, I came across wonderful JDK 8 command line tool. This is called jdeps (Java class dependency analyzer). It is useful for quickly identifying static dependencies of libraries. The jdeps command-line tool is easy to use and quickly identifies static dependencies on a provided JAR and its package or class contents.The level of detail shown is configurable and some ways of configuring this command's output are shown next.

The following screen snapshot (cropped image, doesn't include full output) demonstrates basic usage of the jdeps command executed for tools.jar (java library jar).

Jdeps Output
To print class level dependency use -v option.

Jdeps Class Level Output

There are a few more useful options available for use with jdeps that are not covered in this post, but these can be seen by running jdeps -help.

Wednesday 15 May 2019

Resolved | GIT branch switch issue

While using GIT, encountered a special scenario. I was working on one branch. There were no changes local. Then I decided to switch to different branch.

I have faced below error.
===========================================================================
$ git checkout New_Temp_Branch
error : The following untracked working tree files would be overwritten by checkout:
      <list of files here>
Please move or remove them before you can switch branches.
Aborting
===========================================================================

Solution : Use below set of commands.

git add *
git stash
git pull

This will track all files, remove all of your local changes to those files, and then get the files from the server.

Endeca Terminology

While studying about Endeca ,I have seen interesting terms related to Endeca. Here is the list of terms along with their meaning.

Navigation State The navigation state is the set of all dimension values selected in the current query context,the navigation state record set consists of the records selected by the navigation state.
Descriptor Dimensions Descriptor dimensions contain the dimension values (or descriptors) that were used to query for the current record set. Integrated dimensions represent a consolidation of those dimensions that contain either descriptors or refinement values for the current record set.
Complete Dimension Complete dimensions represent a consolidation of all dimensions that have at least one of the following:
a descriptor, a standard refinement, or an implicit refinement.

Snippeting The snippeting feature (also referred to as keyword in context or KWIC) provides the ability to return an excerpt from a record—called a snippet—to an application user who performs a record search query.

Wildcard search Wildcard search allows users to match query terms to fragments of words in indexed text.

Pivoting The activity of adding or removing dimension values to or from the navigation state is known as pivoting.

Positional Indexing To enable faster phrase search performance and faster relevance ranking with the Phrase module,your project builds index data out of word positions.This is called positional indexing.

Resolved | Endeca export site failure

Export site failed with below exception.
==========================================================================
Can't load log handler "com.endeca.soleng.eac.toolkit.logging.RelativePathFileHandler"
java.io.IOException: Couldn't get lock for /srv/endeca/apps/Store/logs/Store.%u.%g.log
java.io.IOException: Couldn't get lock for /srv/endeca/apps/Store/logs/Store.%u.%g.log
        at java.util.logging.FileHandler.openFiles(FileHandler.java:389)
        at java.util.logging.FileHandler.<init>(FileHandler.java:254)
        at com.endeca.soleng.eac.toolkit.logging.RelativePathFileHandler.<init>(RelativePathFileHandler.java:93)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at java.lang.Class.newInstance(Class.java:374)
        at java.util.logging.LogManager$4.run(LogManager.java:690)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:683)
        at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:1255)
        at java.util.logging.LogManager.access$1300(LogManager.java:148)
        at java.util.logging.LogManager$RootLogger.getHandlers(LogManager.java:1338)
        at java.util.logging.Logger.log(Logger.java:609)
        at java.util.logging.Logger.doLog(Logger.java:631)
        at java.util.logging.Logger.log(Logger.java:654)
        at java.util.logging.Logger.fine(Logger.java:1204)
        at com.endeca.soleng.eac.toolkit.Controller.parseArgs(Controller.java:1036)
        at com.endeca.soleng.eac.toolkit.Controller.main(Controller.java:136)
[02.17.17 11:17:18] INFO: Checking definition from AppConfig.xml against existing EAC provisioning.
[02.17.17 11:17:28] SEVERE: Caught an exception while checking provisioning.

Caused by com.endeca.soleng.eac.toolkit.exception.EacCommunicationException
com.endeca.soleng.eac.toolkit.application.Application isDefined - Caught exception while querying for defined application list.
Caused by com.endeca.eac.client.EACFault
sun.reflect.NativeConstructorAccessorImpl newInstance0 - null


==========================================================================
Solution :
         1)      Stop the EAC (Endeca HTTP Service)
         2)      Rename the directory 
ENDECA_CONF/state to state-backup
         3)      Create an empty state directory
         4)      Start the Endeca HTTP Service again