programmera.net -> j2ee -> normal för utskrift | info@programmera.net |
Installera JBoss AS 4.0.5 på Linux
1. Installera JBoss AS 4.0.5 på Linux
På denna sida ska vi installera applikationsservern JBoss AS 4.0.5 på Linux. JBoss AS 4 är Java EE 1.4-certifierad, och innehåller dessutom en hel del av Java EE 1.5-certifieringen.
2. Krav på servern
Installationen förutsätter att du har Java 1.4 (J2SE) eller högre installerad på den aktuella maskinen. För att använda EJB 3.0 (som egentligen är en komponent från Java EE 5, krävs att du kör Java 1.5. Själv kör jag 1.5:
[olle@dev1]$ java -version
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)
3. Ladda hem och starta JEMS Installer
Egentligen är JBoss redan installerad så fort man packar upp koden, men inte konfigurerad. Det finns ett praktiskt program att ladda hem för konfiguration som heter JEMS Installer som vi ska använda. Går att ladda ner från
http://labs.jboss.com/portal/jemsinstaller/downloads . Gå till katalogen JEMS hamnade i och skriv:
Vi ser nu följande fönster:
[olle@dev1]$ java -jar jems-installer-1.2.0.jar
calltarget:
chmod-bin:
[echo] Updating script executable modes
[echo] bin dir is /opt/jboss-4.0.5.GA/bin
calltarget:
jbossws-post-install:
[echo] Unpacking wstools to bin...
[unzip] Expanding: /opt/jboss-4.0.5.GA/client/jbossws-client.jar into /opt/jboss-4.0.5.GA/bin
[echo] Removing jbossws14 client jars...
[delete] Deleting 4 files from /opt/jboss-4.0.5.GA/client
[delete] Deleting /opt/jboss-4.0.5.GA/client/jboss-backport-concurrent.jar
[delete] Deleting /opt/jboss-4.0.5.GA/client/jbossretro-rt.jar
[delete] Deleting /opt/jboss-4.0.5.GA/client/jbossws14-client.jar
[delete] Deleting /opt/jboss-4.0.5.GA/client/namespace.jar
[echo] jbossws done
4. Fönster 1: Intro
Första fönstret visar vilken version som installeras:
Klicka "next".
5. Fönster 2: Release Notes
Nu får man se lite information relevant för den aktuella versionen:
Klicka "next" när du läst klart.
6. Fönster 3: Licens
Detta fönster beskriver licensen.
Acceptera och klicka "next".
7. Fönster 4: Sökväg till JBoss
Här får du välja var JBoss ska installeras:
Här väljer vi /opt/jboss-4.0.5.GA.
8. Fönster 5: Typ av installation
Välj nu mellan följande typer av installation:
Vi väljer EJB3 för att få tillgång till denna nya teknik.
9. Fönster 6: Välj moduler
Du kan nu välja bort någon modul du inte vill installera:
Vi går vidare med "next".
10. Fönster 7: Välj installationssätt
Här kan du välja mellan "standard" och "advanced":
Vi väljer "standard".
11. Fönster 8: Info
Här får du se lite info om installationen:
Klicka "next".
12. Fönster 9: Status
Nu visas en statusbar:
13. Fönster 10: Färdig
Följande fönster visas när installationen är färdig:
14. Vad installerades?
Om du tittar under <JBOSS_HOME>/server/ så ser man att en vi har en mapp default, denna mapp representerar den installerade servern. Om vi tittar under denna mapp ser vi:
Filen /opt/jboss-4.0.5.GA/server/default/conf/jboss-service.xml beskriver serverns konfiguration.
[olle@dev1]$ cd /opt/jboss-4.0.5.GA/server/default
[olle@dev1]$ ls
conf deploy lib
15. Uppdatera .bash_profile
För att vi ska använda rätt version av Java kan det vara bekvämt att uppdatera filen .bash_profile med följande rader:
Jag använder "root" för att starta JBoss, därför uppdaterar jag filen /root/.bash_profile.
# 2007-05-02 Olle added some Java parameters for the JBoss4 installation.
JAVA_HOME=/opt/jdk1.5.0.7/jdk1.5.0_07
PATH=/opt/jdk1.5.0.7/jdk1.5.0_07/bin:$PATH
JBOSS_HOME=/opt/jboss-4.0.5.GA
export JAVA_HOME PATH JBOSS_HOME
16. Starta JBoss
Vi måste testa att starta JBoss för att se att allt fungerar. Nu startar vi servern:
Verkar fungera.
[olle@dev1]$ cd /opt/jboss-4.0.5.GA/bin
[olle@dev1]$ sh run.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /opt/jboss-4.0.5.GA
JAVA: /opt/jdk1.5.0.7/jdk1.5.0_07/bin/java
JAVA_OPTS: -Dprogram.name=run.sh -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
CLASSPATH: /opt/jboss-4.0.5.GA/bin/run.jar:/opt/jdk1.5.0.7/jdk1.5.0_07/lib/tools.jar
=========================================================================
16:29:52,027 INFO [Server] Starting JBoss (MX MicroKernel)...
16:29:52,043 INFO [Server] Release ID: JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)
16:29:52,081 INFO [Server] Home Dir: /opt/jboss-4.0.5.GA
16:29:52,082 INFO [Server] Home URL: file:/opt/jboss-4.0.5.GA/
16:29:52,117 INFO [Server] Patch URL: null
16:29:52,118 INFO [Server] Server Name: default
16:29:52,118 INFO [Server] Server Home Dir: /opt/jboss-4.0.5.GA/server/default
16:29:52,119 INFO [Server] Server Home URL: file:/opt/jboss-4.0.5.GA/server/default/
16:29:52,154 INFO [Server] Server Log Dir: /opt/jboss-4.0.5.GA/server/default/log
16:29:52,155 INFO [Server] Server Temp Dir: /opt/jboss-4.0.5.GA/server/default/tmp
16:29:52,190 INFO [Server] Root Deployment Filename: jboss-service.xml
16:29:53,495 INFO [ServerInfo] Java version: 1.5.0_07,Sun Microsystems Inc.
16:29:53,496 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_07-b03,Sun Microsystems Inc.
16:29:53,496 INFO [ServerInfo] OS-System: Linux 2.6.9-34.EL,i386
16:29:56,554 INFO [Server] Core system initialized
16:30:12,339 INFO [WebService] Using RMI server codebase: http://okullberg-pc:8083/
16:30:12,649 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
16:30:25,875 INFO [SocketServerInvoker] Invoker started for locator: InvokerLocator [socket://127.0.0.1:3873/]
16:30:45,384 INFO [ServiceEndpointManager] WebServices: jbossws-1.0.3.SP1 (date=200609291417)
16:30:47,909 INFO [SnmpAgentService] SNMP agent going active
16:30:51,331 INFO [CorbaNamingService] Naming: [IOR:000000000...
16:30:51,759 INFO [CorbaTransactionService] TransactionFactory: [IOR:00000...
16:30:53,978 INFO [Embedded] Catalina naming disabled
16:30:56,040 INFO [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rule set.
16:30:56,089 INFO [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rule set.
16:31:01,202 INFO [Http11BaseProtocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
16:31:01,252 INFO [Catalina] Initialization processed in 5162 ms
16:31:01,253 INFO [StandardService] Starting service jboss.web
16:31:01,307 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.5.20
16:31:01,471 INFO [StandardHost] XML validation disabled
16:31:02,136 INFO [Catalina] Server startup in 883 ms
16:31:02,677 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
16:31:04,239 INFO [WebappLoader] Dual registration of jndi stream handler: factory already defined
16:31:05,772 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jbossweb-tomcat55.sar/ROOT.war/
16:31:06,417 INFO [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../tmp/deploy/tmp50681jbossws-context-exp.war/
16:31:07,156 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
16:31:14,523 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
16:31:16,755 INFO [MailService] Mail Service bound to java:/Mail
16:31:18,607 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.rar
16:31:18,820 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar
16:31:18,948 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
16:31:19,093 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
16:31:19,535 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
16:31:19,692 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
16:31:19,977 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/quartz-ra.rar
16:31:20,051 INFO [QuartzResourceAdapter] start quartz!!!
16:31:20,353 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main
16:31:20,539 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
16:31:20,596 INFO [RAMJobStore] RAMJobStore initialized.
16:31:20,597 INFO [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
16:31:20,598 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
16:31:20,647 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
16:31:25,075 INFO [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
16:31:25,920 INFO [A] Bound to JNDI name: queue/A
16:31:25,987 INFO [B] Bound to JNDI name: queue/B
16:31:26,036 INFO [C] Bound to JNDI name: queue/C
16:31:26,084 INFO [D] Bound to JNDI name: queue/D
16:31:26,132 INFO [ex] Bound to JNDI name: queue/ex
16:31:26,230 INFO [testTopic] Bound to JNDI name: topic/testTopic
16:31:26,279 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
16:31:26,327 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
16:31:26,380 INFO [testQueue] Bound to JNDI name: queue/testQueue
16:31:27,568 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
16:31:27,714 INFO [DLQ] Bound to JNDI name: queue/DLQ
16:31:28,901 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
16:31:29,018 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
16:31:32,605 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
16:31:33,037 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
16:31:33,105 INFO [JkMain] Jk running ID=0 time=0/139 config=null
16:31:33,448 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 1m:41s:217ms
17. Startsidan
Kolla startsidan på sökvägen localhost:8080:
18. Stoppa servern
Gör bara Ctrl-C i fönstret så stannar servern. Om du vill stänga från ett annat fönster kan du köra:
[olle@dev1]$ ./shutdown.sh -S