Wednesday, March 30, 2011

Starting Up With JBOSS..!! - FLASH COURSE

Hello Guys,

Its been very long (more than 2 year, I have touched warmth of JBoss feelings, today just for sake of my friend as I promised him to try something new in JBoss Application Server, I had to remember some nice moments with JBoss, I never thought that I would be working on this App Server so soon when I am living WebLogic World.. :)

So here in this post I would be just trying to bring new minds to get started with JBoss Application Server, as of less time constraint I would be just carrying out the steps to setup the JBoss Application Server (Simplest One..!!) and Deploy a Simple war file and test the application, this setup will be so simple and worth of trying.

So As a first step we need to download the JBoss Installation file, you will get this at : http://sourceforge.net/projects/jboss/files/JBoss/JBoss-5.1.0.GA/ for 5.1.0 GA (General Availability)

Next Step is to Unzip and Place it in your favorite application server installation directory.
Note : Here we no need to install the JBoss Application Server, as this Application Server is distributed under GPL (Open Source Software Foundation), we get the Source Code version of the Application to get our hands on, it majorly contains the jar files and the xml configuration files, which drives the JBoss Application Server its way.

After copying just navigate to the D:\jboss-5.0.1.GA\bin through command prompt.

And execute : run.bat. and watch the window (Desktop Window ;))

You will see something as I tried to start the server :

D:\jboss-5.0.1.GA\bin>run.bat
===============================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: D:\jboss-5.0.1.GA

  JAVA: C:\Program Files\Java\jre1.6.0_17\bin\java

  JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

  CLASSPATH: ;D:\jboss-5.0.1.GA\bin\run.jar

===============================================================================

