Connecting a Java Swing application to a Geronimo server

Source: Internet
Author: User

Creating an independent client that can talk to a Geronimo EJB application

Brief introduction

This article will show you how to develop independent (FAT) clients that can communicate with EJB applications running within the Geronimo application server. Based on my first two articles-"Three ways to connect a database to a Geronimo application Server" (developerworks,2005 June) and "Go deep into an EJB Web application with Geronimo" (developerworks,2005 years July)--This article shows you a Swing client that connects to a small phone book database built using a Geronimo EJB application. You will read the brief design instructions and then read information about the client libraries needed to run the application. Next I'll explain how to connect to the server and perform operations on the remote stateless session bean on the server. Finally, you will learn how to develop, compile, and run client applications, and how to configure the server to allow secure access from specific clients on your network.

Design Overview

Let's start with a brief introduction to the sample application design--a unified Modeling Language (Unified Modeling Language, UML) deployment diagram that describes the phone book client application, as shown in Figure 1. The client application connects to Geronimo through its EJB port and talks with the phonebook session EJB to manipulate the data in the database through phonebook Entry container-managed Persistence (CMP) 。

Figure 1. Phone Book client deployment diagram

The default release of Geronimo has restrictions on the EJB port. You can connect to a client application only if it is running on the same machine and is connected through a loopback address (localhost or 127.0.0.1). Later in this article, configuring the EJB Ports section of Geronimo provides detailed information about how to get clients on other machines to access the server.

Client library for connection to Geronimo

For client applications to be able to connect to the EJB port of Geronimo and communicate with the EJB layer, the following Java libraries must be in the client classpath:

Geronimo-spec-j2ee-1.4-rc4.jar

Geronimo-kernel-1.0-snapshot.jar

Geronimo-j2ee-1.0-snapshot.jar

Geronimo-security-1.0-snapshot.jar

Cglib-nodep-2.1.jar

Openejb-core-2.0-snapshot.jar

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.