brachat The latest version of the Java Business Server supports the Java Web container deployment approach, and our SDK package (Brachat for Windows SDK, brachat for Linux SDK) also provides the corresponding Java Web project, The path to the project is SRC\SERVER\JAVA\BRACHAT4SPRINGMVC.
The following is an example of the BRACHAT4SPRINGMVC project, which describes how Java Web containers are deployed.
1, download and install Tomcat, and according to different platform to do the corresponding configuration.
2. Download and install MyEclipse and integrate the installed Tomcat into the MyEclipse
3, the BRACHAT4SPRINGMVC project into the MyEclipse. The BRACHAT4SPRINGMVC project uses the Spring 3.0.5 framework, which requires manual addition of the spring 3.0.5 Framework's library files and Commons-logging.jar files. The Spring 3.0.5 Framework library file can be downloaded to the Spring official web site.
4. Deploy the BRACHAT4SPRINGMVC project to Tomcat.
5. If you are deploying on Windows, put the two library files BRAchatserver4java.dll, BRAChatServerSDK.dll required by the Java Business Server into the Tomcat bin directory, for example D:\ Program Files\apache-tomcat-6.0.35\bin. and add the Tomcat Bin directory to the system PATH environment variable:
- Set path= "D:\Program files\apache-tomcat-6.0.35\bin";%PATH%
Copy Code6. If you are deploying on Linux, you need to place the two library files libanychatserver4java.so and libanychatserversdk.so required by the Java Business Server under the Lib directory of the JRE, for example/usr/ Work/java/jdk1.6.0_21/jre/lib, and add the lib of the JRE to the system ld_library_path environment variable:
- Export Ld_library_path=/usr/work/java/jdk1.6.0_21/jre/lib: $LD _library_path
Copy Code7. Start Tomcat so that the Brachat Business Server is loaded with Tomcat. If the console view of MyEclipse displays the following log:
- V4.8 Build time:oct 17 2013 11:55:04
- 11-20 15:14:48:953 Connect anychatcoreserver successed!
Copy Codeindicates that the Brachat Business Server started successfully.
code Description: There are two points to note in the Java Web project of the standard J2SE project, which translates to EE:
after initializing the SDK in a, J2SE project, the Brachatverifyuseroutparam class needs to be registered, and the calling code is as follows:
- Anychatserver. INITSDK (0); Initializing the SDK
- Anychatserver. Registerverifyuserclass (New Anychatverifyuseroutparam ());
Copy CodeB. Import the two packages of the J2SE project into the Web project, and then add the following configuration in the servlet configuration file:
- <bean id= "Anychat" lazy-init= "false" class= "Com.bairuitech.server.BusinessServer" init-method= "Initsdk"/>
Copy Code
This allows the Brachat Business Server to load with Tomcat.
Note: currently only Linux version of the SDK to support the 64bit Java environment, Windows temporarily support 32bit Java client;
Audio and video development platform Java Web service server