Deploy EJB
Run build. cmd to generate/weblogic/myserver/ejb_Hello.jar and
/Weblogic/myserver/clientclasses/HelloWorldBeanClient1.class
.
Ejb_Hello.jar is the required EJB package, while HelloWorldBeanClient1.class is the client used to test the EJB component. If you are not familiar with EJB, it is recommended that you solve the ejb_Hello.jar zip package for beginners, if you study the files in the file, you will gain some gains. At least you can know that an EJB is actually like that.
After creating an EJB package, you can publish it. First, you must execute/weblogic/setEnv in the command line to configure the environment variable to call the WebLogic class.
WebLogic provides three methods to publish ejbs to users and execute:
Java-ms24m-mx24m weblogic. EJBDeployerTool
You will get a java gui to publish ejbs. You only need to make some settings to publish ejbs, mainly to set the system password of WebLogic server, path of the java compiler (the default setting may be incorrect due to the Chinese system and must be reset)
I am sorry for this GUI. I have never been able to find any way to uninstall or update ejbs on this GUI. Therefore, we recommend that you use the command line method to publish ejbs.
The command line is to publish and manage ejbs by executing weblogic. deploy. You can run the following command line:
Java weblogic. deploy
To learn more about the called parameters, here is a brief introduction to the usage:
List the ejbs released by the System
Java weblogic. deploy-host localhost-port 7001 list systempasswd
Publish an EJB
Java weblogic. deploy-host localhost-port 7001 deploy systempasswd myejb. jar Path: myejb. jar
Detach a published EJB
Java weblogic. deploy-host localhost-port 7001 undeploy systempasswd myejb. jar
Update a published EJB
Java weblogic. deploy-port 7001-host localhost update systempasswd myejb. jar
You can also
Weblogic. properties
Weblogic. ejb. deploy = Path: myejb. jar
Test with a client:
Java-classpath.; F: weblogicclasses; F: weblogicclassesoot; F: weblogiclibweblogicaux. jar; F: weblogiclibpersistenceWe
BLogic_RDBMS.jar; hello. HelloWorldBeanClient
Integration of JB4 and WebLogic
From the previous article, we can see that it is really troublesome to write ejbs in a text editor. Therefore, it is best to use tools such as JB4 to compile ejbs. This article mainly discusses how to integrate JB4 and weblogic to develop and release ejbs.
Preparations
For various reasons, JB4 configuration is very important. Otherwise, it will not be able to proceed smoothly. First, make sure that you have obtained the ENTERPRISE Edition of JB4 and IAS, you cannot develop ejbs in FOUDATION.
Because we usually use the Chinese win2000 operating system, weblogic and JB4 have a little problem with Chinese support, so if we plan to develop it under the Chinese win2000, there must be some odd settings.
First, modify the system environment variables and change TMP and TEMP to directories without spaces;
In JB4 menu = "Project => Default Project Properties =" Paths, change all directories with spaces to directories without spaces. Why do you need to set them like this? Because the integrated weblogic and JB4 call the weblogic package during the development process to create ejbs, weblogic cannot identify those with spaces well, and errors may occur during work, that is, the directory to be accessed by weblogic. The directory name should not be a Chinese name or contain spaces.
Some may find that the cursor is not aligned with the actual position when editing JB4, in fact, you only need to set the Reserved Word in Tools => Editor Opntion => Color to not use bold or italic.
JB4 Configuration
(1) Tools Menu =, Enterprise Setup =, and CORBA
Add a weblogic entry,
Add the Weblogic directory under Path for ORB tools
Under Library for projects, add the Weblogic5.1 Library by clicking "..." And then selecting Weblogic5.1;
Enter idlj.exe in compiler command
Fill in a directory path in Command option for output directory, but note that it cannot contain Chinese characters or spaces.
(2) Tools Menu = "Enterprise Setup =" Application Server = "Weblogic5.1
Enter the Weblogic installation directory.
(3) Project = "Default Project Properties =" Paths = "Required Libraries
Add = select Weblogic5.1;
Project = Default Project Properties = Build = IDL
Select Weblogic in IDL compiler;
Project = Default Project Properties = Enterprise
Click "...". Here, select Application Server. Of course, choose Weblogic5.1.
If you want to debug the program faster, go to Project = "Default Project Properties =" Run
Remove the hooks of Complile before running and Complile before debugging. Otherwise, the EJB package will be re-created even if you run the EJB client once.