CN101344858A - J2EE engineering deploying method and device - Google Patents

J2EE engineering deploying method and device Download PDF

Info

Publication number
CN101344858A
CN101344858A CNA200810146608XA CN200810146608A CN101344858A CN 101344858 A CN101344858 A CN 101344858A CN A200810146608X A CNA200810146608X A CN A200810146608XA CN 200810146608 A CN200810146608 A CN 200810146608A CN 101344858 A CN101344858 A CN 101344858A
Authority
CN
China
Prior art keywords
engineering
server
path
load path
catalogue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA200810146608XA
Other languages
Chinese (zh)
Inventor
徐新杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENZHEN KINGDEE MIDDLEWARE CO Ltd
Original Assignee
SHENZHEN KINGDEE MIDDLEWARE CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN KINGDEE MIDDLEWARE CO Ltd filed Critical SHENZHEN KINGDEE MIDDLEWARE CO Ltd
Priority to CNA200810146608XA priority Critical patent/CN101344858A/en
Publication of CN101344858A publication Critical patent/CN101344858A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a method and a device for engineering deployment. The method comprises the steps of acquiring the class loading path of a server and adding the class loading path of the server into the class loading path of engineering. The device comprises an acquiring unit used for acquiring the class loading path of the server and a loading unit used for adding the class loading path of the server into the class loading path of the engineering. The embodiment of the invention can finish engineering compilation in practical application environment by directly adding Jar packets contained in the server class path into the engineering compilation path, thereby solving the problem of abnormal operation of the engineering caused by the confliction of the Jar packets.

Description

