Showing posts with label JBoss. Show all posts
Showing posts with label JBoss. Show all posts

Thursday, August 15, 2013

Installing JBoss Application Server 7.1.1 on Ubuntu 13.04 Desktop OS

Hello There,


Hope you all are doing good..!

Wishing you a very happy and prosperous Independence Day, hope you will remember the people who made this day happen in our life.

Lets get back to the basics..

Today we are here to study about JBoss Application Server Installation in a freshly installed Ubuntu Operating System.

I just recently found out that Ubuntu 13.04 is the best version ever improved, it should as its the latest one at this time.. (15 August 2013). So giving a thought of installing JDK/JRE and JBoss Application server on it.

Lets Start...

Get the necessary files.

You will need jboss-as-7.1.1.Final.zip from  https://www.jboss.org/jbossas/downloads --  download it..!! ( I thought its needless to say ;))

And you might need to download the Linux version of Oracle Java 7 as below.

Step 1. Login to terminal verify if Java is there or not and wait for alternative thoughts.  -- Go to Root.


 Step 2. You might need to download the specific package for this version ( Java 7) of Java.

Step 3. Update the Package Cache and Search in the available packages in Ubuntu package cache with the help of below commands.



#apt-get update

This will get the list of packages available for download and install for Ubuntu.









#apt-cache search ^oracle_java

We see here that required Java 7 Package is not available in the packages list, we may need to update the repository with other ways.

Step 4. Update the repository with below command  - add new repository.





#add-apt-repository ppa:webupd8team/java

This will make the URL passed available to the Package Manager to update the package repository next time you run the update.

Step 5. Run the apt-get update.

This will update the list of available packages with new Java Packages available with the new source we have added recently.

Update is complete, then try to search for Java package in the list.

Here is the result..!!








Step 6. Install Java - #apt-get install oracle-java-installer

This will download, extracts and install the Java package into Ubuntu Operating System.

You might need to agree to the License Agreement which pops out in the same window.





Step 7. Verify the installation.




Downloading is in Progress.









Step 8. Check the Java Version as below.




Verifying the version :

#java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) Server VM (build 23.25-b01, mixed mode)




Next Steps....!!
 
Installing JBoss Application Server 7.1.1
-----------------------------------------------------------------

Step 1. Copy the downloaded jboss-as-7.1.1.Final.zip file to some secured safe location in your filesystem.

root@shailesh-Inspiron-N4010:/# df -k
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda6      127819492 4303196 117016764   4% /
none                   4       0         4   0% /sys/fs/cgroup
udev             1986872       4   1986868   1% /dev
tmpfs             399024     876    398148   1% /run
none                5120       0      5120   0% /run/lock
none             1995104     160   1994944   1% /run/shm
none              102400      44    102356   1% /run/user

root@shailesh-Inspiron-N4010:/# ls
bin    dev   initrd.img      lost+found  opt   run      srv  usr
boot   etc   initrd.img.old  media       proc  sbin     sys  var
cdrom  home  lib             mnt         root  selinux  tmp  vmlinuz
root@shailesh-Inspiron-N4010:/#


Step 2. I will copy on this to /opt/RedHat/JBoss/AS hope this will be good location for JBoss to hide in.

# mkdir -p /opt/RedHat/JBoss/AS
# cd  /opt/RedHat/JBoss/AS
# cp /home/shailesh/Downloads/jboss-as-7.1.1.Final.zip .

Step 3. Unzip it.

#unzip jboss-as-7.1.1.Final.zip
root@shailesh-Inspiron-N4010:/opt/RedHat/JBoss/AS# ls
jboss-as-7.1.1.Final  jboss-as-7.1.1.Final.zip
root@shailesh-Inspiron-N4010:/opt/RedHat/JBoss/AS#


Rename the file just to refer it refer as our package.

# mv jboss-as-7.1.1.Final jboss-as-7.1.1

Set the JAVA_HOME

root@shailesh-Inspiron-N4010:~# echo $JAVA_HOME
/usr/lib/jvm/java-7-oracle/jre/bin
root@shailesh-Inspiron-N4010:~#


Add this line in standalone.conf in /opt/RedHat/JBoss/AS/jboss-as-7.1.1/bin directory

JAVA_HOME="/usr/lib/jvm/java-7-oracle/jre"


Step 4. Start the JBoss Instance (standalone configuration).



It took value of JBOSS_HOME with the help of simple logic in standalone.sh file.

