Installing Glassfish

12:00AM may 24, 2007 en categoria Java por Enrique Rodriguez Lasterra

Etiquetas:


Glassfish is the implementation of reference of Java EE 5. The truth is that Sun is being working hard on the server, full open source, and there has come the time of proving if this work is as good as they tell us in his blogs and blogs.

There are great things that I want to see: grizzly, the functions of Web Administration and principally, jax-ws, the new implementation of Web services. In this field I have tried almost all but xfire, and i'm not convinced for anythig I have seen, I believe that it should be much easier to do a Web service and I want to see if this new standard is the "solution" for me.

Finally, I have to remind that the captain who directs the course of glassfish is a Spanish, Eduardo Pelegri-Llopart. I had the opportunity to meet him in Sun Tech Days of Madrid last year and promised to write something about it, it's quite late, but we go to it.

By the way, if anybody is thinking that I begin this series of posts pushed by the monitor of 52 inches that Sun give, it's true ;-)

Steps of the installation:
  • Download glassfish, I have gone away for beta2..
  • Meanwhile it discharges, we verify the requisites, JAVA_HOME and ANT_HOME in the environment variables, and ANT_HOME/bin in the PATH
  • Once downloaded we decompress the jar with java-Xmx256m-jar glassfish-installer-v2 ***.jar
  • Once decompressed we execute the ANT install script. First we are going to try without clustering options doing ant-f setup.xml inside the glasfish folder Further on we will try to see the options of clustering
With this we have already glassfish installed and quite prepared to start playing with it.

The first peculiarity of Glassfish opposite to the Tomcat are the "domains". A domain in glassfish is a configuration of the server. Inside this configuration there is an instance of administration and N instances of execution, but all under the same configuration. Thus with one installation of the server you can have several configurations / domains and each of them can have a different "configuration": ports, memory assigned to the JVM, IIOP.

Doing the analogy with the tomcat, every domain of glassfish is an installation of tomcat with one-to-many instance with only one "manager" (saving the distances).

This configuration can be useful in environments with several managers who share an installation, although sincerely, I have not just seen it, because in my small world, in one server there is only one administrator ;-)

When the script install glassfish it creates one domain called domain1. To start this domain we execute the command on the console c:\glassfish\bin\asadmin start-domain domain1. an we should see interesting information: 
asadmin start-domain domain1
Starting Domain domain1, please wait.
Log redirected to C:\glassfish\domains\domain1\logs\server.log.
Redirecting output to C:/glassfish/domains/domain1/logs/server.log
Domain domain1 is ready to receive client requests. Additional
services ploughs being started in background.
Domain [domain1] is running [Sun Java System Application
Server 9.1 (build b41d-beta2)] with its configuration and
logs at: [C:\glassfish\domains].
Admin Console is available at [http: // localhost:4848].
Use the same port [4848] for "asadmin" commands.
Web User applications ploughs available at these URLs:
[http: // localhost:8080 https: // localhost:8181].
Following web - contexts ploughs available:
[/web1 / wstx-services].
Standard JMX Clients (like JConsole) dog connect to JMXServiceURL:
[service:jmx:rmi: /// jndi/rmi: // localhost:8686/jmxrmi]
for domain management purposes.
Domain listens on at least following ports for connections:
[8080 8181 4848 3700 3820 3920 8686 ].
Domain does not support application server clusters and
other standalone instances. 
We verify that the server is started gaining access to http: // localhost:8080/. If we see " up and running " we can install a Web application to verify that everything is correct. The manual proposes to us this application http://glassfish.dev.java.net/downloads/quickstart/hello.war. We download it and copy it to the directory glassfish/domains/domain/autodeploy inside the domain (this comes to be the directory webapps of the tomcat).

As soon as the application was copied the file must appear in the same directory hello.war_deployed, if we try to gain access to to the application earlier we will obtain an error 404.

To access application go to, http: // localhost:8080/hello. If everything is correct we can already say that the installation is ended..

Comentarios:

Enviar un comentario:
Los comentarios han sido deshabilitados.