Sunday 31 May 2015

Steps to Generate SQL scripts & Backup the H2 database (Using h2 jar)

  1. Extract h2.jar  into the folder (say c:\h2-jar-extract)
  2. Run the following script from the command prompt (example: c:\h2-jar-extract>java  org.h2.tools.Script -url  jdbc:h2:<path>\<your .mv file> -user <username usually sa> -script h2-dump.zip -options compression zip)java  org.h2.tools.Script -url  jdbc:h2:<path>\<your .mv file> -user <username usually sa> -script h2-dump.zip -options compression zip
  3. Extract h2-dump.zip  , hurray  you can find the scripts in it.

Tuesday 27 January 2015

How to configure and run Apache Pluto in Eclipse

  • In Eclipse choose server from WindowPreferences Server.
    Choose Apache TomcatV7.0 as provided below
     

  • Provide the folder where you have the unzipped version of Apache Pluto as Tomcat installation directory. Ex: pluto-2.0.3-bundle\pluto-2.0.3\


  • The Tomcat server localhost Overview has to be modified as below.The below screen can be obtained by double clicking on the Tomcat v7.0 Server at localhost which is under Servers tab. The import thing is that you need to choose Use Tomcat installation (takes control of Tomcat installation)
  •  
  • Modify the tomcat-users.xml which can be found under \pluto-2.0.3-bundle\pluto-2.0.3\conf and add the below tags. Comment out the other role and user tags.
  •                <!--
                       <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"/>
                   -->
                  <!--
                       <user name="tomcat" password="tomcat" roles="tomcat,pluto,manager"/>
                       <user name="pluto" password="pluto" roles="pluto,manager"/>
                  -->
     
                  <role rolename="manager"/>
                  <role rolename="pluto"/>
                  <role rolename="tomcat"/>
                  <role rolename="role1"/>
                  <user username="tomcat" password="tomcat" roles="tomcat,pluto,manager"/>
                  <user username="role1" password="tomcat" roles="role1"/>
                  <user username="both" password="tomcat" roles="tomcat,role1"/>
                  <user username="pluto" password="pluto" roles="pluto,manager"/>

  • Start the tomcat server from Eclipse.
  • Test the application by providing the URL http://localhost:8080/pluto/portal/,
    • provide Username/Password as pluto/pluto. 

      voila you have setup the apache pluto in Eclipse.