GIT Eclipse usage basic

GIT- Basics & Eclipse Usage
This post aim at very basic usage of using GIT based tools and eclipse configurations for the same. 

  • create a new repository : create a new directory, open it and perform a
    • git init
to create a new git repository.

  • checkout a repository : Create a working copy of a local repository by running the command 
    • git clone /path/to/repository 
when using a remote server, your command will be
git clone username@host:/path/to/repository

  • Goto project dir 
1. git init
2. git status
3.git add .
4. git status
5. git commit -m "first commit"
6. Create an empty repo in GITHUB
7.copy clone url
8.git remote add origin << URL >>
9.git push -u origin master
10. Check your files are there on GIT remote

To add more / update files

  • git add . 
  • git status 
  • git commit -m "second commit"
  • git push -u origin master

Read more

Unix command to find class in jar | windows command to search class in jars

Below are the sample commands to find out required class is there in the jar files of current directory and its sub-dirs.

Unix : 

find . -type f -name '*.jar' -print0 |  xargs -0 -I '{}' sh -c 'jar tf {} | grep com/sun/net/ssl/HostnameVerifier.class &&  echo {}'
find . -type f -name '*.jar' -print0 |  xargs -0 -I '{}' sh -c 'jar tf {} | grep HostnameVerifier.class &&  echo {}'
Ex :
[kg6378@bldv0014 jdk1.6.0_20]$ find . -type f -name '*.jar' -print0 |  xargs -0 -I '{}' sh -c 'jar tf {} | grep com/sun/net/ssl/HostnameVerifier.class &&  echo {}'

[kg6378@bldv0014 jdk1.6.0_20]$ find . -type f -name '*.jar' -print0 |  xargs -0 -I '{}' sh -c 'jar tf {} | grep HostnameVerifier.class &&  echo {}'

Windows : 

forfiles /S /M *.jar /C "cmd /c jar -tvf @file | findstr /C:"HostnameVerifier.class" && echo @path"

C:\Users\kg6378\Desktop\jdk-7u79-windows-x64\tools>cd C:\Krish\MyDocs\SWS\Jdk1.6

C:\Krish\MyDocs\SWS\Jdk1.6.0_14>forfiles /S /M *.jar /C "cmd /c jar -tvf @file |
 findstr /C:"HostnameVerifier.class" && echo @path"

  3517 Thu May 21 09:19:20 EDT 2009 com/sun/deploy/security/CertificateHostnameV
   194 Thu Feb 05 13:54:20 EST 2009 javax/net/ssl/HostnameVerifier.class
   618 Thu Feb 05 13:54:22 EST 2009 javax/net/ssl/HttpsURLConnection$DefaultHost
   384 Thu Feb 05 13:54:22 EST 2009 sun/net/www/protocol/https/DefaultHostnameVe
   272 Thu Feb 05 13:54:32 EST 2009 com/sun/net/ssl/HostnameVerifier.class


Read more

JBOSS - Profiles - socket binding - offset - Groups - Server

JBOSS - Profiles - socket binding - offset - Groups - Server

In JBOSS above are some common yet important terminology.

Each Server instance will fall under a group. It can follow its own socket binding.
Each group falls under a profile. Default , Full , Full-has etc

Based on socket binding default HTTP port and server offset we need to find out the server running http port. 

