Apache, Tomcat, JBoss, WebLogic Four common Java EE servers

Source: Internet
Author: User
Tags event listener xml parser jboss jboss server tomcat server

Apache 's most widely used HTTP server in the world, free of charge, from the Apache fund
Tomcat app is also a very extensive web server, supporting part of the Java EE, free, from the Apache fund
JBoss Open source application server, more popular, free (documents to be charged)
Weblogic should be said to be the industry's first app server, all support j2ee1.4, for developers, there is free use of one-year license, use it more comfortable, financing BEA company

, oh, I use this is this, so more familiar with
JBoss also supports the Java EE
both JBoss and WebLogic contain JSP and servlet containers, and they can be web containers .
JBoss and WebLogic also contain EJB containers, which are complete Java EE application servers
Tomcat can only do JSP and Servlet container
First, Tomcat
The Tomcat server is a free open source Web application server, which is the Apache Software Foundation (Apache
software Foundation), a core project in the Jakarta Project by Apache, Sun, and other companies and
developed by people together. With Sun's involvement and support, the latest servlet and JSP specifications are always available in Tomcat
to the embodiment, Tomcat 5 supports the latest servlet 2.4 and JSP 2.0 specifications. Because Tomcat has advanced technology and stable performance
, and free, thus deeply loved by Java enthusiasts and has been recognized by some software developers, is now a more popular
WEB Application Server.
Tomcat is popular with programmers because it runs on small, scalable systems that support load balancing and email
services and other applications, and it continues to improve and improve, any programmer interested in
you can change it or add a new feature to it.
Tomcat is a small, lightweight application server that is commonly used in small to medium-sized systems and concurrent access users, not many occasions
use, is the first choice for developing and debugging JSP programs. For a beginner, it can be thought that when a machine is
The Apache server can be used to respond to requests for access to HTML pages. Actually TOMCAT part is Apache service
It is run independently, so when you run Tomcat, it actually acts as a separate
the process is run separately.
The trick here is that when configured correctly, Apache serves the HTML page, while Tomcat actually runs the JSP page and
Servlet. In addition, Tomcat, like IIS, Apache and other Web servers, has the ability to handle HTML pages, and it is also
a servlet and JSP container, and the standalone servlet container is the default mode for Tomcat. However, Tomcat handles static HTML
ability is inferior to Apache server.
Related connections:
Http://tomcat.apache.org/Tomcat Overview
Tomcat is a free open-source Serlvet container that is a core item of the Apache Foundation's Jakarta Project
developed by Apache,sun and other companies and individuals. With Sun's involvement and support, the latest
servlet and JSP specifications are always reflected in Tomcat. Tomcat was selected by the editor of Javaworld Magazine as the most innovative 2001
New Java products, it can be seen in the industry's position.
The latest version of Tomcat is 4.0x.4.0x and the 3.x architecture is different, but redesigned. A new tomcat4.0x is used in the
servlet Container: Catalina, complete implementation of the Servlet2.3 and Jsp1.2 specifications. Tomcat offers a variety of platform versions
for download, the source code version or the binary plate can be downloaded from http://jakarta.apache.org. Because of the cross-platform of Java
features, Java-based Tomcat also has a cross-platform nature.
Unlike a traditional desktop application, the application in Tomcat is a war (Web Archive) file. War is
A Web application format proposed by Sun, similar to a jar, is also a compressed package for many files. The files in this package press a
Directory structure: Typically, the root directory contains HTML and JSP files or directories containing both files, and
There is a web-inf directory, this directory is very important. Typically there is a Web. xml file and a classes under the Web-inf directory
directory, Web. XML is the configuration file for this application, and the classes directory contains the compiled servlet class and JSP or
other classes that the servlet relies on (such as JavaBean). Often these dependent classes can also be packaged into jars placed under the Web-inf
Lib directory, of course, can also be placed in the system of CLASSPATH, but that is not easy to transplant and management.
in Tomcat, the deployment of the application is simple, you just put your war into Tomcat's WebApp directory, Tomcat
automatically detects the file and extracts it. When you access the app's JSP in the browser, it's usually very slow for the first time,
because Tomcat is going to convert the JSP into a servlet file and compile it. After compiling, the access will be very fast. In addition Tomcat also mentioned
for an application: Manager, access to the application requires a user name and password, the user name and password are stored in an XML file
. With this app, you can deploy and revoke apps remotely through the Web, aided by FTP. Of course, local can also.
Tomcat is not just a servlet container, it also has the functionality of a traditional Web server: Working with HTML pages. But
compared to Apache, its ability to handle static HTML is inferior to that of Apache. We can integrate Tomcat and Apache into one piece,
let Apache handle static HTML, while Tomcat handles JSPs and servlets. This integration only needs to modify the Apache and Tomcat
configuration file.
In addition, Tomcat provides realm support. Realm is similar to the Group in Unix. In Unix, a group corresponds to the system
A group cannot access resources that do not belong to it. Tomcat uses realm for different applications (similar systems
resources) to different users (like group). Users without permissions cannot access the app. Tomcat offers three types of
Realm,1:jdbcrealm, this Realm will have the user information in the database, through JDBC to obtain user information to verify
. 2:jndirealm, user information exists in an LDAP-based server, and user information is obtained through JNDI. 3:memoryrealm
, the user information exists in an XML file, which is used by the manager application to authenticate users. Through Realm
we can easily authenticate customers who visit an app.
in Tomcat4, you can also take advantage of the event listener feature provided by Servlet2.3 for your application or session
implement monitoring. Tomcat also provides other features, such as integration with SSL into a piece, for secure transmission. And Tomcat also mentioned
for Jndi support, which is consistent with those provided by the Java EE Application Server. Speaking of which, we would like to introduce the usual
What is the difference between using a server (such as WebLogic) and Tomcat. The application server provides more features of the Java EE, such as EJB,JMS,
Jaas, and also support JSPs and Servlets. While Tomcat is less powerful, it does not provide support such as EJBS. But if
integrated with JBoss (an open source application server), you can implement the full functionality of the Java EE. Since the Application service appliance
with Tomcat's function, is there any need for Tomcat? In fact, many of our small and medium-sized applications do not require EJB
technology, JSP and servlet are enough, and if you use the application server it is a bit wasteful. and Tomcat is short and short, with
easy to meet our needs, in this case we will naturally choose Tomcat.
Tomcat-based development is primarily JSP and servlet development, and the development of JSP and servlet is very simple, you can use
Normal text editor or IDE, and then package it as a war. We're going to mention another tool here. Ant,ant also
is a subproject in Jakarta that implements functionality similar to make in UNIX. You need to write a build.xml file,
You can then run ant to do the work defined in the XML file, which is very good for a large application and we only
You can compile and package a war by writing very few things in XML. In fact, many application server publications include
Ant. In addition, in the Jsp1.2, you can use the tag library to implement the separation of Java code and HTML files, so that the maintenance of JSP more convenient
.
Tomcat can also be integrated with some other software for more functionality. As with the above mentioned JBoss integrated development
EJB, which integrates with Cocoon (another Apache project) to develop XML-based applications, and OPENJMS
integrated with the development of JMS applications, there are many more software that can be integrated with Tomcat, in addition to the few we have mentioned.
II. Jboss
JBoss is the result of a joint effort by developers around the world, a Java EE-based open source application server. Because the JBoss generation
code follows the LGPL license and you can use it free of charge in any commercial application without paying. JBoss supports EJB 1.1 and
the specification of EJB 2.0 EJB3.0, which is a container and server for managing EJBS. Similar to Sun's J2SDK Enterprise
Edition (Java ee), JBoss's goal is a source-code open Java environment. But the JBoss Core service is only providing EJB
server. JBoss does not include web containers for serverlers/jsp page, and can of course be used with Tomcat or jetty bindings.
JBoss also has the following six major benefits:
1, JBoss is free, open source Java EE Implementation, it is issued through the LGPL license.
2, JBoss needs less memory and hard disk space.
3, installation is very simple. Unzip the JBoss package file and configure some environment variables.
4, JBoss can be "hot deployment", deployment beans simply copy the bean's jar file to the deployment path. If not
Load it up and unload it if it's already loaded, then load the new one.
5, JBoss and the Web server run in the same Java virtual machine, the servlet call EJB does not go through the network, thereby greatly improving the operation
efficiency and improve safety performance.
6, users can directly implement J2ee-ear, rather than the previous implementation of Ejb-jar and Web-war respectively, very convenient.
the installation and configuration of JBoss can be copied directly, but changes to the%jboss-home%/bin/run.bat java-home
to the directory of the cost machine JDK. Run Run.bat to start JBoss
Turn off JBoss: Close JBoss DOS window or press "CTRL + C"
the directory structure of JBoss
1. Bin: Where to start and stop JBoss.
There are two main batch files: Run.bat and Shutdown.bat. To start JBoss, just execute the run.bat file
to stop JBoss, you must execute shutdown.bat.
Note that the Shutdown.bat file is executed directly and does not automatically stop JBoss, it must be input parameters, the parameter meaning is as follows:
h Display Help information; D set system properties;-stop processing option; s stop remote service specified with Jndi URL; n by making
jmx name to stop service; a remote service to a specified jndi name; specify user name; p specify user password; s stop
server, E-exit from virtual machine, H pause.
Generally, we use the S option to stop the server. That is, execute shutdown.bat-s.
2. Docs: Place JBoss example, test script and DTD for various script configuration files.
3. Lib: Some of the jar package files needed to place JBoss.
4. Client: Place the jar package required to run the EJB client.
5. Server: The files required to place the server-side EJB configuration for each startup type.
6. Backup
Service with 80 ports
Modify this file: {%jboss_home%}/server/default/deploy/jbossweb-tomcat41.sar/meta-
Inf/jboss-service.xml
after the "8080" configuration, add the following code
<!--A http/1.1 Connector on port
<connector classname= "Org.apache.coyote.tomcat4.CoyoteConnector"
port= "minprocessors=" 5 "maxprocessors= "
enablelookups= "true" acceptcount= "ten" debug= "0"
connectiontimeout= "20000" useurivalidationhack= "false"/>
restarting JBoss is OK.
JBoss Start-up process
Set environment variable Jboss_classpath (you can add your own security Manager and XML parser)
a)%jboss_classpath%;
b)%java_home%/lib/tools.jar;
c) Run.jar
D).. /lib/crimson.jar;
Set Startup Parameters Jaxp (XML parser and corresponding factory)
Start
Setting Configuration information
Read configuration file jboss.properties, saved in System Properties (system.properties)
Set default Properties Jboss.home and Java.security.auth.login.config
Create an instance of Mbeanserver.:
Specify the directory where the configuration files and patch files are located to the specific remote ClassLoader mlet
load the Save configuration file (Mlet will be automatically found in the configuration file directory)
Initialize and start the Mbean
Configure service Configurationservice
Load configuration file
Save Configuration
Service Control ServiceControl
Initialize the service program (init method)
Start the Service program (Start method)
publish files in JBoss
1. Making a war deployment file for JSP
using the "Jar CVF Hello.war index.jsp main.jsp" method, the index.jsp and main.jsp files are added to the
the Hello.war. Copy the generated Hello.war to the JBoss installation directory/server/default/deploy/, successfully deployed
. Use the two addresses "http://localhost:8080/hello/" or "http://localhost:8080/hello/index.jsp"
to test.
2. Making the war deployment file for the servlet
A, with "Javac-classpath"%classpath%;%jboss_home%
/server/default/lib/javax.servlet.jar the form "Helloworld.java" to compile Helloworld.java (this
is a servlet) get Helloworld.class
B. Write a Web. XML configuration File
The code is as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE Web-app
Public "-//sun Microsystems, INC.//DTD Web application 2.3//en"
"HTTP://JAVA.SUN.COM/DTD/WEB-APP_2_3.DTD" >
<web-app>
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>hello. Helloworld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/HelloWorld</url-pattern>
</servlet-mapping>
</web-app>
each tag must be lowercase, or an error will occur.
C, first set up a web-inf directory under C:/servlet, put the Web. xml file in the directory.
D. Create a classes directory in the Web-inf directory and put the compiled Helloworld.class file
E, executing jar CVF hello.war * * Under C:/servlet, a file named Hello.war is generated soon, and then
Copy the Hello.war to JBoss installation directory/server/default/deploy/to complete the deployment.
3, also can not pack, put the file under the same name under the Deploy folder can also. For example, the original is made into Hello.war text
, you can create a folder called Hello.war, and copy the files you want to publish to this directory and publish them as
Work .
Supplement
1. The default port for JBoss is 8080
3, for NT and Win2000 system if you want to install NT or Win2000 service, you can add JBoss to the system service, avoid
avoid running the Run.bat command every time you need to run to the JBoss directory, but automatically start the JBoss server when the system starts.
Third, WebLogic
WebLogic, a application server produced by Bea, is exactly a middleware based on the Java EE architecture,
webserver is the necessary software used to build a website to parse the publishing Web page, and it is developed in pure Java. WebLogic
It was not invented by Bea, it was bought from someone else's hands, and then processed to expand. Currently WebLogic in the world
The Application server market has the largest share, others like IBM's WebSphere, free tomcat, resin
and other middleware.
BEA WebLogic is a Java for developing, integrating, deploying, and managing large distributed Web applications, Web applications, and database applications
Application Server. Introducing Java's dynamic capabilities and Java Enterprise Standard security into the development and integration of large-scale network applications
, deployment, and management.
BEA WebLogic Server has the performance, scalability, and high availability required to handle critical Web application issues.
used in conjunction with the BEA WebLogic Commerce ServerTM, the BEA WebLogic server enables the deployment of adaptive
Sub-business application system to provide complete solutions.
BEA WebLogic Server has the many features and benefits needed to develop and deploy mission-critical e-commerce Web applications, package
including:
1) Leading standards
comprehensive support for multiple standards across the industry, including EJB, JSB, JMS, JDBC, XML, and WML, making Web application implementations more
simple, and protects the investment while also making it easier to develop standards-based solutions.
2) Unlimited scalability
BEA WebLogic Server is known in the industry for its highly scalable architecture, including the sharing of client connections, resources pooling
as well as * * pages and EJB component clusters.
3) Rapid development
accelerate your market with support for EJBS and JSPs, and the servlet component architecture of the BEA WebLogic Server
speed. These open standards, when combined with Webgain Studio, simplify development and give you the skills you already have to deploy quickly
application System.
4) More flexible deployment
the BEA WebLogic server is characterised by tight integration with leading databases, operating systems, and Web servers.
5) Mission-critical reliability
its fault tolerance, system management, and security can be verified in thousands of mission-critical environments worldwide.
6) Architecture
BEA WebLogic Server is specially developed for enterprise e-commerce applications. Enterprise E-Commerce application system needs to open quickly
and requires server-side components to be flexible and secure, while supporting the scaling,
performance, and high availability. BEA WebLogic Server simplifies the development of portable and extensible application systems and provides other applications
systems and systems provide a wealth of interoperability.
with its excellent clustering technology, BEA WebLogic Server has the highest level of scalability and availability. BEA
WebLogic Server implements both Web clustering and EJB component clustering without requiring any specialized hardware or operations
system support. A Web page cluster enables transparent replication, load balancing, and content tolerance, such as a web shopping cart; component clusters
handles complex replication, load balancing, and EJB component fault tolerance, as well as recovery of State objects such as EJB entities.
whether it's a Web cluster or a component cluster, the scalability and availability required for e-business Solutions are
It 's going to be. Shared client/server and database connections, as well as data caching and EJBS, enhance performance. This is not available in other Web application systems.

Apache, Tomcat, JBoss, WebLogic Four common Java EE servers

Related Article

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.