About EJB 01 Configuring EJB Rapid Development Environment

xiaoxiao2021-03-06  44

The following environments are suitable for EJB research environments, as well as an environment where EJB is quickly developed. Features: Simple, direct, saving resources. Tools: J2SDKEE-1_3_1Jboss-2.4.10jakarta-Ant-1.5xDoclet-bin-1.2.1 Configuring J2SDK Environment: 1 set java_home = d: /jdk1.3 2 set path;% java_home% / bin3 set classpath ;.

Configuring J2SDKee: 1 set j2ee_home = d: /j2sdkee1.3.12 set path;% j2ee_home% / bin3 set classpath;% j2ee_home% / lib / j2ee.jar

Note: If some systems, such as Windows 98 do not know spaces in the path, you can ClassPath throughout the path, and double quotes: "classpath;; xxx.jar".

Configure the environment variable of JBoss to implement the EJB on Remote Server through JNDI: SET% jboss_home% = d: /jboss-2.4.10

Set classpath;% jboss_home% / client / jnp-client.jar;% jboss_home% / client / jboss-client.jar

Client java class instantiation need to make the following settings to set the environment found on the EJB remote server: public static final String INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory"; public static final String PROVIDER_URL = "jnp: // localhost: 1099" Public static final string url_pkg_prefixes = "org.jboss.naming: org.jnp.interfaces"; public property env = NULL;

{Env = new Properties (); env.put (Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY); env.put (Context.PROVIDER_URL, PROVIDER_URL); //env.put(Context.URL_PKG_PREFIXES, URL_PKG_PREFIXES); //env.put(Context .SECURITY_PRINCIPAL, "admin"); //env.put(Context.SECURITY_CREDENTIALS, "123456");} public void go (String greetingStr) {try {Context ic = new InitialContext (env); Object o = ic.lookup ( "JNDI / Advice");} catch (exception ex) {ex.printStackTrace ();}} Create a JAR file to be deployed: jar -cvf jarname.jar packagedir / * .xmlcurrentdir | packagedir | META-INF

Install ANT 1 set ant_home = d: /jakarta-ant-1.52 set path;% ant_home% / bin

· Unix If the ANT installation directory is / usr / local / ant, press the method to set the export ant_home = / usr / local / antexport path = $ {pat}: $ {ant_home} / bin

Sets set classpath;% java_home% / lib / Tools.jar with xDoclet

When using Ant XDoclet, the agreement on the directory where Source Java is located: 1 file path under TestApp / SRC / Java must match the Source Java's package

2 Compiling JARs needed by Java should be placed in the TestApp / lib directory and indicate in Build.xml. Such as:

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

New Post(0)