first, you need to put the jar packages and configuration files used by hibernate on the classpath path WebLogic can search.. This step alone a lot of people are confused, in fact, to take a closer look at WebLogic startup script files Startweblogic.cmd and startwls.cmd, I think most people know how to configure the.
I have a hibernate project on my machine, in the D:/test/oracle directory, the structure of the directory is:
Java code:
D:/test/oracle/lib all jar packs that place hibernate
D:/TEST/ORACLE/SRC Place Source Code
d:/test/oracle/classes compile O ' Mae Code and Hibernate configuration file (Hibernate.properties, log4j.properties, CACHE.CCF)
Now you need to put all the jar files and d:/test/oracle/classes directories in the D:/test/oracle/lib directory into WebLogic Classpath, So modify the mydomain inside the WebLogic startup script Startweblogic.cmd, before starting WebLogic, insert the command to set Classpath, as follows:
Java code:
@rem Set Hibernate classpath
Set Hibernate_lib=d:/test/oracle/lib
Set hibernate_classes=d:/test/oracle/classes
Set classpath=%hibernate_lib%/cglib-asm.jar;%hibernate_lib%/commons-beanutils.jar;%hibernate_lib%/ commons-collections.jar;%hibernate_lib%/commons-lang.jar;%hibernate_lib%/commons-logging.jar;%hibernate_lib%/ dom4j-full.jar;%hibernate_lib%/hibernate2.jar;%hibernate_lib%/jcs.jar;%hibernate_lib%/log4j-1.2.8.jar;% hibernate_lib%/odmg.jar;%hibernate_classes%;%classpath%
The following line is the start command in the original script:
Java code:
@rem Call Weblogic Server
Call "C:/bea/weblogic700/server/bin/startwls.cmd"
Second, configure the Oracle database connection pool on the WebLogic. This step would have nothing to do with hibernate, but if you want to use an EJB and want to use JTA, you must use the connection pool provided by WebLogic instead of using Hibernate's own connection pool or other Third-party connection pools, or the container will not be able to manage database transactions. This step is very simple, is in the WebLogic console Configuration connection pool and TxData Source, my tx datasource named "Mypool"
Third, modify the hibernate.properties. Use a WebLogic connection pool instead of a self-contained connection pool. I modified the d:/test/oracle/classes/hibernate.properties to add the following line:
Java code:
Hibernate.dialect Net.sf.hibernate.dialect.OracleDialect
Hibernate.connection.datasource Mypool
Hibernate.connection.provider_class Net.sf.hibernate.connection.DatasourceConnectionProvider
Hibernate.session_factory_name hibernate.session_factory
Note that the last line, which uses Hibernate to bind Jndi to Jndi names, should have been hibernate/session_factory, but the weblogic requirement was changed to. , but you still have to write hibernate/session_factory in the program.
In addition, mention is made of:
Java code:
Hibernate.jdbc.fetch_size 50
Hibernate.jdbc.batch_size 25
There is a great performance impact on database queries and inserts, and tuning these options can achieve the best performance.
1, how to give WebLogic the specified size of memory?
In the script that initiates WebLogic (Startservername in the corresponding server directory of the Domian), add
With set mem_args=-xms32m-xmx200m, the minimum memory can be adjusted to 32M, Max 200M
2, how to set the WebLogic hot start Mode (development mode) and product release mode?
You can modify the startup mode of the corresponding server in the admin console for one of the development or product models. or modify the service
Startup file or commenv file, add set Production_mode=true.
3, how to start without entering a username and password?
Modify service startup files to add Wls_user and WLS_PW entries. You can also add in the Boot.properties file
The user name and password that have been encrypted.
4, in the WebLogic Management console for an application domain (or a Web site, domain) for JMS and EJB or
The connection pool and other related information to configure, actually save in what file?
stored in the Config.xml file in this domain, it is the core configuration file for the server.
5, talk about a domain in the WebLogic default directory structure? For example, to put a simple helloworld.jsp
In what directory, but in the browser can be into the http://host: port number//helloword.jsp can see the results of the operation? And for example, what do you do with a javabean that you write?
Domain directory/server directory/applications, put the application directory in this directory will be available as an application access
, if the Web application, the application directory needs to meet the requirements of the Web application directory, JSP files can be directly placed in the application directory
, JavaBean needs to be placed in the classes directory of the Web-inf directory of the application directory, and the default should be set for the server
Use will be implemented on the browser without entering the application name.
6. How do I see the EJB that has been published in WebLogic?
You can use the Admin console to view all published EJBS in its deployment
7, how to WebLogic in the SSL configuration and client authentication configuration or say Java (standard) for SSL configuration
SSL is implemented using DEMOIDENTITY.JKS and Demotrust.jks KeyStore in the default installation and requires configuration services
Using enable SSL to configure its ports, you need to obtain private keys and digital certificates from the CA in product mode, creating
Build identity and trust KeyStore, mount the acquired key and digital certificate. You can configure this SSL connection to be one-way
or bi-directional.
8. Which configuration files should be involved in publishing EJB in WebLogic
Different types of EJB-related configuration files are involved in a configuration file that includes
EJB-JAR.XML,WEBLOGIC-EJB-JAR.XMLCMP entity beans typically also require
Weblogic-cmp-rdbms-jar.xml
9, EJB need to directly implement its business interface or home interface, please brief reasons.
Remote interface and home interface do not need to implement directly, their implementation code is generated by the server, program running
The corresponding implementation class is used as an instance of the corresponding interface type.
10, talk about the difference between persistent and non-persisten when developing a message bean in WebLogic
Persistent MDB can guarantee the reliability of message delivery, that is, if there is a problem with the EJB container, the JMS service
The service will still send the message when this MDB is available, and the non-persistent message will be lost.
Abandon.
11. What are some of the common patterns in Java EE that you know or have heard about? and some ideas about design pattern
Session façade pattern: using Sessionbean to access Entitybean
Message façade pattern: implementing an Asynchronous call
EJB command pattern: Use command JavaBeans instead of Sessionbean for lightweight access
Data Transfer Object Factory: Simplifies Entitybean with DTO Factory features
Generic Access: Simplifies Entitybean data-delivery features via the Attibuteaccess interface
Business Interface: Implementing the same interface specification with the remote (local) interface and the Bean class is consistent with business logic
Of
The design of EJB architecture will directly affect system performance, scalability, maintainability, component reusability and
Development efficiency. The more complex the project, the greater the project team, the greater the importance of good design.
1, how to give WebLogic the specified size of memory?
In the script that initiates WebLogic (Startservername in the corresponding server directory of the Domian), add
With set mem_args=-xms32m-xmx200m, the minimum memory can be adjusted to 32M, Max 200M
2, how to set the WebLogic hot start Mode (development mode) and product release mode?
You can modify the startup mode of the corresponding server in the admin console for one of the development or product models. or modify the service
Startup file or commenv file, add set Production_mode=true.
3, how to start without entering a username and password?
Modify service startup files to add Wls_user and WLS_PW entries. You can also add in the Boot.properties file
The user name and password that have been encrypted.
4, in the WebLogic Management console for an application domain (or a Web site, domain) for JMS and EJB or
The connection pool and other related information to configure, actually save in what file?
stored in the Config.xml file in this domain, it is the core configuration file for the server.
5, talk about a domain in the WebLogic default directory structure? For example, to put a simple helloworld.jsp
In what directory, but in the browser can be into the http://host: port number//helloword.jsp can see the results of the operation? And for example, what do you do with a javabean that you write?
Domain directory/server directory/applications, put the application directory in this directory will be available as an application access
, if the Web application, the application directory needs to meet the requirements of the Web application directory, JSP files can be directly placed in the application directory
, JavaBean needs to be placed in the classes directory of the Web-inf directory of the application directory, and the default should be set for the server
Use will be implemented on the browser without entering the application name.
6. How do I see the EJB that has been published in WebLogic?
You can use the Admin console to view all published EJBS in its deployment
7, how to WebLogic in the SSL configuration and client authentication configuration or say Java (standard) for SSL configuration
SSL is implemented using DEMOIDENTITY.JKS and Demotrust.jks KeyStore in the default installation and requires configuration services
Using enable SSL to configure its ports, you need to obtain private keys and digital certificates from the CA in product mode, creating
Build identity and trust KeyStore, mount the acquired key and digital certificate. You can configure this SSL connection to be one-way
or bi-directional.
8. Which configuration files should be involved in publishing EJB in WebLogic
Different types of EJB-related configuration files are involved in a configuration file that includes
EJB-JAR.XML,WEBLOGIC-EJB-JAR.XMLCMP entity beans typically also require
Weblogic-cmp-rdbms-jar.xml
9, EJB need to directly implement its business interface or home interface, please brief reasons.
Remote interface and home interface do not need to implement directly, their implementation code is generated by the server, program running
The corresponding implementation class is used as an instance of the corresponding interface type.
10, talk about the difference between persistent and non-persisten when developing a message bean in WebLogic
Persistent MDB can guarantee the reliability of message delivery, that is, if there is a problem with the EJB container, the JMS service
The service will still send the message when this MDB is available, and the non-persistent message will be lost.
Abandon.
11. What are some of the common patterns in Java EE that you know or have heard about? and some ideas about design pattern
Session façade pattern: using Sessionbean to access Entitybean
Message façade pattern: implementing an Asynchronous call
EJB command pattern: Use command JavaBeans instead of Sessionbean for lightweight access
Data Transfer Object Factory: Simplifies Entitybean with DTO Factory features
Generic Access: Simplifies Entitybean data-delivery features via the Attibuteaccess interface
Business Interface: Implementing the same interface specification with the remote (local) interface and the Bean class is consistent with business logic
Of
The design of EJB architecture will directly affect system performance, scalability, maintainability, component reusability and
Development efficiency. The more complex the project, the greater the project team, the greater the importance of good design.