In this article I'll summarize my steps on installing Metro and Glassfish. In a follow-up, I'll expand on creating a HelloWorld webservice to deploy on Glassfish and Weblogic. I'll assume that installing Weblogic is straightforward and doable by anyone that can download the installer from otn.oracle.com.
Download
Required Software
The recommended or required setup for developing webservices using Metro and Eclipse can be found on: https://metro.dev.java.net/guide/Required_Software.html.
Based on this list I build following list:
- Java JDK 6 (1.6.0_13)
- Glassfish for J2EE Webservice deployment. Used Version 2.1.1, latest production.
- Metro 1.5
- Eclipse. Used Eclipse 3.4.2.
- soapUI. Used 2.5
Download Metro and Glassfish
- Glassfish: https://glassfish.dev.java.net/downloads/v2.1-b60e.html
- Metro: https://metro.dev.java.net/1.5/
Install Glassfish and Metro
- First install Glassfish. To do that you need to execute the following command:
- Go to the glassfish directory:
- Perform the setup using ant. The ant delivered with Glassfish is 1.7.1. You could use this one. But if you have the same already installed elsewhere on your system you could ofcourse use that.
- The setup will configure glassfish for the following ports:
- Using port 4848 for Admin.
- Using port 8080 for HTTP Instance.
- Using port 7676 for JMS.
- Using port 3700 for IIOP.
- Using port 8181 for HTTP_SSL.
- Using default port 3820 for IIOP_SSL.
- Using default port 3920 for IIOP_MUTUALAUTH.
- Using default port 8686 for JMX_ADMIN.
- The Login information is stored in seperate file on the user’s home directory.
- Default username for the admin user is: ‘admin’, the password is: ‘adminadmin’.
java -Xms256M -Xmx384M -jar glassfish-installer-v2.1-b60e-windows.jar
It appears that the default minimal heapspace is not enough. Following the user-guide a minimum of 256M should be used.
The command above just unpacks the installation to a subdirectory called ‘glassfish’.. The actual setup is done using ant.
cd glassfish chmod -R +x lib/ant/bin
lib\ant\bin\ant -f setup.xml
Installing metro goes about the same.
- Extract metro using:
- Metro is included in Glassfish. But the used Glassfish is from January 23rd 2009 and Metro April 17th 2009. So I suggest updating Metro to be sure we have the latest version.
java -jar metro-1_5.jar
ant -Das.home=*gf_install_dir* -f *metro_install_dir*/metro-on-glassfish.xml installFor example
ant -Das.home=c:\utils\glassfish -f c:\utils\metro\metro-on-glassfish.xml install
Install Eclipse Glassfish plug-in and add Glassfish Server
To have Glassfish started and stopped in Eclipse you’ll need to add Glassfish as a Server. By default Eclipse does not know how to handle J2EE servers like Glassfish. So you’ll have to install the Glassfish plug-in
- Open the J2EE perspective
- If needed (and not already done) set your proxy-Server, to get plug-ins downloaded.
- Go to Window > Preferences > General > Network Connections.
- Determine your proxy-server. For example, get it from your browser connection-settings.
- Set the Proxy. Normally use the same proxy for all protocols.
- Go to the Servers tab (below)
- Right-Click > New Server > Download Plugins
- Choose the appropriate Glassfish version (Glassfish Java EE 5 Server), accepteer license, etc.and follow the further next-next-finish pages.
- In the Server Tab, Right-Click > New Server again.
- In the Select server type pane, choose Glassfish>Glassfish v2.1 Java EE 5. and choose next
- Fill in or ensure you have the following details:
- Domain name: domain1
- Domain directory: *glassfish-home*/domains
- Administrator Id: admin
- Administrator Password: adminadmin
- Follow the wizard to the end and press finish.
I find it convenient to have Application Servers Admin consoles started in an external browser (Firefox) when opened from Eclipse. To have that, choose Window>Web Browser> 2. Firefox (depending on given choices and possible browsers install sequence).
When you manually start or stop a J2EE server that is registered with Eclipse, Eclipse will know…
You can add Weblogic to Eclipse the same way as Glassfish. You’ll have to install the Weblogic pluging though. Choose the ones from the Oracle main entry (not the BEA), because Weblogic 10.3 is from the Oracle BEA era.
Starting and stopping glasfish by hand
You might want to start/stop Glassfish by hand. The default domain of Glassfish is domain1. To start the domain:asadmin start-domain domain1To stop it:
asadmin stop-domain domain1Where asadmin is in the *glassfish-home*/bin, for example: c:\utils\glassfish\bin.
4 comments :
Hi,
I am using Glassfish Tools Bundle for Eclipse which supposedly comes with Metro. I set Metro runtime in Preferences -> Web Services -> Metro Preferences but am unable to create a web service client using Metro. I get IWAB0014E Unexpected exception occurred. I am able to create a client on Axis. Is there a setting I am missing? Environment variable? Any help will be much appreciated.
Hi Julia,
In the article http://darwin-it.blogspot.com/2009/06/hello-metro.html I described how to create a metro-webservice. That worked for me. You might want to review that one.
Regards,
Martien
Hi Julia,
In the article http://darwin-it.blogspot.com/2009/06/hello-metro.html I described how to create a metro-webservice. That worked for me. You might want to review that one.
Regards,
Martien
Nice. Thanks for sharing.
Post a Comment