Friday, September 15, 2006

Application Server equals Middleware?

When I first encounter the Java 2 Enterprise Edition world, I encountered only application servers. Then some comparison news, publications, etc. would put all the application servers manufacturers as major middleware vendors. Then I had this equation on my mind:
application server == middleware

Then through further readings, experiences, discussions, etc I concluded that:
application server != middleware

They are of different kind level of abstraction! 
Some (Java) middleware parts are running on Java application server. But to make Java Middleware *EQUALS TO* Java Application Server, is a big big mistake that I have made.

The equation just doesn't seem to balance out...

These are components of middlewares:
Messaging
Integration Platform
Portal

Installation of JBoss: A Trivial 4 Step Task

It really is a "4 step task":
1. Download
2. Unzip it!
3. Setup the JDK environment, if you haven't yet
4. Run the script

It works!
I have to admit that this is, the simplest application server that runs it the first time I installed, whether I'm running it in the Windows environment, Linux or Solaris boxes.

1. Download
Go to http://prdownloads.sourceforge.net/jboss/jboss-4.0.4.GA.zip?download
Choose your favorite sourceforge download site. I recommend download the zip version, as it is simpler to handle in multiplatform environment (my personal opinion).
Warning: 75,587kb download!

2. Unzip It!
Assuming that you are running a Windows environment, it is quite trivial task to install JBoss Application Server.
Run your favorite compression tools, unzip the jboss-4.0.4.GA.zip into your folder application server, e.g. c:\opt\env\jboss-4.0.4.GA
Then check that you have these foldere under you "c:\opt\jboss-4.0.4.GA" folder:
  • bin
  • client
  • docs
  • lib
  • server
Also there exist some files (copyright.txt), jar-version.xml, lgpl.html, readme.html, readme_j2ee.html).
If you find these folders, everything seems to be ok this far.

3. Setup the JDK environment
This steps is required when you haven't done it yet. It is kind of setting the JAVA_HOME, CLASSPATH environment variables etc.
I would suggest to put it into a batch file or shell script for easier reuse. In my Windows environment, I would make c:\opt\env\set5.bat for setting up JDK 5, and c:\opt\env\set4.bat for setting up JDK 1.4.2.

The file set5.bat should contain at least:
set JAVA_HOME=c:\opt\env\jdk1.5.0_07
set JBOSS_HOME=c:\opt\env\jboss-4.0.4.GA
set CLASSPATH=%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib;%JAVA_HOME%\jre\lib\ext;.
set PATH=%JAVA_HOME%\bin;%PATH%


Of course you have to tailor it to suit your environment settings.

4. Run the script
Run your script, open the command prompt and type this:
c:\>%JBOSS_HOME%\bin\run

If your command line shows message like these, than congratulations! You have successfully installed the JBoss Application Server. If this is your first time installing an Java application server, welcome to the new world of Java Enterprise Edition environment!