Read more

Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add resource root 'abc.jar' at path 'abc.jar' (position: END_TAG seen ...

Getting the below error ? Global modules classes not available ?

Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add resource root 'abc.jar' at path 'abc.jar' (position: END_TAG seen ...\n... @8:33) caused by: error in opening zip file
    at org.jboss.modules.ModuleXmlParser.parseResourceRoot( [jboss-modules.jar:1.3.3.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseResources( [jboss-modules.jar:1.3.3.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseModuleContents( [jboss-modules.jar:1.3.3.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseDocument( [jboss-modules.jar:1.3.3.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseModuleXml( [jboss-modules.jar:1.3.3.Final-redhat-1]
    ... 18 more

Solution : This is just because your global module jar file is corrupted and can not be read. Delete and copy the jar properly.

More similar error : 
09:38:16,093 ERROR [] (MSC service thread 1-4) MSC000001: Failed to start service jboss.module.service."deployment.TestWebProj.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.TestWebProj.war".main: JBAS018759: Failed to load module: deployment.TestWebProj.war:main
    at [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService( [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$ [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask( [rt.jar:1.6.0_95]
    at java.util.concurrent.ThreadPoolExecutor$ [rt.jar:1.6.0_95]
    at [rt.jar:1.6.0_95]

Read more

JBOSS : WARs deployment shell script

Below is simple example of deploying the list of WARs from a props file and deploy into JBOSS.
---------Script 1 invokes script 2 and creates a log file---------
datestr=$(date +%Y%m%d_%H%M%S)
./ > AsocDeploymentLog_$datestr

----------SCRIPT 2 , reads props file and get the WAR file and Group information-------
echo "Setting JBOSS Env"
export JBOSS_HOME=/export/opt/jboss/jboss-eap-6.3
export JAVA_HOME=/opt/app/java/jdk/jdk160
export JB_CLI=$JBOSS_HOME/bin/
DEPLOYMENT_HOST=`nslookup \`hostname\` |grep Name | awk '/:/{print $2}'`
export HOME_DIR=/pbcf/ctfr1603/

echo "JBOSS Environment is ready and connecting to CLLI"
for LINE in `cat deploymentDescABC.props | grep -v "#"`
 VAL1=`echo $LINE |cut -d '|' -f1 `
 GROUPS=`echo $LINE |cut -d '|' -f2 `
 echo "Deploying $WAR_FILE now"
 #export COMMANDS="connect,deploy $WAR_FILE --force,quit"
 export COMMANDS="connect,deploy $WAR_FILE --server-groups=$GROUPS,quit"
 if $JB_CLI -c --controller=$DEPLOYMENT_HOST:9999  --commands="$COMMANDS"
       echo "Deployment successful for $WAR_FILE !!"
       echo "Deployment failed for $WAR_FILE "
if [ $allDeployed = "0" ]
       echo "Overall deployment of all WARs is successful"
       echo "Overall deployment FAILED !!"

----------Sample Props file -------------
 # list of WARs for ASOC Module
All WARs done#

Sample Deploy and undeploy commands : 
 [jboss@hex0015 bin]$ ./
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
[ /] deploy /ssd/etc/jboss_config/atp/csac/PressQuery.war --all-server-groups
[ /]  undeploy PressQuery.war --all-relevant-server-groups

Read more

JBOSS start and stop shell scripts - domain mode - host controller - domain controller

 JBOSS start and stop shell scripts - domain mode - host controller - domain controller
echo "Setting JBOSS Env"
export JAVA_HOME=/opt/app/java/jdk/jdk160
export PATH=$PATH:/opt/app/jboss/jboss-eap-6.3/bin:$JAVA_HOME/bin
echo "PATH is : $PATH"

echo "JBOSS Environment is ready and starting jboss in domain mode"
export JAVA_OPTS="$JAVA_OPTS -DASOCPropsFile=/abc/etc/abc.props -DLNSPropsFile=/pns/etc/pns.props -DAVSPropsFile=/bvs/etc/bvs.props -DEOTPropsFile=/toe/etc/toe.props -DLPSPropsFile=/psl/etc/psl.props -DADLPropsFile=/hfl/etc/hfl.props"

/export/opt/jboss/jboss-eap-6.3/bin/ -b -bmanagement &
============START HOST CONTROLLER==========

==========STOP JBOSS Process harshly==============
echo "Stopping JBOSS JAVA processes"

for i in `ps -eaf | grep jboss | grep java | cut -d " " -f6`
        kill -9 $i
    echo "Killing: $i"
ps -eaf | grep jboss | grep java
echo "Stop completed"

Read more


Enter your email address:

Buffs ...


hits counter
View My StatsCheck Google Page Rank

Add to Google Reader or Homepage

Bookmark and Share


Powered by WidgetsForFree