The method and apparatus that a kind of J2EE engineering is disposed
Technical field
The present invention relates to computer application field, be specifically related to the method and apparatus that a kind of J2EE engineering is disposed.
Background technology
In the performance history of J2EE (Java 2 Platform, Enterprise Edition, Java 2 Platform Enterprise Edition) engineering, often the engineering department of exploitation need be deployed on the application server, two kinds of dispositions methods are arranged usually.First kind is at Integrated Development Environment (Integrated development environment, IDE) in engineering is exported as EAR (Enterprise Application aRchive), the WAR archive format such as (WebApplication aRchive) of standard, manually these archive files are copied under the application deployment catalogue of application server again, restart this server with registration this project in application server and configuration this project operation resource needed, promptly load this engineering.Second kind is after having specified server, automatically in the newly-built catalogue of IDE as virtual server, and the configuration file of server is copied in the catalogue corresponding under this virtual server.When redeploying, the developer automatically engineering is packaged into archive format such as EAR, WAR when using, and be copied in the deployment catalogue corresponding under the virtual server, use the configuration information in the virtual server then and dispose catalogue and restart specified server and load this engineering, as the support of the wtp engineering below the eclipse the tomcat server disposition.
In research and practice process to prior art, the present inventor finds that there is following problem in prior art:
In above-mentioned two kinds of dispositions methods, Jar (Java Archive File, the Java history file) bag all is to leave in the server category path of actual application environment, invisible in IDE, so, in order to make the engineering compiling success, then need manually the Jar bag to be joined the compiling path of engineering, perhaps utilize developing instrument among the IDE to dispose corresponding Jar and wrap the engineering compiling path, but the Jar bag that application server manufacturer provides in the Jar that generates in IDE bag and the actual application environment is not just the same, therefore, the situation that causes engineering normally not move the Jar packet conflict appears probably and.
Summary of the invention
The technical matters that the embodiment of the invention will solve provides the method and apparatus that a kind of J2EE engineering is disposed, and makes the situation that causes engineering normally not move because of the Jar packet conflict no longer to occur.
For solving the problems of the technologies described above, embodiment provided by the present invention is achieved through the following technical solutions:
The method that a kind of J2EE engineering is disposed: the class load path that obtains server; The class load path of described server is joined in the class load path of engineering.
Preferably, described class load path with described server also comprises after joining in the class load path of engineering: with described engineering compiling to a catalogue; Described catalogue is joined in the application register-file of described server.
Preferably, described described engineering compiling is specially to a catalogue: described engineering is compiled into a catalogue automatically.
Preferably, the described class load path that obtains server is specially: after with engineering and server binding, obtain the class load path of server.
Preferably, describedly engineering is compiled into a catalogue automatically is specially: utilize J2EE Builder to compile engineering automatically to the next collapse directories of engineering.
The device that a kind of J2EE engineering is disposed comprises: acquiring unit is used to obtain the class load path of server; Loading unit, the class load path that is used for described server that acquiring unit is obtained joins in the class load path of engineering.
Preferably, described device also comprises: compilation unit is used for loading unit has been loaded the described engineering compiling in path to a catalogue; Use registering unit, be used for the described catalogue of compilation unit compiling is joined the application register-file of described server.
By technique scheme as can be seen, the embodiment of the invention is by directly joining the Jar bag that comprises in the server category path in the compiling path of engineering, in actual application environment, finish engineering compiling, solved the problem that causes engineering normally not move because of the Jar packet conflict.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the method flow synoptic diagram of the embodiment of the invention one;
Fig. 2 is the method flow synoptic diagram of the embodiment of the invention two;
Fig. 3 is the structural representation of embodiment of the invention device.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The embodiment of the invention is finished engineering compiling by directly Jar bag in the server category path being joined in the compiling path of engineering in actual application environment, solved the Jar packet conflict and the problem that causes engineering normally not move.
Embodiment one, see also Fig. 1, Fig. 1 is the method flow synoptic diagram of the embodiment of the invention.
Step 101: the class load path that obtains server;
In fact the class load path is exactly the path that the Java actual application environment loads the Jar bag, and the class load path that obtains server can obtain the Jar bag by the server category path.
Can obtain the class load path by the technical manual of server, server can be bound in advance.
Step 102: the class load path of described server is joined in the class load path of engineering.
The class load path of described server is joined after the class load path of engineering, the Jar bag that the Java actual application environment of compiling engineering just can comprise by the class load path load server of engineering, like this, then by directly utilizing Jar bag in the practical application server to avoid Jar packet conflict problem in the engineering operation process, thereby make and the situation that causes engineering normally not move because of the Jar packet conflict no longer occurs.
Prior art needs manually archive file to be copied under the application deployment catalogue of application server, restart this server then and load this engineering, the embodiment of the invention also proposes engineering compiling to be joined in the application register-file of server, following examples two describe in detail in conjunction with Fig. 2, and Fig. 2 is the schematic flow sheet of the embodiment of the invention two.
Embodiment two,
Step 201: the server of specifying engineering to bind.
When new construction, specify the binding of a server and engineering, just can directly wrap the jar in the server in the compiling path of adding engineering to finish compiling.
Step 202: the class load path that obtains server.
In fact the class load path is exactly the path that the Java actual application environment loads the Jar bag, and the class load path that obtains server can obtain the Jar bag that is placed in the server by the path,
General Jar literature kit has comprised an independent .class file that is compiled into by each independent class Class and interface Implements according to certain structure, may comprise the path of a lot of Jar bag in the class.path, may be such such as being provided with of class.path: C: dev1.jar; C: dev2.jar; Just can be loaded into the .class file that these two Jar of dev1.jar and dev2.jar comprise in wrapping under the C packing catalogue according to this class.path when the Java actual application environment like this.
Can obtain the class load path by the technical manual of server, server can be bound in advance.
Step 203: the class load path of described server is joined in the class load path of described engineering.
The class load path of described server is joined after the class load path of described engineering, the Java actual application environment of compiling engineering just can load the bag of the Jar in the server category path, like this, just by directly utilizing the Jar in the practical application server to wrap the Jar packet conflict problem of having avoided in the engineering operation process.
Step 204: with engineering compiling to a catalogue.
Can engineering be compiled into a catalogue automatically by J2EE Builder, this catalogue can be a collapse directories, does not influence the realization of the embodiment of the invention.
Step 205: described catalogue is joined in the application register-file of described server.
Described catalogue is joined in the application register-file of described server, server just can be after project file be being revised, directly reload new compiled file, and avoided frequent debugging of the prior art, redeploy application, manually copy archive file to trouble parts such as application servers.
The embodiment of the invention has increased on the basis of embodiment one engineering has been compiled into a catalogue automatically, and described catalogue is joined step in the application register-file of described server, not only avoided the problem of Jar packet conflict, and make server can directly reload new compiled file, simplify engineering and disposed flow process.
Embodiment three is the instantiation in the actual application environment, is that example is elaborated with the EAR engineering.
Embodiment three,
Step 301: newly-built EAR engineering.
The EAR engineering of newly-built DEMO by name
Step 302: specify server with the engineering binding.
Be called with the name of the server of DEMO engineering binding: Apusic-5.1.
Step 303: the class load path that obtains server.
The class load path that obtains server according to the technical manual of server is :/home/dev/Apusic-5.1/domain/mydomain.
Step 304: the class load path of described server is joined in the class load path of engineering.
Class load path/the home/dev/Apusic-5.1/domain/mydomain of the server that step 303 is obtained joins in the class load path of engineering, wraps comprising Jar such as javaee.jar, jsf-api.jar, elite-api.jar.
Step 305: engineering is compiled into a catalogue automatically.
Engineering is compiled into catalogue automatically: in/the home/dev/workspace/DEMO/.explodedEar.
Step 306: described catalogue is joined in the application register-file of described server.
With step 305 with engineering compiling to catalogue/home/dev/workspace/DEMO/.explodedEar join in the application register-file of described server.
The key code that uses in the embodiment of the invention is specific as follows:
// following code is finished the engineering corresponding server information that obtains
…………
String?defautlDomain=path.lastSegment();
ServerEntry?entry=ServerStore.getInstance().getEntryBy(entryName);
if[entry==null)return;
IDomain?domain=entry.getDomain(defautlDomain);
if(domain!=null)server=domain.getServer();
…………
protected?void?initialClasspathEntries(){
if(server!=null
&&server.getDomain()!=null
&&!server.getDomain().isRemote()){
// following line code invoking server interface is obtained the class.path of server
String?classpath[]=((ILocalServer)server).getClasspath()
List?entryList=new?ArrayList()
// following one section circulation is finished and is added the Jar in server category path bag in the class.path of engineering function
for(int?i=0;i<classpath.length;i++){
File?file=new?File(classpath[i]);
if(file.isDirectory()
&&file.exists()
&&javaProject!=null){
IProject?project=javaProject.getProject()
if(project.isAccessible()){
String?classPathName=(new
Path(classpath[i])).lastSegment();
IFolder?folder=project.getFolder(classPathName!=null?
(new
StringBuilder(″apusic″)).append(classPathName).toString():
″″);
IPath?folderRawPath=folder.getRawLocation();
IPath?classPath=new?Path(classpath[i]);
if(!folder.isAccessible()
‖!folder.isLinked()
‖!classPath.equals(folderRawPath)){
folder.createLink(new?Path(classpath[i]),256,new
NullProgressMonitor());
entryList.add(newLibraryEntry(folder.getFullPath()));
}
}else{
entryList.add(newLibraryEntry(new?Path(classpath[i])))
}
}
entries=(IClasspathEntry[])entryList.toArray(new?IClasspathEntry[0]);
return;
}else{
entries=new?IClasspathEntry[0];
return;
}
}
……
The code of obtaining the collapse directories of appointment under the engineering is:
IFolder?earExplodedFolder=
ApusicCore.getApusicProject(getProject()).getExploded();
// obtain the collapse directories (J2EEBuilder will compile engineering catalogue so far) of appointment under the engineering
…………
IFolder?srcFolder=null
IFolder?destFolder=null
IFolder?destImportedClassesFolder=null
…………
Need to prove, for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, can be referring to the associated description of other embodiment.
The device that the method that more than provides a kind of J2EE engineering to dispose, the embodiment of the invention also provide a kind of J2EE engineering to dispose.
The device that a kind of J2EE engineering is disposed, referring to Fig. 3, Fig. 3 is the structural representation of embodiment of the invention device, described device comprises:
Acquiring unit 301 is used to obtain the class load path of server;
Loading unit 302, the class load path that is used for described server that acquiring unit 301 is obtained joins in the class load path of engineering, makes engineering can directly utilize the Jar bag in the practical application server.
The device that described J2EE engineering is disposed also comprises:
Compilation unit 303, the described engineering compiling that is used for loading unit 302 has been loaded the path also can be compiled into a catalogue with described engineering automatically to a catalogue, can be collapse directories;
Use registering unit 304, be used for the described catalogue of compilation unit 303 compilings is joined the application register-file of described server, make server can directly reload new compiled file.
Get access to the class load path of server at acquiring unit 301 after, loading unit 302 joins the class load path of the described server that acquiring unit 301 obtains in the class load path of engineering, makes engineering can directly utilize the Jar bag in the practical application server; Compilation unit 303 to a catalogue or after being compiled into a catalogue automatically, is used described engineering compiling registering unit 304 described catalogue is joined in the application register-file of described server, makes server can directly reload new compiled file.
The embodiment of the invention is finished engineering compiling by directly the Jar bag that comprises in the server category path being joined in the compiling path of engineering in actual application environment, solved the Jar packet conflict and the problem that causes engineering normally not move.
The embodiment of the invention also can be compiled into a catalogue automatically with engineering, and described catalogue is joined step in the application register-file of described server, not only avoided the problem of Jar packet conflict, and made server can directly reload new compiled file, simplified engineering and disposed flow process.
The present invention can be used for numerous general or special purpose computingasystem environment or configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, the system based on microprocessor, set top box, programmable consumer-elcetronics devices, network PC, small-size computer, mainframe computer, comprise distributed computing environment of above any system or equipment or the like.In addition, the present invention can also describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in distributed computing environment, put into practice the present invention, in these distributed computing environment, by by communication network connected teleprocessing equipment execute the task.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
More than a kind of J2EE engineering is disposed to the embodiment of the invention provided method and apparatus be described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (7)

1, a kind of method of J2EE engineering deployment is characterized in that:
Obtain the class load path of server;
The class load path of described server is joined in the class load path of engineering.
2, the method for J2EE engineering deployment according to claim 1 is characterized in that:
Described class load path with described server also comprises after joining in the class load path of engineering:
With described engineering compiling to a catalogue;
Described catalogue is joined in the application register-file of described server.
3, the method for J2EE engineering deployment according to claim 2 is characterized in that:
Described described engineering compiling is specially to a catalogue: described engineering is compiled into a catalogue automatically.
4, the method for J2EE engineering deployment according to claim 1 and 2 is characterized in that:
The described class load path that obtains server is specially: after with engineering and server binding, obtain the class load path of server.
5, the method for J2EE engineering deployment according to claim 3 is characterized in that:
Describedly engineering is compiled into a catalogue automatically is specially: utilize J2EE Builder to compile engineering automatically to the next collapse directories of engineering.
6, a kind of device of J2EE engineering deployment is characterized in that, comprising:
Acquiring unit is used to obtain the class load path of server;
Loading unit, the class load path that is used for described server that acquiring unit is obtained joins in the class load path of engineering.
7, the device of J2EE engineering deployment according to claim 6 is characterized in that, also comprises:
Compilation unit is used for loading unit has been loaded the described engineering compiling in path to a catalogue;
Use registering unit, be used for the described catalogue of compilation unit compiling is joined the application register-file of described server.
CNA200810146608XA 2008-09-01 2008-09-01 J2EE engineering deploying method and device Pending CN101344858A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA200810146608XA CN101344858A (en) 2008-09-01 2008-09-01 J2EE engineering deploying method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA200810146608XA CN101344858A (en) 2008-09-01 2008-09-01 J2EE engineering deploying method and device

Publications (1)

Publication Number Publication Date
CN101344858A true CN101344858A (en) 2009-01-14

Family

ID=40246866

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA200810146608XA Pending CN101344858A (en) 2008-09-01 2008-09-01 J2EE engineering deploying method and device

Country Status (1)

Country Link
CN (1) CN101344858A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073512A (en) * 2009-11-23 2011-05-25 阿里巴巴集团控股有限公司 JAVA cluster application system code loading and upgrading device and method
CN105159982A (en) * 2015-08-28 2015-12-16 浪潮(北京)电子信息产业有限公司 Method and system for connecting DB2 databases in Unix operation system
CN107133055A (en) * 2017-06-07 2017-09-05 焦点科技股份有限公司 A kind of method that customized development is realized based on ClassLoader
CN108536449A (en) * 2018-03-30 2018-09-14 新华三大数据技术有限公司 Web projects dispositions method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073512A (en) * 2009-11-23 2011-05-25 阿里巴巴集团控股有限公司 JAVA cluster application system code loading and upgrading device and method
CN102073512B (en) * 2009-11-23 2014-07-16 阿里巴巴集团控股有限公司 JAVA cluster application system code loading and upgrading device and method
CN105159982A (en) * 2015-08-28 2015-12-16 浪潮(北京)电子信息产业有限公司 Method and system for connecting DB2 databases in Unix operation system
CN107133055A (en) * 2017-06-07 2017-09-05 焦点科技股份有限公司 A kind of method that customized development is realized based on ClassLoader
CN107133055B (en) * 2017-06-07 2020-04-24 百卓网络科技有限公司 Method for realizing customized development based on ClassLoader
CN108536449A (en) * 2018-03-30 2018-09-14 新华三大数据技术有限公司 Web projects dispositions method and device

Similar Documents

Publication Publication Date Title
US11467854B2 (en) Method and apparatus for loading multiple differing versions of a native library into a native environment
CN105657191B (en) Application increment upgrading method and system based on Android system
CN101470621B (en) Virtual machine configuration system
CN110727440B (en) Software packaging method
US8266588B2 (en) Creating projects in a rational application developer workspace
CN112189187B (en) Extensibility of unified platform
CN104731622A (en) Application program loading method and device and mobile terminal
CN101344858A (en) J2EE engineering deploying method and device
Halloway Component development for the Java platform
Kajtazovic et al. A component-based dynamic link support for safety-critical embedded systems
KR20130020135A (en) System and method of providing the developer list of developing code simultaneously in an integrated development environment
CN114816418A (en) Method, device, equipment and medium for building embedded operating system
EP2828746A1 (en) Methods of distributing a computer program product, and a computer system
CN114416219B (en) System function calling method, device, electronic equipment and readable medium
Dingare Preparing a Java API Project Using Maven
Onofré Mastering Apache Camel
Vermeir A Tour of. NET 6
McLay Lmod Tutorial
Mak J Mak NEMO notes
None FFTX
CN115202701A (en) Method, system, equipment and storage medium for generating patch
Aubert Quick Recipes on Symbian OS: Mastering C++ Smartphone Development
Wootton et al. Using Eclipse IDE
CN117389567A (en) Multi-terminal application development method, device, medium and equipment
Gregersen et al. Towards dynamic plug-in replacement in Eclipse plug-in development

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20090114