用Lomboz+Glassfish开发部署EAR(基于Eclipse3.3.1.1)

上一篇 / 下一篇  2008-04-17 22:11:20 / 个人分类:Glassfish

这里通过SUN的JAVAEE5Tutorial中的一个简单的EJB例子来说明如何用Lomboz+Glassfish开发并部署EJB;
不可否认SUN的Tutorial系列写的非常的好,如果你看过英文原版之后就会发现市面上卖的那些所谓的J2EE指南
写的是多么的烂多么的误人子弟!但是文档中一个美中不足的地方是,所有的开发和部署都是基于NETBEANS IDE的;
说实话用NETBEANS开发JAVAEE真的很顺手很简单,当然,也因此掩盖了很多细节比如部署配置文件在NETBEAN里完全自动
生成,你只要最后按"Deploy"就自动部署到GLASSFISH里了;我个人是比较提倡真正的快速开发的,无关紧要的东西就应该
隐藏起来,这个微软就做的很好;
因此在我看来无所谓Eclipse还是Netbeans,关键还是JAVAEE的标准!其实目标都是去实现这个标准,殊途同归而已;
那么下面就一步一步介绍如何使用LOMBOZ+ GLASSFISH来开发部署EJB,过后你会发现,效果也绝对不比NETBEANS差!
 
一 、 环境准备
 
1 下载并安装 JDK :本文中使用  java_ee_sdk-5_04-windows.exe 这个版本
    下载地址 :
 
2 下载并安装Lomboz:
    下载地址 :
 
说明:GLASSFISH应用服务器在JDK5 的安装包里已经集成了,而且还自带了JAVA宠物商店2.0作为EXAMPLE,
         用户不必自己去BLUEPRINT(SUN的一个项目)中下载;
 
二 、 将GLASSFISH和LOMBOZ集成
1 打开LOMBOZ开发环境
   选择菜单栏的 Window / Prefrence  选择Server目录进行服务器设置,在这里要添加服务器,默认的没有GLASSFISH
 
三 、 新建EAR项目
1 File / New / Project / J2EE / Enterprise Appication Project
2 Project Name: MyConverter
3 New Module || Finish
4 Generate Deployment Discribtor Describtor
5 Import MyConverterEJB | MyConverterClient | MyConverterWeb
6 Don't forget to reference the MyConverterEJB Project at WEB OR CLIENT Project in Build Path Configure!
7 There is a small problem when you set the build path to WEB APPLICATION . If you reference the MyConverterEJB Project
   to the MyConverterWeb,you will find the index.jsp can't find the reference,and you should change sth at
   <%@ page import=" converter.ejb.Converter, java.math.*, javax.naming.*" %> and recover it! And everything will be OK .
8 Lomboz will  build an "application.xml" at    MyConverter / EarContent / META-INF / ......
----------------------------------------------------------------------------
   <?xml version="1.0" encoding="UTF-8"?>
  <module>
    <java>MyConverterClient.jar</java>
  </module>
  <module>
    <web>
      <web-uri>MyConverterWeb.war</web-uri>
      <context-root>MyConverterWeb</context-root>
    </web>
  </module>
  <module>
    <ejb>MyConverterEJB.jar</ejb>
  </module>
</application>
 
------------------------------------------------------------------------------------
you can see that all the content in the xml file is automaticly build by LOMBOZ!
 
9 Now , you can right-click the MyConverter Project and Export an EAR file named MyConverter.ear  include
   MyConvertClient | MyConverterWeb | MyConverterEJB
10 Deploy the EAR file to GLASSFISH
11 You can debug OR run the Project in Lomboz with glassfish!

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-07-25  
  12345
6789101112
13141516171819
20212223242526
2728293031  

数据统计

  • 访问量: 12272
  • 日志数: 171
  • 影音数: 3
  • 建立时间: 2008-02-28
  • 更新时间: 2008-05-19

RSS订阅

Open Toolbar