Thursday, October 3, 2013

Deploy war in tomcat (run in eclipse)

I am using apache 7. When started in command prompt everything works as expected but if I start same from eclipse then I was not able to access it and find the

settings.

Looks like eclipse uses by default 'Use workspace metadata' and deploy path to 'wtpwebapps' in server settings. Follow the below steps to change these and you will be

able access localhost:8080 when you start server in eclipse.

1. In eclipse servers tab at bottom, right click, where you can see start, stop etc, and select properties.
2. In properties window, select general, then select Switch Location.
3. Now you can see Tomcat v7.0 Server at localhost, open it.
4a. If there are any modules deployed, temporarily remove them and close out tab to save this change, otherwise go directly to step 4c below.
4b. If you removed any modules, restart server after step 4a and proceed to step 4c.
4c. In server location, select radio button 'Use tomcat installation', and select 'webapps' in deploy path.
Save and start server in eclipse. Now you will be able to access the server.

5. You need to setup the admin user name /password in conf\tomcat-users.xml as below:

Add the below code in the xml:
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>

  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>

  <role rolename="admin"/>
  <user username="admin" password="admin" roles="manager,manager-gui"/>

6. Restart the server from eclipse.
7. access the tomcat using localhost:8080/manager -> enter the user : admin and password : admin.
8. Deploy the war file
9.  access it using localhost:8080/project_name

If the above procedure does not work, change the port number as below:
- double click on the tomcat 7.0... server in the eclipse to open overview screen
- change the default port (HTTP/1.1) for example 8080 to 8001 and do change other ports for AJP and tomcat admin as well.
- then follow the steps 1 to 9.

Thursday, September 26, 2013

Setup Stash a Git management solution

Setup Stash a Git management solution
In this post, i will be discussing about the stash setup.  Statsh is a Git repository management solution from

Atlassian. (More on this is available in their confluence web site:

https://confluence.atlassian.com/display/STASH026/Getting+started

In order to use stash you need following installed:

- Need to buy stash account
- Need to have a stash account and password
- Account -> add ssh key.  ( you can generate it if it does not exist using)
- Make sure you have full access to write/read etc in the stash repo.

You are all set to access the stash.

Setting up the remote repo:

Modify the existing project (for example: ssh://git@stash.dev-sample.net:7999/stash/project1.git) to your local

repo:

1. Create a folder for the project. Say in C:\Workspace\Stash_project_1
2. Enter the below command:
>git clone ssh://git@stash.dev-sample.net:7999/stash/project1.git
you will see below output:
Cloning into 'project1'...
remote: Counting objects: 332, done.
remote: Compressing objects: 100% (229/229), done.
remote: Total 332 (delta 87), reused 332 (delta 87)
Receiving objects: 100% (332/332), 2.16 MiB | 427.00 KiB/s, done.
Resolving deltas: 100% (87/87), done.

3.  Make the changes in the local repo.
4.  Its time to commit the changes:

> git commit -a

It will show text editor for comments.  Enter the comments and press esc key -> wq! (to save the command and quit)

> You might see something like below:

You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

> If you want to change anything like user.name or user.email.  Please go ahead and execute the above command and

do a amend that follows.  Now are you all set.

5.  Login into stash and check the project: : Stash -> repo: Project1.
- you should be able to see commits under the commit tab.

Create a new branch:
======================

1. Go to the local repo path (make sure it has the .git folder in it, other wise, you need to make it as one).
2.  Enter the below command to create a branch called SampleBranch1.

git checkout -b SampleBranch1

3.  Below command is used to push the branch to the remote repo.

git push origin SampleBranch1

4. Run the below command to check if the branch is created.  (* indicate new branch)
git branch


Checkout from a branch:
git clone -b SampleBranch1 --single-branch  ssh://git@stash.dev-sample.net:7999/stash/project1.git

Keep checking this space for more info on stash. Thanks for checking my blog

Thursday, January 24, 2013

misfire trigger in QUatz

ISsue: the QUatz trigger was getting misfired when it got picked by scheduler.
Resolution: There was a "C" in the calendar name in the table qrtz_triggers. HEnce updated that as null, this fixed the issue.