Configuring JB WLS can be said to be a nightmare. All the posts can be found on the Internet. There is three or four quality, which can be said that these posts are really good in some respects, the author is also Their help, after a few days of hard exploration, completely successfully integrated JB7 WLS7 and MySQL databases to develop EJB. But these posts are written in the case of JB4-6, WLS5-6.1, and there are many options that do not apply to JB7 WLS7, and they are all unilateral, no one from configuration to the deployment. Complete document. First, the installation does not say. Second, configuration: After installing JB7 and WLS7, you should first configure WLS7, because WLS7 configuration is not related to JB7, JB7 To select the WLS environment Next, step by step: I use the example field used in the document (ie used "Such as: Field"), then you are directly written as a field to configure mysql (other database is the same), such as: EJBDB, configure username and password, such as: EJBDB, configure username and password (root) 111111) Put Mysql's JDBC (such as mysql.jar) in a directory, generally placed in% java_home / lib / down. However, you can always find it as long as you don't put it on the floppy disk. Configuring WLS7 If WLS7 is installed under C: / EA, enter the C: / EA / WebLogic700 / in directory, modify StarTwls.cmd (Note First modify this file is because some documents say modifications C: / EA / user_Projects / Mydomain / STARTWEBLOGIC.CMD is not right.) First modify this file is this at this time C: / EA / user_projects / mydomain / startWebLogic.cmd has not yet been generated, to ensure that you won't get wrong. If you have a STARTWLS.SH to find STTWLS.SH, find SET ClassPath =% java_home% / lib / Tools.jar;% wl_home% / server / lib / weblogic_sp.jar;% wl_home% / server / lib / weblogic.jar;% classpath% Coupled with mysql.jar: set classpath =% java_home / lib / Tools.jar;% wl_home% / server / lib / weblogic_sp.jar;% wl_home% / server / lib / weblogic.jar; path / mysql.jar; % ClassPath% Archive Exit, running the BEA WebLogic Platform 7.0 on the startup menu -> Domain Configuration Wizard is called Configuration Wizard.
1.Select A Template: Select WLS Domain, Name Default Mydomain 2.choose Server Type: The first 3.Specify Directory for "MyDomain" Domain: C: C: / EA / User_Projects / 4.Value Administrative Server Info-Admin Server Name OR IP write machine IP, so insurance, other default 5.configure management server: server name: Default to MyServer Server Listen Address: write machine IP. Other default 6.create System UserName and Password: write username and password, such as: System: AAAAAA 7.Install Server As Windows Servic: Here you don't start when you start your operating system, you can choose from your own needs. 8.install Domain in Windows Start Menu: Here you should not add shortcuts in the Start menu, it is recommended to "yes". This will appear in the start menu. EBA WebLogic Platform 7.0-> User Projects-My Domain-> Start Server if 8 Choosing Yes, now starting from the beginning -> eba weblogic platform 7.0-> user projects-my domain-> start server launch, etc. After the start of the end: http: // localhost: 7001 / console If the page is not found to put Localhost Change to host name or IP try if you cannot enter the steps above, anyway, if you can't access it down, you have to visit this page. Enter the only username and password (System: aaaaaa). Select Services-> JDBC-> Connection Pools on the directory tree on the left, click the configure a new jdbc connection pool on the right. Enter the following information: configuration-> general page: name = mysql connection pool URL = JDBC: MySQL: / / localhost: 3306 / EJBDB (Note EJBDB is the example field I above, the following will be like this) driver classname = org.gjt.mm.mysql.driver Properties: user = root password = 111111 This two lines are Properties content, name is Name = Value Form Click Create to establish a connection pool.
Select Targets-> Server Page: Move myServer to the list of the right, but click Apply to select Services-> JDBC-> Data Sources-> JDBC-> Data Sources-> JDBC-> Data Sources (or TXData Sourcees) in the directory tree on the left. the Configure a new JDBC Connection Pool, enter the following information:. Configuration-> General page: name = Mysql Tx Data Source JNDI name = ejbPool the name that you want to reference later DataSource name Pool name = Mysql Connection Pool select Emulate Two-Phase Commit for non-xa driver and row prefetch enabled Click Create to create a data source. Targets-> Server Page: Move myServer to the list of the right, but click Apply, the configuration is complete -------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- ---------------------------- Configure JB7 1. Modify environment variables TEMP and TMP for directory without spaces, such as: C: / Winnt / Temp, must be noted, otherwise publishing a definitely unsuccessful 2. Start JBuilder7, Tools-> Configure Libraries-> Class-> Add, find mysql.jar, OK, OK 3. Select: Tools-> configure Servers Select the left WebLogic Application Server 6.x , select the enable server 4. Set your general-> Home Directory to WebLogic7 Home Directory, such as: C: / BEA / WebLogic700 / Server, normal JBuilder7 will automatically add other items to you . Server parameters did not fill, in the Class below with add plus mysql.jar defaults to C: /bea/weblogin700/server/lib/weblogic.jar and C: / BEA / WebLogin700 / Server / lib / weblogic_sp. JAR, if not, C: / BEA / WebLogic700 / Server is not specified correctly. In fact, c: /bea/weblogin700/server/lib/weblogic_sp.jar does not exist, don't take it. Just add mySQL.jar. If 2 is not done, it can't be found. 5. Set the Custom-> JDK Installation Directory to the JDK installation directory, such as: C: / bea / jdk131_02 6. Set the Custom-> Bea Home Directory to WebLogic7 Home Director, such as: C: / BEA 7. Custom WOM -> Domain Directory is set to your domain directory, such as: c: / bea / user_projects / mydomain 8. Adding user name, password, domain name, Server Name, click OK to exit.
9. Select: Tools-> Enterprise Setup, click New on the CORBA page, follow the table to fill in the appropriate information: Name for this configuration = Wellogic Path for orb Tools = C: / bea / WebLogic700 / Server Library for projects = WebLogic 6 .x deploy idl compiler command = idlj.exe commnad option for output directory = C: / TEMP (any directory, do not have spaces) Click OK to exit. 10.Config JDKS is best to keep JB7's own JDK1.3.1 or use the JDK below Eab, do not change to another installed JDK1.4, because there are some local methods to achieve good work with WLS in this version. And will definitely go wrong. 11. Choose Project-> Default Project Properties WEBLOGIC 6.X Client and WebLogic 6.x deploy in the Required Libraries in the PATH page, if not, please check if the above steps are correct. Select the Server page, click Single Services for All Service in Project, select WebLogic Application Server 6.x in the drop-down list, but check OK exits. 12. Tools-> Database Pilot-> View-> Options-> Drivers-> Add, enter org.gjt.mm.mysql.driver in the pop-up dialog box Enter mysql: // localhost: 3306 / EJBDB Note No "JDBC:" before. In File-> New pops up new url, select Driver to join the org.gjt.mm.mysql.driver, the URL is automatically displayed as JDBC: MySQL: // localhost: 3306 / EJBDB, determine, then click the toolbar to the right arrow (Apply). Double-click on the left, enter the username root and password 111111, but whether the test database link is passed, if not see the table below, please check the above steps. -------------------------------------------------- -------------------------------------------------- ----- Developing EJB File-> New Project Generates a new project; if: MyProject File-> New Select Enterprise, select EJB2.0 Bean Designer, OK. Press NEW to pop up EJB Module Wizard, name is changed to AccountApp, and the designer AccountApp appears on the left group tree. You can see the plus in front of you can see it with JDBC 1 DataSources and Security Roles. Double-click the EJB Designer AccountApp, and the design interface is displayed on the right. After you want to return to the design interface from another interface.
Click on the first icon on the toolbar, it is like a sun. Title is Create EJB. There are four options, cmp2.0, bmp, session, MessageP four beans, this example is selected BMP, Out of the bean designed window, there will be a bean Properties box on the right, but if your mouse moves quickly it may disappear. Don't tighten, click on the name of the name of the bean, change the name of the bean to AccountBean, Interface is local / recote. ALWAY WARP Primary Key, click Classes and Package: Package: Change to the package name you want to put, this example is: com.fuck.axamn If you use the default name, I like it in remote interface. REMOTE, and Local interface plus Local, and JB is just the opposite, it is like this. Bean class: com.fuck.axamn.AccountBean Home interface class: com.fuck.axamn.AccountRemoteHome local Home interface class: com.fuck.axamn.AccountHome Remote interface calss: com.fuck.axamn.AccountRemote Local interface calss: com. fuck.axamn.Account but in this case I was so named: Bean class: com.fuck.axamn.AccountBean Home interface class: com.fuck.axamn.AccountHome local Home interface class: com.fuck.axamn.AccountLocalHome Remote interface Calss: com.fuck.axamn.account local interface calss: com.fuck.axamn.accountlocal Right-click on the bean design window, select View Source, ok, handle the example. Don't go on first, you can deepen your understanding yourself. If you finally have an error, Copy. After the Bean class itself is designed, click on the Package above the left designer that will see its interface class, a source code will appear on the right, one is designed, the accessory to join (such as the AccountexEption in this example) Right click on Package, select Add Files / Packages, join a Java file, pay attention to the same directory and automatically generated files. After all write, right click on the project name, make, then press F9 to run. If WLS does not start JB will automatically start it. If there is no problem, right-click the designer, select Deploy to go to WLS smoothly, from TTP: // localhost: 7001 / console enters, you can see that AccountApp is released to WLS.
-------------------------------------------------- -------------------------------------------------- ----------- Test: In the project, File-> New-> Enterprise-> EJB Test Client. Name is set to AccountClient Double-click AccountClient.java in the left component tree, editing content is this example . contents mysql -uroot -p 111111 use ejbdb; create table accounts (id varchar (60) not null primary key, ownerName varchar (60), double balance (8,2) default 0.00); make AccountClient.java run AccountClient. java ____________________________________________________________________ JB7 WLS7 MYSQL development CMP CMP development is actually easier than BMP (I'm talking about the simple operation), as long as your definition of a good business logic, when in fact achieve fast, but could not find a online Any example in developing CMP in JB, there is an article on the J Tao. It has to receive 50 yuan to teach you how to develop CMP with JB, too dark. And it is a stationmaster, so I don't dare to publish this article there. But please pay some other places to configure each other, don't let the guy 心 心 心 别 的 钱.. JB develops CMP, in fact, most people don't know how to operate, because CMP is not design interface from the bean designer Established. And many options don't have anyone else to do not know what. The subject is based on the original article already configured JB7 WLS MYSQL now, first define the database of the CMP persistence field, such as we want Be a product, including four fields: ProductID: Product Number (Unique) Name: Product Name Description: Product Description Baseprice: Product Base Pricates So first to define the Database: mysql -uroot -p 111111 Use Ejbdb; Crebdb; Crebdb; Crebdb; Creb; ProductBean Productid Varchar (60) Not Null Pr Imary key, name varchar (60), Description Varchar (200), Baseprice Double (8, 2) Default 0.00); Start JB7. File-> New Project-> Enter engine name as: myProject2 file-> new Select Enterprise, choose EJB2.0 Bean Designer, OK.
Press NEW to pop up EJB Module Wizard, name change to ProductApp, the designer productApp on the left group tree Notice not to create EJB on the design interface on the right, double-click Designer ProductApp, and DataSources under the Component Tree will appear, right click to select Import Schema From Database, the Database Schema Provider window pops up in front of all schema. Select Driver to org.gjt.mm.mysql.driver, the following URL will automatically set the URL for you. Note that when you set up the URL should not Plus JDBC: YDBC: JDBC: MySQL: // Localhost: 3306 / EJBDB If you are trying to get this /// "JDBC:", enter UserName and Password (root: 111111). The default value Datasource is changed to your JDIN Name when configuring mysql in WLS. Click OK, if the link is successful in DataSource, you can see the number in front of it, you can see the EJBDB library. All table, we now have to take the productBean's table as the corresponding relationship of the persistence field, so right-click ProductBean to choose the first Create CMP2.0 Entity Bean. Note that mysql is set to lowercase, so new construction The name of the bean is ProductBean. In this case, a bean design window is generated in the design interface. The name is ProductBean, the left-click name, the right attribute dialog box: bean name: Change to ProductBean. Abstract Schema Name: It will automatically follow up ProductBean interface:. local / remote always wrap primary key: true classes and packages: or BMP as the default name is: Bean class: com.fuck.axamn.ProductBean Home interface class: com.fuck.axamn.ProductRemoteHome local Home Interface Class: com.fuck.axamn.productHome Re Mote Interface Calss: com.fuck.axamn.productremote local interface calss: com.fuck.axamn.product, I am named in this case:
Bean class: com.fuck.axamn.ProductBean Home interface class: com.fuck.axamn.ProductHome local Home interface class: com.fuck.axamn.ProductLocalHome Remote interface calss: com.fuck.axamn.Product Local interface calss: com. In the fuck.axamn.productlocal CMP Properties, this example is a bean corresponding to a table, so the first first Single Table Maping is if it is a BEAN and multi-table related selection, then put the left PRIMARY KEY and the right side The corresponding field is connected with the red line, and you will show the red line as long as the PRIMARY key field is dragging. Click on the PRODUCTAPP on the left component tree, the first level is open, see the 5 files generated ProductHome.java product.java produter.java product.java productLocal.java productBean.java One-one in this annex is knocked in. Double-click the designer after completion, let the right back to the bean design interface, you will see the ProductBean's Finder method There are seven, FindbyPrimaryKey is the system automatically generated system. This is not to be considered. But other six systems cannot know what condition lookup, so you have to write EJB-QL. Click on each method. Popked the dialog box on the right, don't move, enter the content of the corresponding content in the bottom Query content box: SELECT OBJECT (P) from ProductBean as p where p.name =? 1 FindByDescription method: Select Object (p) from productBean as p where p.description =? 1 FindbyBaseprice method: SELECT OBJECT (P) from ProductBean as p where p.baseprice =? 1 FindExpensiveProducts: SELECT OBJECT (P) from ProductBE an AS p WHERE p.basePrice <1 findCheapProducts:? SELECT OBJECT (p) FROM ProductBean AS p WHERE p.basePrice>? 1 findAllProducts: SELECT OBJECT (p) FROM ProductBean AS p WHERE p.productID IS NOT NULL, right-click the project mysproject Make, if there is no error, it should be successfully compiled. Press F9 to run. If WLS does not start JB will automatically start it. If there is no problem, right-click the designer, select Deploy to go to WLS smoothly, from http: // localhost: 7001 / console, you can see that ProductApp is released to WLS.