JaiswalTraining

Get the online training



Corejava Servlet Jsp  Php  Hibernate  Ajax Web Service   Ejb2.1 Ejb3.0 Struts Struts2  JPA Spring Ibatis   JSF    JSF2.0  CoreJavaDesignPattern    Jquery  Flex J2EE-Design-Patterns  Jboss7  Maven  Contact Me                                                                                                                                                                        
            IGNOU SMU PTU Project                                           Training                                                                                                                              
              

Contact Us  0091- 9210721663         jaiswaltraining@gmail.com




Corejava
Servlet
Jsp
Php
Hibernate
Ajax
Web Service
Ejb2.1
Ejb3.0
Struts  
Struts2
JPA
Spring
Ibatis
JSF
JSF2.0
CoreJavaDesignPattern
Jquery
Flex
J2EE-Design-Patterns
Jboss7
Maven








  Jboss configuration with eclipse.

  • Jboss7 is supported with eclipse indigo and eclipse Juno.
  • Jboss7 requires jboss tool  to run inside the eclipse.
  • Jboss  Tool can be configured and downloaded.
  • For this  Click on the Help  menu  --->Eclipse  Marketplace.
  • Computer must be connected with internet.





  • It will open the Eclipse Marketplace window.
  • It shows the latest plugin / software that can be downloaded.
  • Here you need to search the Jboss Tool.




  • Type the jboss tool.
  • Click on go.
  • It will search and display the required software.
  • Here we are searching for Jboss Tool Indigo.
  • Select this item and click on install.
  • It will take some time  minutes to hours depending on download rate.
  • After downloading it will get installed.




Defining Jboss 7 Server in Eclipse


  • Now change the eclipse perspective.
  • In upper right window click on perspective icon.
  • Click on the other.


  • It will open window with many perspective.
  • Change perspective to javaee perspective.
  • Click on the ok.
  • Now the perspective is changed.



  • Now in javaee perspective you will see server icon.
  • Click on the server icon.




  • It will open server window.
  • Right click on server window.
  • Select New--->Server.




  • It will open Define a new Server.
  • Select Jboss As 7.1.
  • Click on next button.





Downloading the jboss 7.1




  • This way jboss 7 has  been configured in our eclipse.
  • By default it uses standalone.xml  as configuration file.
  • Clock on the finish button.




  • After addition  of jboss 7 along with jboss tool,eclipse  display Jboss Central page.
  • You can click on  the link and use the example with tutorial.




  • On the Server section it displays the Jboss 7.1 server.
  • You can right click  and start it.



  • Right click on the jboss7.1 and select start .
  • It will start jboss7.1




  • The following screen is showing jbsos7.1 starting.
  • It use the localhost:8080 for the application and  localhost:9990 for admin work.




  • Start the browser.
  • Add the url localhost:8080.
  • It will open the following screen.





Creating Dynamic Application in Eclipse for jboss 7

  • You can create web application for jboss 7.
  • In Eclipse create one dynamic application.
  • From File menu select New-->Dynamic Application Project.




  • This will open the wizard for Dynamic Web Project
  • Add the name of the project as WebDemo.
  • Select the Target runtime as Jboss 7.1 Runtime.
  • Dynamic web module version is  3.0 default.
  • It can be  changed  to 2.5 or other.
  • Click on the Finish button.
  • It will create one dynamic web application named WebDemo.





  • Create a Servlet as shown below.
  • Right click  on the project WebDemo.
  • Select New-->Jsp
  • Add the name of the jsp file as index.




Add the following code here.

<%page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
  <h1>Hello World</h1>
</body>
</html>


Running jsp file



  • Rt Click on the index.jsp.
  • Select Run As Run on Server.




  • It will open the Run on Server dialog box.
  • Here select Jboss 7.1 Runtime Server.
  • Click on the Finish button.
  • It will start the jboss 7.1 server if not started.
  • Then it will deploy the whole application WebDemo on the server.





  • Now index.jsp starts running.







Starting Jboss 7 in command window.

  • Without eclipse and jboss tool jboss can also be used.
  • open the command prompt.
  • Set jboss_home as shown below.
  • Set the java_home as shown below.
  • Then execute the standalone.bat  from bin folder.
  • This will start the jboss 7.1 application server.




Adding User in Jboss 7

  • To use the jboss admin you need to add the admin user
  • This is done by setting jboss_home  and  java_home.
  • Then  execute  the  add-user.bat in the  jboss\bin  directory.
  • It will ask you for
    • Management User
    • Application User
  • Select according to your requirement.
  • Add the user name .
  • Then add the password. Re enter the password.
  • Type yes for the question
    •  About to add user 'ram' for realm 'ManagementRealm'
      Is this correct yes/no? yes
  • This way the user ram has been added to the
    •  C:\jboss-as-7.1.1.Final\standalone\configuration\mgmt-
      users.properties
    • With the message
      • Added user 'ram' to file 'C:\jboss-as-7.1.1.Final\standalone\configuration\mgmt-
        users.properties'




  •  Now we can open the Administration Console
  • Click on the link Adminstration Console.
  • It will open the admin console.





Adminstration Console

  • Now Admin console will get opened.
  • It will ask you user name and password.
  • Add the user name ram and its password.



  • After adding proper user name and password you will be able to login to  jboss admin console
  • Below picture is showing the screen after login.





Checking web application on the admin console


  • We can check the application status on the server.
  • Open the http://localhost:9990/
  • Here u need to add the user name and  password  as  we have  done earlier.
  • Here  you will see  the  WebDemo  application  is present here.
  • Its status is enabled.
  • If you disable it then it will stop running.