05:18:47,437 INFO  [ServerImpl] Starting JBoss (Microcontainer)...
05:18:47,453 INFO  [ServerImpl] Release ID: JBoss [Morpheus] 5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)
05:18:47,453 INFO  [ServerImpl] Bootstrap URL: null
05:18:47,453 INFO  [ServerImpl] Home Dir: D:\jboss-5.0.1.GA
05:18:47,453 INFO  [ServerImpl] Home URL: file:/D:/jboss-5.0.1.GA/
05:18:47,453 INFO  [ServerImpl] Library URL: file:/D:/jboss-5.0.1.GA/lib/
05:18:47,468 INFO  [ServerImpl] Patch URL: null
05:18:47,468 INFO  [ServerImpl] Common Base URL: file:/D:/jboss-5.0.1.GA/common/
05:18:47,468 INFO  [ServerImpl] Common Library URL: file:/D:/jboss-5.0.1.GA/common/lib/
05:18:47,468 INFO  [ServerImpl] Server Name: default
05:18:47,484 INFO  [ServerImpl] Server Base Dir: D:\jboss-5.0.1.GA\server
05:18:47,484 INFO  [ServerImpl] Server Base URL: file:/D:/jboss-5.0.1.GA/server/
05:18:47,484 INFO  [ServerImpl] Server Config URL: file:/D:/jboss-5.0.1.GA/server/default/conf/
05:18:47,484 INFO  [ServerImpl] Server Home Dir: D:\jboss-5.0.1.GA\server\default
05:18:47,500 INFO  [ServerImpl] Server Home URL: file:/D:/jboss-5.0.1.GA/server/default/
05:18:47,500 INFO  [ServerImpl] Server Data Dir: D:\jboss-5.0.1.GA\server\default\data
05:18:47,500 INFO  [ServerImpl] Server Library URL: file:/D:/jboss-5.0.1.GA/server/default/lib/
05:18:47,500 INFO  [ServerImpl] Server Log Dir: D:\jboss-5.0.1.GA\server\default\log
05:18:47,515 INFO  [ServerImpl] Server Native Dir: D:\jboss-5.0.1.GA\server\default\tmp\native
05:18:47,515 INFO  [ServerImpl] Server Temp Dir: D:\jboss-5.0.1.GA\server\default\tmp
05:18:47,515 INFO  [ServerImpl] Server Temp Deploy Dir: D:\jboss-5.0.1.GA\server\default\tmp\deploy
05:18:48,812 INFO  [ServerImpl] Starting Microcontainer, bootstrapURL=file:/D:/jboss-5.0.1.GA/server/default/conf/bootstrap.xml
05:18:49,687 INFO  [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.CombinedVFSCache]
05:18:49,687 INFO  [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cache: null]]
05:18:50,109 INFO  [CopyMechanism] VFS temp dir: D:\jboss-5.0.1.GA\server\default\tmp
05:18:50,109 INFO  [ZipEntryContext] VFS force nested jars copy-mode is enabled.
05:18:51,484 INFO  [ServerInfo] Java version: 1.6.0_17,Sun Microsystems Inc.
05:18:51,500 INFO  [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
05:18:51,500 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Client VM 14.3-b01,Sun Microsystems Inc.
05:18:51,500 INFO  [ServerInfo] OS-System: Windows XP 5.1,x86
05:18:51,578 INFO  [JMXKernel] Legacy JMX core initialized
05:18:53,375 INFO  [ProfileServiceImpl] Loading profile: default from: org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@bd5df(root=D:\jboss-5.0.1.GA\server, key=org.j
boss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
05:18:53,390 INFO  [ProfileImpl] Using repository:org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@bd5df(root=D:\jboss-5.0.1.GA\server, key=org.jboss.profileservice.s
pi.ProfileKey@143b82c3[domain=default,server=default,name=default])
05:18:53,390 INFO  [ProfileServiceImpl] Loaded profile: ProfileImpl@6e4ba6{key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default]}
05:18:55,718 INFO  [WebService] Using RMI server codebase: http://127.0.0.1:8083/
05:19:02,656 INFO  [NativeServerConfig] JBoss Web Services - Stack Native Core
05:19:02,671 INFO  [NativeServerConfig] 3.0.5.GA
05:19:12,046 INFO  [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:1090/jmxconnector
05:19:12,281 INFO  [MailService] Mail Service bound to java:/Mail
05:19:14,750 WARN  [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its
password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
05:19:14,796 WARN  [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent
05:19:15,000 INFO  [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
05:19:15,000 INFO  [TransactionManagerService] Setting up property manager MBean and JMX layer
05:19:15,296 INFO  [TransactionManagerService] Initializing recovery manager
05:19:15,500 INFO  [TransactionManagerService] Recovery manager configured
05:19:15,500 INFO  [TransactionManagerService] Binding TransactionManager JNDI Reference
05:19:15,546 INFO  [TransactionManagerService] Starting transaction recovery manager
05:19:16,312 INFO  [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080
05:19:16,312 INFO  [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
05:19:16,312 INFO  [StandardService] Starting service jboss.web
05:19:16,312 INFO  [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.2.GA
05:19:16,390 INFO  [Catalina] Server startup in 189 ms
05:19:16,406 INFO  [TomcatDeployment] deploy, ctxPath=/invoker
05:19:17,843 INFO  [TomcatDeployment] deploy, ctxPath=/jbossws
05:19:17,906 INFO  [TomcatDeployment] deploy, ctxPath=/web-console
05:19:18,546 INFO  [RARDeployment] Required license terms exist, view vfszip:/D:/jboss-5.0.1.GA/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
05:19:18,578 INFO  [RARDeployment] Required license terms exist, view vfszip:/D:/jboss-5.0.1.GA/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
05:19:18,593 INFO  [RARDeployment] Required license terms exist, view vfszip:/D:/jboss-5.0.1.GA/server/default/deploy/jms-ra.rar/META-INF/ra.xml
05:19:18,609 INFO  [RARDeployment] Required license terms exist, view vfszip:/D:/jboss-5.0.1.GA/server/default/deploy/mail-ra.rar/META-INF/ra.xml
05:19:18,640 INFO  [RARDeployment] Required license terms exist, view vfszip:/D:/jboss-5.0.1.GA/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
05:19:18,843 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: main
05:19:18,859 INFO  [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
05:19:18,875 INFO  [RAMJobStore] RAMJobStore initialized.
05:19:18,875 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
05:19:18,875 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.5.2
05:19:18,875 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
05:19:20,015 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
05:19:20,515 INFO  [ServerPeer] JBoss Messaging 1.4.1.GA server [0] started
05:19:20,656 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
05:19:20,656 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@c5d01d started
05:19:20,671 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
05:19:20,671 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@da1994 started
05:19:20,671 WARN  [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non c
lustered. So connection factory will *not* support failover
05:19:20,671 WARN  [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is
non clustered. So connection factory will *not* support load balancing
05:19:20,671 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
05:19:20,671 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@8a5d2 started
05:19:20,734 INFO  [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
05:19:20,734 INFO  [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
05:19:20,859 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
05:19:20,890 INFO  [TomcatDeployment] deploy, ctxPath=/
05:19:20,953 INFO  [TomcatDeployment] deploy, ctxPath=/jmx-console
05:19:21,015 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
05:19:21,031 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
05:19:21,031 INFO  [ServerImpl] JBoss (Microcontainer) [5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)] Started in 33s:516ms

So the server started in 33s and 516ms : So Accurate..!!

This all for command prompt screen : Now Jump in to the Console with following URL

http://localhost:8080/   and check what it says

You will see the various links for other consoles on this page for WEB-CONSOLE and JMX CONSOLE 
However you can directly open the web-console and jmx-console as below
Web Console : http://localhost:8080/web-console/ - You will see more of configuration information here

JMX Console : http://localhost:8080/jmx-console/ - JMX Operations and Configuration Operations are done here.














Now the server is started, try deploying a sample war file over the server :

As an example I am deploying a war file called Calendar.war in server, for Deploying the sequences of steps will be as below.

STEP : Copy the war file to D:\jboss-5.0.1.GA\server\default\deploy

Immediately you will see a log at standard out as 05:55:29,921 INFO  [TomcatDeployment] deploy, ctxPath=/Calendar

Try accessing the war file with context path given  as : http://localhost:8080/Calendar/

Now you are all set..!! you have setup JBoss Application Server and Deployed a war file

Guys, Please let me know if you have any doubt over this, and let me know if I have missed any of the steps.

Please comment.
Cheers,
Shailesh Dyade

Tuesday, March 29, 2011

Good Start for WebSphere Application Server

Guys here is the link for WebSphere Application Server 6.1 Administration/ Configuration Guide. - Red Book

WebSphere Application Server Configuration And Management Guide - 6.1

Good for Good Start. ;)