Error with git as "git-sh-setup: No such file or directory" with OSX Yosemite and oh-my-zsh (Z-Shell)

I recently received the following error while pushing/pulling code to/from git:

$ git pull
/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-pull: line 11: git-sh-setup: No such file or directory

This happened after I updated my macbook to OSX Yosemite and I do have Zsh (Z-Shell – oh-my-zsh)  as my favorite shell and iTerm2 as my favorite terminal.

After looking around I found the problem is that Zshell does not invoke /usr/bin/login when opening the command window as well as not clearing the environment vars while closing…

The potential solutions:

1. Edit the opening command when open a new shell (Preferred as it keeps your encoding as well as theme intact):

  • Open ITerm2 preferences > Profile – Default > Command – Command – /bin/bash -c /bin/zsh

2. You can also edit the same command to use your login:

  • Open ITerm2 preferences > Profile – Default > Command – Command –  /usr/bin/login -f <your user name>

More info at Stackoverflow..

Advertisements

Unknown Entity exception with Java Hibernate

If you hit an exception as “Unknown Entity” with Java Hibernate as below:

org.hibernate.MappingException: Unknown entity: com.myapplication.mymodel.modelname.ModalClass

It means the Class is not added into Hibernate configuration and to solve it simply you would need to add the class into your hibernate.cfg.xml as below:

  • <session-factory>
    • ……
    • <mapping class=”com.myapplication.mymodel.modelname.ModalClass” />
  • </session-factory>

You can find more details at StackOverflow.

Keywords: Java, Hibernate, Class, Unknown Entity, Exception