===============================================================================
.
JBoss Bootstrap Environment
.
JBOSS_HOME: c:\opt\env\jboss-4.0.4.GA\bin\\..
.
JAVA: c:\opt\env\jdk1.5.0_07\bin\java
.
JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcIn
terval=3600000
.
CLASSPATH: c:\opt\env\jdk1.5.0_07\lib\tools.jar;d:\opt\env\jboss-4.0.4.GA\bin\\run.jar
.
===============================================================================
.
21:37:13,093 INFO [Server] Starting JBoss (MX MicroKernel)...
21:37:13,125 INFO [Server] Release ID: JBoss [Zion] 4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)
21:37:13,171 INFO [Server] Home Dir: c:\opt\env\jboss-4.0.4.GA
21:37:13,171 INFO [Server] Home URL: file:/c:/opt/env/jboss-4.0.4.GA/
21:37:13,171 INFO [Server] Patch URL: null
21:37:13,171 INFO [Server] Server Name: default
21:37:13,171 INFO [Server] Server Home Dir: D:\opt\env\jboss-4.0.4.GA\server\default
21:37:13,171 INFO [Server] Server Home URL: file:/D:/opt/env/jboss-4.0.4.GA/server/default/
21:37:13,171 INFO [Server] Server Log Dir: D:\opt\env\jboss-4.0.4.GA\server\default\log
21:37:13,171 INFO [Server] Server Temp Dir: D:\opt\env\jboss-4.0.4.GA\server\default\tmp
21:37:13,171 INFO [Server] Root Deployment Filename: jboss-service.xml
21:37:15,453 INFO [ServerInfo] Java version: 1.5.0_07,Sun Microsystems Inc.
21:37:15,453 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_07-b03,Sun Microsystems Inc.
21:37:15,453 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
21:37:17,062 INFO [Server] Core system initialized
21:37:29,828 INFO [WebService] Using RMI server codebase: http://daniel:8083/
21:37:29,843 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
21:37:32,031 INFO [NamingService] JNDI bootstrap JNP=/0.0.0.0:1099, RMI=/0.0.0.0:1098, backlog=50, no client SocketFact
ory, Server SocketFactory=class org.jboss.net.sockets.DefaultSocketFactory
21:37:47,703 INFO [Embedded] Catalina naming disabled
21:37:47,750 INFO [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rul
e set.
21:37:47,765 INFO [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rul
e set.
21:37:49,687 INFO [Http11BaseProtocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
21:37:49,687 INFO [Catalina] Initialization processed in 1922 ms
21:37:49,687 INFO [StandardService] Starting service jboss.web
21:37:49,703 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.5.17
21:37:49,734 INFO [StandardHost] XML validation disabled
21:37:49,765 INFO [Catalina] Server startup in 78 ms
21:37:50,750 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
21:37:51,828 INFO [WebappLoader] Dual registration of jndi stream handler: factory already defined
21:37:58,656 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jbossweb-tomcat55.sar/ROOT.war/
21:38:02,500 INFO [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../tmp/deploy/tmp9122jbossws-exp.war/
21:38:02,875 INFO [SubscriptionManager] Bound event dispatcher to java:/EventDispatcher
21:38:03,937 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-ht
tpil.war/
21:38:11,000 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-conso
le.war/
21:38:14,875 INFO [MailService] Mail Service bound to java:/Mail
21:38:15,625 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.
rar
21:38:15,687 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar

21:38:15,781 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar

21:38:15,843 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
21:38:16,015 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
21:38:16,093 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
21:38:19,562 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=D
efaultDS' to JNDI name 'java:DefaultDS'
21:38:20,109 INFO [A] Bound to JNDI name: queue/A
21:38:20,109 INFO [B] Bound to JNDI name: queue/B
21:38:20,109 INFO [C] Bound to JNDI name: queue/C
21:38:20,109 INFO [D] Bound to JNDI name: queue/D
21:38:20,125 INFO [ex] Bound to JNDI name: queue/ex
21:38:20,140 INFO [testTopic] Bound to JNDI name: topic/testTopic
21:38:20,140 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
21:38:20,140 INFO [testDurableTopic] Bound to JND
I name: topic/testDurableTopic
21:38:20,140 INFO [testQueue] Bound to JNDI name: queue/testQueue
21:38:20,531 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
21:38:20,562 INFO [DLQ] Bound to JNDI name: queue/DLQ
21:38:20,781 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding
,name=JmsXA' to JNDI name 'java:JmsXA'
21:38:20,984 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
21:38:21,515 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
21:38:22,000 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
21:38:22,015 INFO [JkMain] Jk running ID=0 time=0/62 config=null
21:38:22,031 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started i
n 1m:8s:860ms

Java is Open: A WebLogic sample on the Sun Developer site

Well, quite surprising that the sample code to call an EJB in the Sun Developer's Network was using the BEA WebLogic implementation code. I thought that Sun wouldnot allow it. But I was wrong. That's why we call it: Java is open.

Application Server equals Middleware?

When I first encounter the Java 2 Enterprise Edition world, I encountered only application servers. Then some comparison news, publications, etc. would put all the application servers manufacturers as major middleware vendors. Then I had this equation on my mind:
application server == middleware

Then through further readings, experiences, discussions, etc I concluded that:
application server != middleware

They are of different kind level of abstraction! 
Some (Java) middleware parts are running on Java application server. But to make Java Middleware *EQUALS TO* Java Application Server, is a big big mistake that I have made.  

The equation just doesn't seem to balance out...

These are components of middlewares:

Messaging

Integration Platform

Portal

Thursday, September 14, 2006

Installation of JBoss: A Trivial 4 Step Task

It really is a "4 step task":
1. Download
2. Unzip it!
3. Setup the JDK environment, if you haven't yet
4. Run the script

It works!
I have to admit that this is, the simplest application server that runs it the first time I installed, whether I'm running it in the Windows environment, Linux or Solaris boxes.

1. Download
Go to http://prdownloads.sourceforge.net/jboss/jboss-4.0.4.GA.zip?download
Choose your favorite sourceforge download site. I recommend download the zip version, as it is simpler to handle in multiplatform environment (my personal opinion).
Warning: 75,587kb download!

2. Unzip It!
Assuming that you are running a Windows environment, it is quite trivial task to install JBoss Application Server.
Run your favorite compression tools, unzip the jboss-4.0.4.GA.zip into your folder application server, e.g. c:\opt\env\jboss-4.0.4.GA
Then check that you have these foldere under you "c:\opt\jboss-4.0.4.GA" folder:

  • bin

  • client

  • docs

  • lib

  • server


Also there exist some files (copyright.txt), jar-version.xml, lgpl.html, readme.html, readme_j2ee.html).
If you find these folders, everything seems to be ok this far.

3. Setup the JDK environment
This steps is required when you haven't done it yet. It is kind of setting the JAVA_HOME, CLASSPATH environment variables etc.
I would suggest to put it into a batch file or shell script for easier reuse. In my Windows environment, I would make c:\opt\env\set5.bat for setting up JDK 5, and c:\opt\env\set4.bat for setting up JDK 1.4.2.

The file set5.bat should contain at least:
set JAVA_HOME=c:\opt\env\jdk1.5.0_07
set JBOSS_HOME=c:\opt\env\jboss-4.0.4.GA
set CLASSPATH=%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib;%JAVA_HOME%\jre\lib\ext;.
set PATH=%JAVA_HOME%\bin;%PATH%


Of course you have to tailor it to suit your environment settings.

4. Run the script
Run your script, open the command prompt and type this:
c:\>%JBOSS_HOME%\bin\run

If your command line shows message like these, than congratulations! You have successfully installed the JBoss Application Server. If this is your first time installing an Java application server, welcome to the new world of Java Enterprise Edition environment!

===============================================================================
.
JBoss Bootstrap Environment
.
JBOSS_HOME: c:\opt\env\jboss-4.0.4.GA\bin\\..
.
JAVA: c:\opt\env\jdk1.5.0_07\bin\java
.
JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcIn
terval=3600000
.
CLASSPATH: c:\opt\env\jdk1.5.0_07\lib\tools.jar;d:\opt\env\jboss-4.0.4.GA\bin\\run.jar
.
===============================================================================
.
21:37:13,093 INFO [Server] Starting JBoss (MX MicroKernel)...
21:37:13,125 INFO [Server] Release ID: JBoss [Zion] 4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)
21:37:13,171 INFO [Server] Home Dir: c:\opt\env\jboss-4.0.4.GA
21:37:13,171 INFO [Server] Home URL: file:/c:/opt/env/jboss-4.0.4.GA/
21:37:13,171 INFO [Server] Patch URL: null
21:37:13,171 INFO [Server] Server Name: default
21:37:13,171 INFO [Server] Server Home Dir: D:\opt\env\jboss-4.0.4.GA\server\default
21:37:13,171 INFO [Server] Server Home URL: file:/D:/opt/env/jboss-4.0.4.GA/server/default/
21:37:13,171 INFO [Server] Server Log Dir: D:\opt\env\jboss-4.0.4.GA\server\default\log
21:37:13,171 INFO [Server] Server Temp Dir: D:\opt\env\jboss-4.0.4.GA\server\default\tmp
21:37:13,171 INFO [Server] Root Deployment Filename: jboss-service.xml
21:37:15,453 INFO [ServerInfo] Java version: 1.5.0_07,Sun Microsystems Inc.
21:37:15,453 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_07-b03,Sun Microsystems Inc.
21:37:15,453 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
21:37:17,062 INFO [Server] Core system initialized
21:37:29,828 INFO [WebService] Using RMI server codebase: http://daniel:8083/
21:37:29,843 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
21:37:32,031 INFO [NamingService] JNDI bootstrap JNP=/0.0.0.0:1099, RMI=/0.0.0.0:1098, backlog=50, no client SocketFact
ory, Server SocketFactory=class org.jboss.net.sockets.DefaultSocketFactory
21:37:47,703 INFO [Embedded] Catalina naming disabled
21:37:47,750 INFO [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rul
e set.
21:37:47,765 INFO [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rul
e set.
21:37:49,687 INFO [Http11BaseProtocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
21:37:49,687 INFO [Catalina] Initialization processed in 1922 ms
21:37:49,687 INFO [StandardService] Starting service jboss.web
21:37:49,703 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.5.17
21:37:49,734 INFO [StandardHost] XML validation disabled
21:37:49,765 INFO [Catalina] Server startup in 78 ms
21:37:50,750 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
21:37:51,828 INFO [WebappLoader] Dual registration of jndi stream handler: factory already defined
21:37:58,656 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jbossweb-tomcat55.sar/ROOT.war/
21:38:02,500 INFO [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../tmp/deploy/tmp9122jbossws-exp.war/
21:38:02,875 INFO [SubscriptionManager] Bound event dispatcher to java:/EventDispatcher
21:38:03,937 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-ht
tpil.war/
21:38:11,000 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-conso
le.war/
21:38:14,875 INFO [MailService] Mail Service bound to java:/Mail
21:38:15,625 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.
rar
21:38:15,687 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar


21:38:15,781 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar

21:38:15,843 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
21:38:16,015 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
21:38:16,093 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
21:38:19,562 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=D
efaultDS' to JNDI name 'java:DefaultDS'
21:38:20,109 INFO [A] Bound to JNDI name: queue/A
21:38:20,109 INFO [B] Bound to JNDI name: queue/B
21:38:20,109 INFO [C] Bound to JNDI name: queue/C
21:38:20,109 INFO [D] Bound to JNDI name: queue/D
21:38:20,125 INFO [ex] Bound to JNDI name: queue/ex
21:38:20,140 INFO [testTopic] Bound to JNDI name: topic/testTopic
21:38:20,140 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
21:38:20,140 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
21:38:20,140 INFO [testQueue] Bound to JNDI name: queue/testQueue
21:38:20,531 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
21:38:20,562 INFO [DLQ] Bound to JNDI name: queue/DLQ
21:38:20,781 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding
,name=JmsXA' to JNDI name 'java:JmsXA'
21:38:20,984 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
21:38:21,515 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
21:38:22,000 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
21:38:22,015 INFO [JkMain] Jk running ID=0 time=0/62 config=null
21:38:22,031 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started i
n 1m:8s:860ms