Deploy J2EE app on JBoss, TOCMAT

xiaoxiao2021-03-06  61

Note: Transfer from http://blog.9cbs.net/ezerg/archive/2004/09/30/121476.aspx releases a web application, package into a WAR file. Release an EJB component separately and package it into a JAR file. For a J2EE app, you should be packaged as an EAR file.

Deploy EJB components on JBoss-Tomcat

Deploy to the directory: / Server / Default / Deploy

/ Related Categories / Meta-INF / EJB-jar.xml / meta-inf /jboss.xml

EJB.XML file

BookStore Application BookDB EJB BookDbejb Mypack.bookdbejbhome mypack.bookdbejb mypack.bookdbejbimpl stateless bean < / Transaction-Type>

JBoss.xml file

BookDbejb EJB / BOOKDBEJB

Make a JAR package, copy the file to the publisher.

Deploy web application on JBoss-Tomcat

Keep the original directory structure, the only change should add a JBoss-web.xml file under the web-inflicity

EJB / BOOKDBEJB EJB / BOOKDBEJB

Web.xml

EJB / BOOKDBEJB Session mypack.bookdbejbhome mypack.bookdbejb

In the above code, the reference to BookDbejb is declared, the declaration referenced by the declaration EJB's HOME interface, declared EJB's REMOTE interface. References of EJB can be obtained by in the program:

InitialContext IC = New InitialContext (); Object Objref = IC.LOOKUP ("Java: Comp / ENV / EJB / BOOKDBEJB");

Access the EJB component in the program, you can specify , or you can specify . The former can improve the independence and flexibility of the program code. For example, if the name of JNDI changes, the program code is not modified, and the mapping relationship between and in the JBoss-Web.xml file is modified.

Make a WAR package, copy the file to the publisher.

Deploy J2EE app on JBoss-Tomcat

/ EJB component (* .jar file) / web application (* .war file) /meta-inf/application.xml

Application.xml file

BookStore J2EE Application

bookstore.war / bookstore

BookDbejb.jar

Pracing the EAR package, copy the file to the publisher

转载请注明原文地址:https://www.9cbs.com/read-111496.html

New Post(0)