Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure EJB under Jboss

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to configure EJB under Jboss. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

I. Preface

Jboss for Open Source, completely free Appliaction Server, for J2EE has good support, can be a perfect combination with Tomcat.

Download and install

Download address is Jboss official site: http://www.jboss.org/, I downloaded Jboss2, and together with tomcat, so as to avoid the problem of configuration with a single download. Download address: http://www.jboss.org/jboss_tomcat.zip

After downloading, extract it to a directory, and I'll use E:jboss_tomcat as an example here. There are subdirectories below:

E:jboss_tomcatjboss2

And

E:jboss_tomcat omcat32b7

Note that my directory here has been slightly changed so that if you don't add TOMCAT_HOME to CLASSPATH, the E:jboss_tomcatjboss2in un_with_tomcat.bat file will have to be changed to work properly.

III. Configuration and operation

Basically no configuration, as long as JDK is installed, of course, it is best to add TOMCAT_HOME to CLASSPATH.

In this way, the TOMCAT_HOME before the E:jboss_tomcatjboss2in un_with_tomcat.bat file can be removed.

Run the E:jboss_tomcatjboss2in un_with_tomcat.bat file so that the Tomcat port is 8083 at 8080

Running http://localhost:8080/ will bring up the tomcat home page

Running http://localhost:8083/ will result in a blank page without errors

4. Test EJB

(1) start JBOSS:

For the method, see above:

(2) download code:

Http://www.wodejia.net/softdownload/java/interestejb.zip

Unlock it, and the following directory appears:

Interest/com

Interest/docs

...

All copy to the examples directory under jboss2. If there is no examples directory, create one with the following structure:

E:jboss_tomcatjboss2examplesinterest...

Copy the file E:jboss_tomcatjboss2examplesinterestinterest.jar to:

Under E:jboss_tomcatjboss2deploy:

Add the following files to CLASSPATH:

E:jboss_tomcat omcat32b7libservlet.jar;E:jbossclientjboss-client.jar;E:jbossclientjnp-client.jar;E:jbosslibextejb.jar;E:jbossexamplesinterestinterest-client.jar

In order to test that Client calls EJB through servlet, you must copy EJB.class and EJB.java under: E:jboss_tomcatjboss2examplesinterest to:

Under the E:jboss_tomcat omcat32b7webappsROOTWEB-INFclasses directory

Restart JBOSS_TOMCAT

(3) client test run under command:

Under command, enter the directory E:jboss_tomcatjboss2examplesinterest

Java InterestClient

The following appears:

Got context

Got reference

Interest on 1000 units, at 10% per period, compounded over 2 periods is: 210.000000000023

The jboss window appears:

[Interest] Someone called `calculateCompoundInterest!'

(4) client runs through Servlet test under web:

Http://cgreen:8080/servlet/EJB

The following appears:

Interest on 1000 units, at 10% per period, compounded over 2 periods is: 210.000000000023

The jboss window appears:

[Interest] Someone called `calculateCompoundInterest!'

This is the end of this article on "how to configure EJB under Jboss". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report