Practice JBOSS-teach you to write the first EJB-1

Source: Internet
Author: User
Author: Luo Xiaohu Compilation

Preface

This article is intended for readers who want to develop ejb in the jboss environment. Before reading this article, you 'd better have a basic understanding of EJB.

JBOSS is an open-source free EJB server that implements most of the functions specified by other J2EE. sun has now adopted JBOSS as the standard implementation server of J2EE1.4, this article starts with Jboss3.2.6 installation and ends with developing a complete "hello, world" ejb.

  JBOSS installation and startup

If you use JBOSS for the first time, you will be frustrated because although it is open source code and can be downloaded for free, its documentation or technical training is charged, moreover, it is highly difficult for Chinese people (about $10000 for training in a few days, and dozens to hundreds of us for documents )! If you try to find some articles on JBOSS on the Internet, there are only a handful of articles, and there are few cainiao-level articles. On the contrary, there are a lot of articles about its core design and other advanced theories. This will make you more confused. Therefore, the purpose of this article is to allow your JBOSS to run as soon as possible and develop simple ejbs on top of it!

Before installing JBOSS, make sure that you have installed JDK 1.3 or later. Because JBOSS is not bound to jdk as other application servers such as weblogic, JBOSS must support JDK before it can run. Then download a JBoss release (I download jboss-3.2.6.zip) on the http://www.jboss.org website, in this article I use its stable release JBOSS3.2.6 (integrated with Tomcat 4.1 ), tomcat is a well-known open-source jsp/servlet server under the apache Foundation. If you want to learn more about tomcat, please visit the http://jakarta.apache.org for more detailed information.

After you download jboss-3.2.6.zip, the next step is to decompress it. If you are on windows, you can use winzip or winrar. If you are in linux, use the unzip command. For example, suppose I decompress it to the following directory:

C:/jboss-3.2.6

Compared with weblogic, websphere and other j2ee servers, JBOSS startup is simple and unexpected, if you are a windows user, just enter c:/jboss-3.2.6/bin, enter run. bat command, JBOSS runs up; if it is a linux User, just need to enter c:/jboss-3.2.6/bin, enter run. sh, then JBOSS also runs. How is it? Is that simple?

    

When you enter run. bat or run. sh, you will find that the screen will constantly scroll some prompts, after about 1 minute (depending on your machine configuration, my P4 1.7G, 128 M ), the prompt information stops scrolling, as shown in:


(Note: If you are in windows, please keep this DOS window in this state and never stop it !)

In this way, JBOSS is already running. Like other J2EE servers, JBOSS also provides a WEB-based console by entering http: // 127.0.0.1: 8080/web-console/In the IE browser /, in this way, you will see a console as shown in:

How is it? Is this interface no worse than weblogic? Through this console, You can dynamically manage and monitor JBOSS services.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.