Tech It Easy

Thursday, 12 February 2015

spring-hibernate-multi-module-maven

Dear Friends,

Please have a look at my first Multi Module Maven project. It is a demo project for Spring MVC in following two flavors
  1. Java Config
  2. XML Config

Code is on my GitHub repository https://github.com/PraveenGandhi/spring-hibernate-maven-multi-module.



Wednesday, 11 February 2015

JBoss Gotchas

Dear Friends,

At times we might have to hit the apps running in Linux machine or another machine connected through the same network.

If you want to hit an application deployed in tomcat which is running in the same network that you are connected in, then you have to use http://IP_or_hostname:port_number/contextRoot
for example http://JaiRam-PC:8080/app that's it, you are good to go.

But if the application is running in JBoss you might see "This webpage is not available" as shown below.


Reason:
By default (due to security reasons) JBoss AS binds only to localhost.

Resolution or work around:

1. While running the JBoss use another param as follows

run.sh -b 0.0.0.0 
(on windows as follows)
run.bat -b 0.0.0.0
2. From JBoss AS 7, we have one more option, 
that is we can edit the JBOSS_HOME/standalone/configuration/standalone.xml to change the "public" and "management" interfaces to point to the hostname of your system or 0.0.0.0

Going one step further:

Form JBoss 7 on wards configuring the server and deployments can be done by admin console app (management). It runs on port number 9990 by default (http://localhost:9990/console/App.html) Which is again by default enabled for localhost, to be enable on network mode we have to run the server as follows

standalone.sh -bmanagement 0.0.0.0
(on windows as follows)
standalone.bat -bmanagement 0.0.0.0

I used to run my server as follows:




Lengthy param names are as below

-Djboss.bind.address=0.0.0.0
-Djboss.bind.address.management=0.0.0.0

Where did I apply this:

  1. At work I have got a Linux box (Performance Testing Environment) and I have to deploy my app in JBoss 7.1.1 in that box from another machine (my Laptop).
  2. One of my friends (middle-ware guy) was asked to start JBoss as said above like both the public (deployed apps) and management console app should be accessed in the same network. I suggested him to add  both parameters when running server as below and that worked like a charm.

standalone.sh -b 0.0.0.0 -bmanagement=0.0.0.0

Hope this post is useful to you, please drop in your comments.



Tuesday, 27 January 2015


Code completion support in eclipse/STS/GGTS

Dear Java Friends,

I recently came across the following from Spring News and it is working well for me. Hope it is useful to you as well. 

Code completion support in Eclipse and the Spring Tool Suite is aware of the camel case shortcuts. You don’t need to write NullPointerException, for example. It is enough to type in NPE and hit code completion to let it propose the right class name. This also works with lower case characters in between, so typing on “NuPoiEx” will also trigger the code completion to propose NullPointerException as class name.


Monday, 12 January 2015

"Run"ning easily 

Friends,

Hope all are doing great, just logging my first "tech it easy" post.

We all are used to shortcuts as it makes our life easier, do try this shortcut for any of your day to day activities, it makes your tech life easier.

Image Courtesy: cdn.marksdailyapple.com/


I have recently started  RUNning (using run in Windows OS for most used tools, IDEs, batch scripts and folders). I learnt this from one of my friends, Thirumal. Special thanks to him and hope this would be useful to you in one way or the other.

Main key/trick is to add a specific folder to your path (Environment variable) where you have all the .lnk (shortcut files), batch scripts etc., so that all of those are available on CMD and on RUN.

Step 1: Create a folder in any drive with any name of your choice (ex: 'E:\shortcuts').
Step 2: Put all your shortcuts and batch files in that folder.
Step 3: Append the location to your PATH variable in system environment variables (type sysdm.cpl in run and hit enter it would take you there).











You are ready to go :)

To open Google Chrome I need to type ch (case insensitive) in RUN and hit enter.


sky - skype, out - outlook, jd - java de-compiler, sts - spring tool suite ....

ev - environment variables ( use control.exe sysdm.cpl,System,3 as target of the shortcut file)
and to go to the shortcuts folder sh (use target as your shortcuts folder ex: 'E:\shortcuts')

To create new shortcut : right click on empty area on the shortcuts folder, go to New and click on shortcut as below.


select your intended exe, batch file or a folder then give the name as follows


My shortcuts list is below...




Cheers  :) and please do share your comments below.. hope to catch you soon on another "tech it easy" post.