Research on blazeds-build the blazeds application environment under flashbuilder

Source: Internet
Author: User
Tags apache tomcat
Introduction to blazeds:


Blazeds is a server-based Java Remote Control (remoting) and web message transmission (messaging)
Technology, which is published in the lgpl (lesser GNU Public License) Public License. It enables back-end Java applications and
Adobe Flex applications communicate with each other. On the Java application server, it exists as a servlet, so it can be used in any standard Java network application.


Development Environment:

IDE:
Eclipse-jee-galileo-SR1-win32.zip

Flashbuilder4 beta2 release

Release environment: xampp-win32-1.7.3
+ Tomcat 6.0.20 (XAMPP for Windows Add-ons)




SVN tools:
Subclipse 1.6

Blazeds:
SVN zeds SVN address




PS:
Because it is development, the J2EE version developed using eclipse Java is slightly larger, but it is relatively comprehensive, and then it is not all manually configured for Apache MySQL
XAMPP is used instead of Tomcat.
This integrated environment saves a lot of trouble for building a development environment. In addition, the source code on the Svn of blazeds is used for personal research. If the source code is used officially, the tested source code can be used.
Turkey version.
PS: Let's talk about the folder for the blazeds under SVN. What we will use is probably
Apps/samples, which must be run under Tomcat
Apps/samples/WEB-INF/flex-Src here is the client source code
Apps, samples, and SRC are the source code of the corresponding server.
Modules this is the JAVA Implementation class that blazeds provides messaging and remoting functions.
Lib. Some jar packages compiled in modules will also be output here.
Sampledb is the data used in the example, But I replaced it with MySQL (in XAMPP) out of habit)
Servers can run Tomcat independently, but I also plan to use XAMPP to integrate tomcat, so I didn't plan to use this
Other big-use scenarios are not supported.
This SVN has many things and is on foreign websites. Therefore, if the network is poor, the first download requires a little patience.


Procedure:


1. Install JDK, decompress eclipse, install flashbuilder4 beta2, and so on, same as the flexbuilder installation steps. Note: I use
The Eclipse plug-in version of flashbuilder4 is designed to use Java development functions of J2EE.


2. It is also easy to configure tomcat. Decompress XAMPP, decompress Tomcat of add-ons into the xammp directory, and then start
After XAMPP, Tomcat will be OK, which is so simple.

Of course, our purpose is to debug the content of blazeds under eclipse, so this is not enough.
3,
Compile the Java code in modules. A total of five packages, common, core, opt, proxy, and remoting, need to be compiled.
Build. xml. Normally, you can select this XML anti-key and compile it with ant. If this is the first time you compile Java in this way, the compilation may fail depending on your environment.
It's not that difficult. It can be solved by Google or Baidu.
4. The topic is coming soon. There are so many things in front of the topic to build an environment where blazeds can run. Take the samples provided by Adobe as the standard, and we will succeed when we try to make samples run.
So I created a dynamic Web named myblazeds.
Project (Dynamic Web project), copy the Java source code in samples to the SRC folder here, and copy the folder about the WEB-INF, which is mostly some configuration
Tomcat starts its web service through these configuration files. Basically, you don't need to change it.
Then create a lib folder in the WEB-INF in myblazeds, copy the jar package compiled earlier, and also need a logging jar package, and
Jar of MySQL connector, which is generally used in Java, cannot be searched on the Internet. In addition, I also put
Both commons-codec and common-httpclient are copied. This is basically all done. To use MySQL, The connectionhelper in Java source code of samples needs to be changed to class. forname ("com. mySQL. JDBC. driver "); url =" JDBC: mysql: // localhost: 3306/blazedsdb? "+" User = root "; the URL will be a little different depending on your MySQL configuration. Because HSQLDB is used, some java code needs to be modified after it is changed to MySQL. For example, resultset rs = s.exe cutequery ("Call identity ()") in create in productservice ()"); you need to change it to resultset rs = s.exe cutequery ("select last_insert_id ()"); just remove the comment.
Below this step is a little troublesome, Java source file is not available, need to compile the support class file, and put it in the WEB-INF directory. Therefore, you need to create a build. xml file.
I Understand Java only. So take the existing build in blazeds. XML file according to the gourd painting done a, there is no problem found at present after the build is successful will be in the WEB-INF directory more than a flex directory, there is a class file, and at the bottom of the compiling environment of javaee, there will be a Server Tab page. If not, you can call it in Windows-> show view. In server, the new server interface is as follows: it will require setting the Tomcat path:
You also need to add the current project to the Tomcat Service
Finally, when the server is run, the dynamic web page project we created will automatically run. In addition, I encountered the following problems:
Org. Apache. Catalina. Core. aprlifecyclelistener init

Information: the Apache Tomcat native library which allows optimal performance in production environments was

Not found on the java. library. path: C:/Java/JRE/bin ;.; c:/Windows/Sun/Java/bin; C:/Windows/system32; C:/Windows

For this error, you only need
Http://tomcat.heanet.ie/native/
Download compiled
Tcnative-1.dll
File, which is currently the latest
1.1.14,
Copy
JDK/bin
And then start the instance.
APR
.





5. Establish a flex project connection to blazeds

You can select any flex source code in samples to create a flex project. Note that you must select J2EE as the application server type during the Project Creation and then click blazeds,

The specific settings are as follows:



Finally, run flash. Note: Create a database table for MySQL. The required fields can be found in the source code of Java.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.