# Setup JBOSS_HOME
RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd`
if [ "x$JBOSS_HOME" = "x" ]; then
  JBOSS_HOME=$RESOLVED_JBOSS_HOME

Step 5. Verify the Configuration start-up.



 
Then try accessing the console for JBoss Application Server.

05:33:35,807 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990


Step 6. Access the console at address : http://127.0.0.1:9990/



We might need to add a user so that we can successfully access the console, let us try that.

 Step 7. Add User details as below, for Testing purpose I have used Admin User.
 



root@shailesh-Inspiron-N4010:/opt/RedHat/JBoss/AS/jboss-as-7.1.1/bin# ./add-user.sh

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a): a

Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : Admin  
Password :
Re-enter Password :
The username 'Admin' is easy to guess
Are you sure you want to add user 'Admin' yes/no? yes
About to add user 'Admin' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'Admin' to file '/opt/RedHat/JBoss/AS/jboss-as-7.1.1/standalone/configuration/mgmt-users.properties'
Added user 'Admin' to file '/opt/RedHat/JBoss/AS/jboss-as-7.1.1/domain/configuration/mgmt-users.properties'
root@shailesh-Inspiron-N4010:/opt/RedHat/JBoss/AS/jboss-as-7.1.1/bin#


Step 8. Restart the standalone server configuration and try accessing the console - Click on Try Again link on console screen.



Here I am done with this tutorial, please let me know if you need any more information, please drop into comments or email me directly.

Hope you have enjoyed the Blog Post.

Regards
Shailesh Dyade

Monday, December 24, 2012

Ways to Start Your JBoss Instance

Hello There,

JBoss User's, you must be knowing the ways to start the JBoss Application Server by going into its bin directory and invoking standalone.bat or domain.bat (.sh for Unix)

Recently I found a beautiful utility for starting server which is equivalent to WebLogic's "java weblogic.Server command, however JBoss ones look little different.

For this you need to define the JBOSS_HOME for the Jboss Installation directory in Environment Variables of your local system (Windows), for Unix and Linux Systems you may need to set it and include it PATH variable.

Consider my settings are on Windows and have added the JBOSS_HOME in Environment variables of my Windows 7 Operating System.



After this open a command shell and navigate to your JBoss Installation Directory.



You would see below files in the current directory


C:\Users\shailesh.dyade\SandBox\ApplicationServers\jboss-as-7.1.1>dir
 Volume in drive C is OSDisk
 Volume Serial Number is E604-B574

 Directory of C:\Users\shailesh.dyade\SandBox\ApplicationServers\jboss-as-7.1.1

21/11/2012  22:25    <DIR>          .
21/11/2012  22:25    <DIR>          ..
21/11/2012  22:24    <DIR>          appclient
21/11/2012  22:24    <DIR>          bin
21/11/2012  22:24    <DIR>          bundles
21/11/2012  22:24             2,451 copyright.txt
21/11/2012  22:24    <DIR>          docs
21/11/2012  22:24    <DIR>          domain
21/11/2012  22:24           266,549 jboss-modules.jar
21/11/2012  22:24            26,530 LICENSE.txt
21/11/2012  22:25    <DIR>          modules
21/11/2012  22:24             2,421 README.txt
26/11/2012  15:09    <DIR>          standalone
21/11/2012  22:25    <DIR>          welcome-content
               4 File(s)        297,951 bytes
              10 Dir(s)  157,544,517,632 bytes free

C:\Users\shailesh.dyade\SandBox\ApplicationServers\jboss-as-7.1.1>

Here we will just try to start the standalone serverby invoking the org.jboss.as.standalone you will be able to find all the available modules in C:\Users\shailesh.dyade\SandBox\ApplicationServers\jboss-as-7.1.1\modules\org  so that we can try different tasks to invoke and implement.

Just Invoke the below command : 

java -jar jboss-modules.jar -mp "%JBOSS_HOME%\modules"  org.jboss.as.standalone -Djboss.home.dir="%JBOSS_HOME%" on the command line.

Press Enter


20:37:15,557 INFO  [org.jboss.as.naming] (MSC service thread 1-6) JBAS011802: Starting Naming Service
20:37:15,605 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mail/Default]
20:37:16,949 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Starting Coyote HTTP/1.1 on http--127.0.0.1-8
080
20:37:16,986 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 40) JBAS010403: Deploying JDBC-com
pliant driver class org.h2.Driver (version 1.3)
20:37:20,446 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) JBAS010400: Bound data source [java:jbo
ss/datasources/ExampleDS]
20:37:21,453 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Se
rver 4.0.2.GA
20:37:24,254 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentServic
e for directory C:\Users\shailesh.dyade\SandBox\ApplicationServers\jboss-as-7.1.1\standalone\deployments
20:37:24,299 INFO  [org.jboss.as.remoting] (MSC service thread 1-5) JBAS017100: Listening on /127.0.0.1:9999
20:37:24,299 INFO  [org.jboss.as.remoting] (MSC service thread 1-8) JBAS017100: Listening on /127.0.0.1:4447
20:37:26,666 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
20:37:26,669 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 32884ms - Started
133 of 208 services (74 services are passive or on-demand)


Let me explain the command.

java -jar jboss-modules.jar -> Here we are executing the jboss-modules.jar this Jar file is needed to bootstrap the application server Kernel based on the JBoss Modules present in Modules folder.

When we invoke the standalone.sh file or the domain.sh file it will internally does the same Job as WebLogic Server is built.

now let us see the complete command line.

java -jar jboss-modules.jar -mp "%JBOSS_HOME%\modules"  org.jboss.as.standalone -Djboss.home.dir="%JBOSS_HOME%"

-mp : its known for Module Path, we are directing the command to get the modules specified in the command from the Directory specified for this parameter.

And we are specifying the JBoss Home Directory to just guide the command at the right location.

Make sure you provide correct details for the path and the variables specified here otherwise you have chances to get the errors like below.


C:\Users\shailesh.dyade\SandBox\ApplicationServers\jboss-as-7.1.1>java -jar jboss-modules.jar -mp "%JBOSS_HOME%\modules" org.jboss.
as.standalone
java.lang.IllegalStateException: JBAS015816: Missing configuration value for: jboss.home.dir
        at org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:325)
        at org.jboss.as.server.Main.determineEnvironment(Main.java:242)
        at org.jboss.as.server.Main.main(Main.java:83)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.jboss.modules.Module.run(Module.java:260)
        at org.jboss.modules.Main.main(Main.java:291)


Reason : If you do not specify the home directory.

Please try by yourself and let me know if you find any difficulties to start the JBoss Server Instance.

Regards
Shailesh Dyade.


Friday, December 21, 2012

Configure Eclipse With JBoss Application Server

Hello There

Today we will look into configuring Eclipse to Work with JBoss Application Server

Prerequisites

1) You need to have Eclipse (Java and J2EE compliant package) copied in your local.
2) Of course JBoss copied in your desired location of your local system.

Next Steps:
==========

Step 1) Start Eclipse and Go to Tools - > Install New Software


Step 2) Click on Add after the Text Box for Work with

You will get a Pop-Up Window as below.

       

Add Name as : JBoss Tools  & Location as below
http://download.jboss.org/jbosstools/updates/development/indigo/

You will see window as ->

Step 3) Wait for Some time after that you will get a big list of JBoss Tools and Utilities which are supported in Eclipse.


From there you need to expand the first one : Abridged JBoss Tools 3.3 and Select the check box of JBossAS Tools 

And Say Next. 

Step 4) Eclipse will check for the Dependencies and report in case if the tools is conflicting with any of the existing modules. 

Step 5) In case if you find any conflicts, its your headache to resolve it :), you will not get any unless you have fresh Eclipse Installation.

Step 6) Proceed for the Installation - Say Next.

Step 7) Do not forget to accept the License Agreement from JBoss.. 


Step 8) Say Finish.!! - You will see the installation has started for Tools you have selected.


     

After Installing You may need restart Eclipse, so the below Pop-up.

      

Step 9) After this you will be able to see JBoss Application Server in the Server Run-time List for Eclipse - Go to Platform Runtime Window and click on new server wizard.



Step 10) To Configure the Server Successfully, Click Next on Above Window and Provide accurate details,  for where your server is installed and the JRE location you would like to use and say Finish.

Step 11) Right Click and Start the Server or You can click on Green Play Button for Starting the Server.

In Console you should notice : 

JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 19726ms - Started 126 of 208 services (7 services failed or missing dependencies, 74 services are passive or on-demand)

Step 12) Time to celebrate now.. your server is started and you will see Fully Loaded Eclipse.. :)




Hope you have liked the Posting, Stay Tuned.!! Lot more to come.

Bye for now.!!

Regards
Shailesh Dyade