Recently the company project in the OpenFire above the problem chase is very tight, are others willing to rest bones, not without data, is a long history of design mistakes, take openfire, people openfire clearly is username only, but, ya, the company is to make a not unique , then get an ID field, resulting in a message, and get a picture of the problem, ah, bitter openfire i ah, complain to send to this bar, because debugging code is a thankless thing, also add the company progress to finish on time, so in the home computer installed a openfire, Before in the company more or less not from scratch, now from scratch, and recorded, convenient for later use (AH ~ ~ ~ 11 points more, tomorrow Saturday but to open a morning meeting, Wash and sleep, and then write tomorrow)
First, we want to prepare some of the tools we need:
1, MyEclipse, I use 2013 and a half;
2, OpenFire of the source package
Download Address: OpenFire
In this can find OpenFire source package openfire_src_3_9_3.zip download;
3, OpenFire need the jar package, click to download, these jar package can solve some of the problems of importing engineering errors, I do not know why openfire less of these packages.
OK, it's all ready, start working.
First, unzip the download good OpenFire source code, and processing
I downloaded a good source package name is: Downloadservlet, after decompression 135.8MB, and only a folder named Openfire_src, look at the underline uncomfortable, I changed it to OpenFire. Open folder will have 3 HTML pages, see the content is the update log, self-description of what, delete.
So we have the build, documentation, resources, SRC these four folders, open the Build folder, open the Eclipse folder, and to copy the files and folders into the OpenFire directory, So we have five folders and a file, as shown below:
(See the directory structure ah ....) )
It's not enough, because MyEclipse still can't identify the folder OpenFire as a project, next we need to find an existing Java project, Copy the. classpath and. project files to the OpenFire folder under the root directory, and then copy the contents of the Classpath file to the. classpath (' point ' classpath)
In and save, Copy the contents of the project file into the. project file and save it, and then delete the files without the dots. Classpath and. Project, this is to let MyEclipse identify OpenFire file is a Java project, because we can not easily OW create a start for '. ' File, you can only copy the existing file replacement content.
We then open the jar package needed by OpenFire, where Bouncycastle.jar is copied to the Openfire\build\lib\dist directory, and the remaining jar packages are copied to the Openfire\build\lib directory.
OK, the source of processing to this end, below we can openfire import into the myeclipse.
Second, import OpenFire source code to MyEclipse
Put OpenFire into the MyEclipse, oh, there is a red fork, right, no red fork on the accident, first, regardless of the Red fork, we open the project under the Build/lib directory, found that we copied into the Lib jar package is not imported into the project:
OK, the right mouse button did not import the jar package, choose Build Path, click Add to Build Path, respectively, the import of these packages, the project after the import of the fork in a few moments less
Next we resolve the remaining errors:
There are two class errors in this package, and the solution is to implement an interface method that is not implemented.
After realizing the method, Sipmanager.java servertransaction.sendresponse (notimplemented); This code error, through the MyEclipse automatic repair, plus try-catch catch exception can be.
There's only one mistake left in this project: Src/java/org/jivesoftware/util/certificatemanager.java
which
1, asn1encodable o = Othernameseq.getobjectat (1), error, change to asn1encodable o = (asn1encodable) othernameseq.getobjectat (1);
2, Deros.writeobject (Csr.toasn1primitive ()); error, change to Deros.writeobject (Csr.toasn1object ());
3, Generalnames subjectaltnames = new Generalnames (new Generalname[]{othernamegn}); error, change to generalnames subjectAltNames = New Generalnames (OTHERNAMEGN);
This way, all the red forks are gone and can be compiled.
Third, compile OpenFire:
Click Windows, Show View, ant, select Add Buildfiles in ant, select the Build.xml in the build directory, and then OK
Then run Build.xml
Start compiling, wait a little to show the build successful, that is, the compilation is successful.
Four, configure OpenFire source code and run:
Select the item and click Run Configurations.
1. Main label
2. Arguments label
The VM arguments is populated with-dopenfirehome= "${workspace_loc:openfire}/target/openfire" where the first OpenFire is your project name, If your project is called Openfirexxoo, fill it out here.
-dopenfirehome= "${workspace_loc:openfirexxoo}/target/openfire"
3. Classpath Label:
After selecting user entries, click Advanced ... on the right.
Then click OK
Select SRC under i18n and resources file, and click OK
4. Common label
After the configuration is complete, commit, and run
Console display
This allows us to access http://127.0.0.1:9090 through the browser to enter the OpenFire background for the server, language and other initial configuration.
About the startup, and configuration errors please see the next "OpenFire Error and processing method"
Finally said a little off-topic, openfire I in three computer installed not less than 20 times, all kinds of problems, so I can not successfully install, just contact OpenFire at that time very annoying, again and again by the press, but this time, I installed a good, so, do the programmer, relax the mentality, gently loose
2015-10-27 Update
Added 3.10.2 version of Source deployment, address: http://blog.csdn.net/yezis/article/details/49433669