1, FACTORY-chase MM missed, please eat, McDonald's and KFC's wings are chicken wings MM favorites, although the taste is different, but whether you go to McDonald's or KFC with MM, simply said to the waiter "to 4 wings "on the line. McDonald's and KFC chicken wings is the production of the Factory. .
The factory pattern: the customer class and factory class. Consumers need a product at any time, simply by a request to the factory. Consumers do not have to modify to acceptance of new products. The disadvantage is that when the product is modified, the factory class has to be modified accordingly. Such as: how to create and how to provide to the client.
2, BUILDER-MM loved to listen to is "I love you" phrase, and see different parts of the MM, to be able to use their dialect, she said these words Oh, I have a multilingual translator, Each language has a button above to see MM I just press the corresponding key, it can use the appropriate language to say "I love you" phrase, and foreign MM can easily so much so, that is my "I love you" builder. (This must be better than the U.S. military in Iraq, will sell with the translator). .
The construction mode: the internal representation of the product and the product of the build process, thereby making a build process generates a different internal representation of product objects. The construction mode makes the product imagery can be independent of the changes, customer does not have to know the details of the product composition. The construction mode you can enforce a step-by-step construction process.
3, FACTORY METHOD-Please go to McDonald's hamburgers MM, different MM have different tastes, we should remember that each of them is an annoying thing, I generally use the Factory Method pattern, with MM to the waiter there, said, "to a hamburger, "specific to what kind of hamburger it, so that MM directly with the clerk says on the line. .
The factory method pattern: core factory class is no longer responsible for the creation of all products, but rather will specifically created to subclass, become an abstract factory role, only your factory class must implement the interface, but not in contact with which products should be materialized in such detail.
4, PROTOTYPE-use QQ to chat with MM must say some affectionate words, and I love to collect a lot of disgusting if necessary, as long as the copy out into the QQ which on the line, this is my prototype of Loving. (100 yuan a, you do not). .
The original model mode: by giving a prototype object to indicate the type of the object is created, and then copy the prototype object of the method creates more of the same type of object. The original model mode allows you to dynamically increase or decrease in product categories, product class does not need to have any predetermined hierarchy, the original model mode applies to any hierarchical structure. The disadvantage is that each class must be equipped with a clone method.
5, SINGLETON-6 I have a beautiful wife, they are my husband, my husband, our family Sigleton, they just said "husband" are referring to the same person, that is, I (just had a dream matter, how can there be such a good thing). .
Single-mode: single mode ensures that a class has only one instance, and to the instantiation and to the entire system provides the instance single-mode. Single-mode should only be a true "single instance" requirements is available.
[B: 9ceca65206] structure-based model [/ b: 9ceca65206]. .
6, ADAPTER — friends party encountered a beautiful Sarah, from Hongkong, I do not speak Cantonese, she doesn't speak Mandarin but to resort to my friend kent, as I and Sarah Adapter between me and Sarah can talk to each other (don't know if he would tease me).
Adapter (transformer) mode: the interface to transform a class into another client expect an interface, so that does not match the original reason for interfaces can not work with two classes to work together. Adapter class can return an appropriate instance of the parameters to the client. .
7, BRIDGE — morning encounter MM, to say good morning, night encounter MM, say good evening; met MM wearing new clothes, to say that your clothes are pretty well, meet new hairstyle MM, to say to your hair! Don't ask me "morning encounter MM new had a hair-how to say" this kind of problem, their combination with BRIDGE about not on the list.
Bridge Mode: the abstraction and implementation of decoupling, so the two can be independent of changes, that is the strong correlation between them becomes weak association, but also refers to a software system and implementation of abstraction between using the combination / aggregation, not inheritance, so the two can change independently. .
8, COMPOSITE — Mary birthday today. "My birthday that you want to send me a gift. "" Well, okay, go to the store, pick your own. "" This t-shirt is beautiful, buy, this skirt look good, buy it, this package is also good, buy it. "" Hey, bought three pieces, I promised to give a gift of the oh. "" What, t-shirt and dress plus bag is equipped with a Yes, Miss, trouble you. "" ... ", The Composite pattern MM are used, you will have no?.
Synthesis model: synthetic model objects organized into tree structure, can be used to describe the relationship between the whole and the part. Synthetic mode is a processing object of the tree structure model. Synthetic model the relationship between the part and the whole tree structure to reveal it. Synthesis model enables the client to a separate component objects and their complex formed by the synthesis of the object equally. .
9, DECORATOR — Mary coming round to Sarly birthday or not to call her own choosing, the team must play this month, took out my last year in photos at the top of the Hill, in the "best written on the back of your gift is love your Fita", and then into the street gift shop bought a photo frame (sell gifts that MM is also very pretty well), and then find the next engage art Mike designed a beautiful box with installation., we are the ultimate in Decorator, modified by me this, how to read and understand?.
Decorative pattern: decorative patterns to the client in a transparent manner on the expansion of the function object is an alternative to inheritance relations, offer more flexibility than inheritance. To an increase in dynamic object features that can then dynamically undo. Increase the number of permutations and combinations of basic functions arising from the very large number of features. .
10, FACADE — I've got an professional Nikon camera, I would like to own manual aperture, shutter, such as photographs only professional, but you can not understand these MM, taught half-day. Fortunately, the camera has the Facade design pattern, the camera automatically adjusts to the targeted, as long as the shutter on the line, all the camera automatically adjusts so MM can also be used with this camera to take photos.
Facade pattern: external communication with a subsystem must pass a unified facade object. Facade pattern provides a high-level interface, making subsystem easier to use. Only a facade for each subsystem category, but this facade is only one instance of the class, that it is a singleton pattern. But the whole system can have more than one facade class. .
11, FLYWEIGHT day send SMS with MM, fingers are tired, recently bought a new mobile phone, you can put some of the commonly used sentences there is a phone, to use when directly out in front of MM's name to send a longer word struck. Share of sentences is Flyweight, MM's name is extracted from the external characteristics, depending on the context of use.
Flyweight Pattern: FLYWEIGHT middle finger in the most lightweight boxing match. Flyweight pattern to share effective ways to support a large number of fine grained objects. Flyweight pattern can be shared key is to distinguish between state and foreign Yun intrinsic state. Intrinsic state is stored in the Flyweight internal, not with changes in the environment are different. Yun outside the state is with the changes in the environment and change. Yun outside the state can not affect intrinsic state, they are independent of each other. Will be able to share the state and can not share the state from the regular class distinction, will not be shared in the state removed from the class out.The client does not can directly create shared objects, you should use a factory object is responsible for creating shared objects. Xiangyuan mode substantially reduces the number of objects in memory.
12, PROXY-line chat with MM, one at the beginning of always "hi, hello," "Where did you come?" "How old are you?" "Height in it?" These words, really boring, write a program as my Proxy bar, all received these words are set up an automatic reply, when received and then notify the other if I answer, how, cool it. .
Proxy mode: proxy mode to a certain object provides a proxy object, and the proxy object control on the source object references. The agent is a person or organization on behalf of another person or a body action. In some cases, the customer does not wish to or cannot be a direct reference to an object, the proxy object can direct customers and the target object has played the role of an intermediary. The client can't tell Agent theme objects and real theme object. Agent model can not know the real proxy object, but only holds a proxy object interface proxy object this time was not able to create proxy objects proxy object must have a system on behalf of the other actors to create and pass. .
[B:9ceca65206] pattern [/b: 9ceca65206].
13, CHAIN OF RESPONSIBLEITY-night to go to English class, well bugger to sit the final in a row, wow, sitting in front of several beautiful MM hey, find piece of paper, write "Hi, my girlfriend can do ? If willing, please forward pass "piece of paper after another on a pass up, and worst, spread to the first row of the MM to note passed to the teacher, and I heard an old maid, hurry!. .
Responsibility chain mode: responsibility chain mode, many objects from an object to a reference under the family and received.
Together to form a chain. Transfer request in the chain until the chain decided to deal with a particular object to this request. Client does not know which of the chain end to handle the request object, the system can not affect the client's case dynamic re-organization chain and distribution responsibilities. Processors have two options: bear the responsibility or put the blame on to the next house. A request may ultimately not be accepted by any of the receiver object. .
14, COMMAND-I have a special tube MM home, unable to meet, but to help her brother in the transfer information between the two of us, she told me what they write a note to let her brother to me. This does not, her brother and transferring a COMMAND, to thank him, I asked him to eat a bowl of mixed puree with toasts, which know he said: "I give my sister three boy send COMMAND, you mean the number before me. ”, 。.
Command mode: command mode to a request or action package to an object. Command mode to issue commands to execute a command responsibility and the responsibility of separate, assigned to different objects. Command mode allows the requesting party and sent a party open to independent, making the requesting party need not know the party receiving the request interface, but do not know how the request was received, and whether the operation is execution, when executed, and how he has been the implementation of of. System supports the command's undo. .
15, I have an INTERPRETER — the bubble MM really ", there are various bubble mm Raiders, for instance, go to the food's steps, go to the cinema of methods, and so on, when the appointment with MM, just an Interpreter, according to the above script to execute on it.
Interpreter Pattern: Given a language, the interpreter mode can be defined by the grammar of a representation and to provide an interpreter. Clients can use this interpreter to explain the sentences in the language. Interpreter model will describe how to have a simple grammar, the use of models designed to explain these statements. In the interpreter mode which means that the language is the object of any interpreter to explain any combination thereof. In the interpreter mode, need to define a grammar of the order on behalf of the class hierarchy, which is a combination of rules.Each command object has an explanation of the method, the representative of the command object. The command object hierarchy of the object in any permutations and combinations are a language.
16, ITERATOR-I fell in love with Mary, desperate to propose to her. .
Mary: "want to marry you, I have promised my condition".
Me: "I promise what conditions, you talk." .
Mary: "I saw the carat of diamonds".
Me: "I bought, I bought, still available?." .
Mary: "I saw a lakeside villas".
Me: "I bought, I bought, still available?." .
Mary: "I like the Ferrari sports car".
Om bang my head, sitting on a chair, a bite: "I bought, I bought, still available?." .
…… 。.
Iterator pattern: iterator model can be gathered in order to access an element without having to expose the internal representation together. Multiple objects together to form a general called aggregation, aggregation object is able to accommodate a group of objects in the container object. Iterator mode iterative logic encapsulated in a separate sub-object, and thus separated itself with the gathering. Iterator model simplifies the aggregation interface. Each clustered object can have one or more of the iterator object, each iteration Iterative state can be independent of each other. Iterative algorithm can be independent of the changing role of aggregation. .
17, MEDIATOR — four MM to play mahjong, between whom and how much money should be given to who aren't clear, thanks to that, in accordance with their chips to count money, earn money from me, lost and paid me, everything is OK, I got four MM phone.
Mediator pattern: the mediator model packing a series of objects interacting manner, so that these objects do not have significant effect on each other. So that they can be loose coupling. When the role of certain objects is changed, will not immediately affect the other the role of some objects. To ensure that these functions can be independent of each other changes. Mediator-many interaction model will translate into one to many interactions. Mediator model the behavior of the object and collaboration abstraction, an object's behavior in small-scale interaction with other objects separately. .
18, MEMENTO — while chatting with a few MM, be sure to write clearly told MM said something, otherwise MM found will not be pleased of the well, fortunately I have a memorandum, which has just said what MM I copy one copy of the memorandum is saved so that you can view the previous record!.
Memorandum mode: Memorandum object is a object used to store another snapshot of the internal state of the object. Memorandum mode is intended to destroy the package, without condition, the state of an object caught, and externalization, stored, allowing the right time in the future to restore this object to the stored state. .
19, OBSERVER — want to know our latest MM intelligence? join the company's information mail group MM, tom is responsible for the collection of intelligence, he discovered a new intelligence without an informed us, directly to a mail group, we, as a Subscriber (Observer), you can receive timely information!.
Observer pattern: Observer pattern defines a dependency relationship between a team and more so in a number of observer objects while monitoring a subject object. Object in the state on the subject changed, will inform all the observer objects so that they can automatically update itself. .
20, STATE: when dealing with MM, it is important to note that her State Oh, in a different state of her conduct will be different, as you ask her to go to the movies tonight, you're not interested in MM would say "there are things like" you're not annoying but I haven't liked mm would say "Yes, but you can take my colleague?", is already like your MM would say "what time is it? read the film Let's go to bubble?" and, of course, you see the film performed well in the process, or you can leave the State never hate MM do not like to become like Oh.
State: state pattern allows an object to change its internal state when the behavioral change. The object is to change its look like the same class. State of the object model to study the behavior of the packaged object in different states, each state object is an abstract state class a subclass. State model is intended for an object when its internal state changes its behavior change. State models require a system may be made to each state to create a subclass of class status. When the system state changes, the system will change the selected sub-category. .
21, STRATEGY — with a different type of MM appointments, to use a different strategy, please film is better, but some are going to eat snacks, and some of the best romantic seaside, single-purpose get MM heart, my pursuit of MM in having a lot of Strategy tips, Oh.
Strategy pattern: Strategy Mode for a group of algorithms, each algorithm will be packaged with a common interface, independent of the class, which makes them interchangeable. Strategy lets the algorithm can not affect the client's circumstances change. Strategy pattern to separate the behavior and the environment. Environment class is responsible for maintaining and searching behaviors, the specific strategies of various algorithms to provide the class. As the algorithm and the environment independently from the algorithm change, modifications will not affect the environment and the client. .
22, TEMPLATE METHOD — read the how to persuade girls to bed on this classic article? girls to bed from recognizing the unchanging steps into Marian, break the deadlock, expand the pursuit, kissing, foreplay, hand and touch, in eight steps (Template method), but each step for different situations, there is not the same practices, this depends on your ear! (implementation).
Template Method Pattern: Template Method Pattern to prepare an abstract class, some of the logic as to specific methods and constructors in the form of specific implementation, and then declare some abstract way to force the remaining sub-class implements the logic. Different sub-classes can be different ways to achieve these abstract methods, which have different remaining logic implementation. First to develop a top-level logical framework, but will leave the details of logic to realize the specific sub-category. .
23, VISITOR — Valentine's day, to give each MM sent a bunch of flowers and a card, but each MM of flowers to her personal characteristics, each card also features according to the individual to pick, I know what makes, or looking for a florist shop boss and boss do about Visitor, so that the flower shop owner according to the characteristics selected MM a bouquet of flowers, gift shop boss according to each individual characteristics selected a card, this relaxed;.
Visitor pattern: the visitor pattern package aims to put in a data structure of some elements on the operation. Once these operations need to modify it, to accept the operation of the data structure can remain unchanged. Visitor pattern used in the data structure is relatively uncertain system, which the data structure and role in the structural coupling between the relief operation to open, making operation set can be relatively free of the evolution. Visitor pattern makes adding new operations become very easy, is to add a new visitor class. Model the behavior of visitors to the concentration of a visitor object, not spread to a one node class.When you use the visitor pattern, you want to add as much logic in the object browser to access the user class, not to its subclasses. Visitor mode can span several classes of the classification structure access belong to different classes of members of the hierarchical structure.
-------------。 .
1) Setting project property 。.
Right click. .
Path and Lib Path for the project, Lib defined here will be included in output jar / war / ear file. .
2) 。.
Right click WebModule of the project, then click build, choose build web archive. .
%20-%20End%20of%20the%20World%20Production,%20LLC.files/x37AD87.gif)
Java Data Structures (2nd edition)。.
home | services | products | resources | forum. .
home | services | products | resources | forum 。.
Pre-read. .
http://lab。.ac。.uab。.edu/vnet/cookbook/v2。.1/node167。.html#SECTION07431200000000000000。.
http://www. . Serverwatch. .com / tutorials / article. .php/1474461. .
IATA。.
T2005 Program. .
T2005 Deployment Manual。.
Version 0. .5 | 11-Nov-05. .
n。.
Mindtree Consulting Private Limited n www. . Mindtree. . Com. .
Revision History。.
Ver. .
Change Description。.
Sections. .
Date。.
Author. .
Reviewer。.
0. .5. .
Updated doc with Admin Commands and。.
others. .
All。.
08-Nov-2005. .
Prashanthjee。.S。.
0. .4. .
Update doc with ADS and ADAM related。.
information. .
07-Nov-2005。.
Harish. .
0. .2.
Updated doc with details regarding. .
installation and configuration of Apache Web Server and JBoss Application。.
Server. .
All。.
27-Oct-2005. .
Prashanthjee。.S。.
0. .1. .
Initial Draft。.
All. .
12-Oct-2005。.
Vinay Chandra G. . N. .
References。.
Target audience should read this. .
document in conjunction with the following documents。.
No. .
Document Name。.
Ver. .
Location。.
1. .
Table of Contents。.
Revision History. . 2. .
References。. 2.
Purpose of this document 5. .
Scope of this document 5。.
Definitions, Abbreviation and Acronyms. . 5. .
1 Introduction。. 6.
2 Apache Web Server and JBoss. .
Application Server Setup。. 6.
2. .1 Download the installable for Apache. .
Web Server 6。.
2. .2 Installation of Apache Web Server 6. .
2。.3 Configuration of Apache Web Server 7。.
2. .4 Startup of Apache Web Server 7. .
2。.5 Download the installable for JBoss。.
Application Server 8. .
2。.6 Installation of JBoss Application。.
Server 9. .
2。.7 Configuration of JBoss Application。.
Server 9. .
3 ADS/ADAM Setup (LDAP Schema) 10。.
3. .1 Configurations and Steps for. .
Authentication on ADS。. 10.
3. .2 Creating Schema on ADAM. . 14. .
3。.2。.1 Creating a new SNAPUSER。. 14.
3. .2. .2 Associating the user to. .
Security。.config。. 14.
3. .3 Configurations and Steps for. .
Authentication on ADAM。. 14.
3. .4 Changing settings for LDAP policy. . 17. .
4 Configuration of JBoss for T2005。. 18.
5 Deployment of T2005 Platform. .
Components。. 19.
6 Administration Commands. . 20. .
6。.1 Apache Web Server 20。.
6. .1. .1 To Start Apache Web Server 20. .
6。.1。.2 To Shutdown Apache Web Server 20。.
6. .2 JBoss Application Server 21. .
6。.2。.1 To Start JBoss Application Server 21。.
6. .2. .2 To Shutdown JBoss Application. .
Server 21。.
7 Appendix. . 22. .
7。.1 Security。.config。. 22.
7. .1. .1 ServerConfiguration Tag. . 25. .
7。.2 Oracle-da。.xml 27。.
7. .3 Oracle-xa-ds. . Xml 28. .
7。.4 Bootstrap。.config。. 28.
Purpose of this document. .
T2005 is part of a large IATA change。.
initiative with focus on Customer service, IATA's relevance and control and. .
efforts to minimize cost。. The “Platform” project is executed as an。.
independent project to address the common requirements across the T2005. .
program。.
The purpose of this document is to. .
help setup the deployment environment and detail the process for deployment of。.
the projects under T2005 program. .
Scope of。.
this document. .
The scope of this document is to。.
provide information for the developer / administrator involved with the program. .
about setup/configurations such as server environment details required to。.
deploy the projects. .
Definitions,。.
Abbreviation and Acronyms. .
The terms in use in the document are。.
explained below. .
Acronym。.
Description. .
QA。.
Quality Assurance. .
CVS。.
Concurrent Versioning System. .
T2005。.
Deployment. .
Manual 。.
1. .
Introduction。.
This document provides a guide for. .
installing and/or configuring following software 。.
n. .
JDK 1。.4。.2 (on RedHat Linux)。.
n. .
Apache Web Server (on RedHat Linux)。.
n. .
JBoss Application Server -4。.0。.2 (on。.
RedHat Linux). .
n 。.
Microsoft Active Directory Server. . (On..
Windows 2000/2003)。.
n. .
ADAM。. (On Windows 2000/2003)。.
The document is aimed at System. .
Administrators but who may not have prior experience operating JBoss。.
Application Sever and Apache Web Server. .
2 。.
Apache Web Server and JBoss. .
Application Server Setup。.
2. .1. .
Download the installable for Apache。.
Web Server. .
1.
Connect to 172. .26. .65. .72. . It is IATA. .
machine namely “ymq-lxqaapp1”。.
2. . Login as "svc_web" user. .
3. Go to folder “/home/svc_web/installable”。.
4. . Copy httpd-2. .0. .54. . Tar and directory namely "Apache Extra Conf Files". .
from that folder to a folder in your machine。.
5. . After copying file into your machine, execute following command. .
· 。.
"Chmod..
755 –R *”。.
If you are not able to execute that. .
command, login as super user namely “root” by executing following commands。.
"Su". .
Now it will ask for password of。.
root. . After entering password, execute following commands. .
“chmod 755 –R *”。.
2. .2. .
Installation。.
of Apache Web Server. .
6. Unzip the tar file by executing following command。.
"Tar-xvf httpd-2. .0. .54.. Tar". .
“chmod a+x -R httpd-2。.0。.54/*”。.
7. .
Now。.
go to httpd-2. .0. .54 Folder by typing following command. .
“cd httpd-2。.0。.54”。.
8. .
Before。.
you install Apache, its needs to be configured. . To do that, execute the. .
following commands one after another。. (PREFIX must be replaced with the file system path。.
under which the server should be installed. . Example: / home / svc_web / webserver /). .
o 。.
".. / Configure-prefix = PREFIX". .
o 。.
"Make". .
o 。.
"Make install". .
9. This completes the installation of Apache Server。.
2. .3. .
Configuration。.
of Apache Web Server. .
10. Add this line at the very bottom in APACHE_HOME/conf/httpd。.conf : 。.
# Include mod_jk configuration. .
file。.
Include conf / mod-jk. . Conf. .
11. Copy 2 files namely mod-jk。.conf and workers。.properties from Apache。.
Extra Conf Files / conf / to APACHE_HOME / conf folder. .
12. Now go and edit workers。.properties file。.
13. . Change the value of "worker.. Node1.. Host = 172. .26. .65. .73" To "worker.. Node1.. Host = (ip address of JBoss..
Application Server machine}”。.
14. . After that execute following commands. .
o 。.
"Chmod..
755 -R mod-jk。.conf”。.
o. .
“chmod。.
755-R workers. . Properties "..
15. Now copy the file namely mod_jk。.so from Apache Extra Conf。.
Files / modules to APACHE_HOME / modules directory. .
16. After that execute following commands。.
o. .
“chmod。.
755-R mod_jk. . So "..
2。.4 。.
Startup of. .
Apache Web Server。.
17. . Now go to folder where Apache Web Server is installed by typing. .
following command。.
o. .
“PREFIX/bin/apachectl。.
start "..
o 。.
(Prefix must..
be replaced with the file system path under which the server is installed)。.
o. .
18. Now type http://localhost/ in web browser check if you can see something like below, then it means the setup of。.
Apache Web Server is done successfully. .
19. If page shows permission denied / forbidden。. It’s because of。.
following reasons. .
“Permission。.
denied. .
error in the error_log, accompanied by a Forbidden message to the client。.
usually indicates a problem with your file system permissions, rather than a. .
problem in the Apache HTTP Server configuration files。. Check to make sure that。.
the User and Group running the child. .
processes has adequate permission to access the files in question。. Also check。.
that the directory and all parent directories are at least searchable for that. .
user and group (i。.e。., chmod +x)。.”。.
20. . To solve above problem, go to root dir and execute following. .
command。. For example, if Apache Web Server is installed on /home/web1。.
o. .
“chmod 755 -R /home/web1/*”。.
[Note:. .
To change port of Apache Web。.
Server, edit. .
$WEBSERVER_HOME/conf/httpd。.conf and find Listen 80 replace that line with Listen newportnumber]。.
2. .5. .
Download the。.
installable for JBoss Application Server. .
21. Connect to 172。.26。.65。.73。. It is IATA machine namely “ymq-lxweb1”。.
22. . Login as "svc_app" user. .
23. Go to folder /home/svc_app/installable/”。.
24. . Copy jboss-4. .0. .2. . Zip and j2sdk-1_4_2_05-linux-i586. . Bin from that. .
folder to a folder in your machine。.
25. . After copying file into your machine, execute following command. .
o 。.
"Chmod..
755 –R *”。.
If you are not able to execute that. .
command, login as super user namely “root” by executing following commands。.
"Su". .
Now it will ask for password of。.
root. . After entering password, execute following commands. .
“chmod 755 –R *”。.
"Exit". .
2。.6 。.
Installation. .
of JBoss Application Server。.
26. . To install Java, execute following. .
commands 。.
o. .
“。./j2sdk-1_4_2_。.
27。. To install JBoss, execute following commands。.
o. .
“chmod。.
755 jboss-4. .0. .2. . Zip "..
o 。.
"Unzip..
jboss-4。.0。.2。.zip -d prefix”。.
o. .
PREFIX must。.
be replaced with the file system path under which the server should be. .
installed。.
28. . Now go to jboss-4. .0. .2/bin Directory and edit run. . Sh file and add. .
following lines in the beginning of the file。.
o. .
“export JAVA_HOME={point to java home。.
eg home/svc_app/j2sdk1. .4. .2 _05). ".
29。. In the same file, replace following lines。.
# Setup JBoss sepecific properties. .
JAVA_OPTS="$JAVA_OPTS。.
-Dprogram. . Name = $ PROGNAME "..
With。.
# Setup JBoss sepecific properties. .
JAVA_OPTS="-client。.
-Xms256m-Xmx512m. .
-Dprogram。.name=$PROGNAME"。.
30. . Now go to jboss-4. .0. .2/bin Directory and edit shutdown. . Sh file and. .
add following lines in the beginning of the file。.
o. .
“export JAVA_HOME={point to java home。.
eg home/svc_app/j2sdk1. .4. .2 _05). ".
2。.7 。.
Configuration. .
of JBoss Application Server。.
31. . To complete the configuration, you need to name each node. .
accordingly to the names specified in workers。.properties (Apache Web Server。.
Configuration file). .
32。. Edit JBOSS_HOME/server/default/deploy/jbossweb-tomcat55。.sar/server。.xml。.
33. . Locate the. .
jvmRoute="node1">.
The jvmRoute attribute must match the name. .
specified in workers。.properties。.
34. . Finally, you need to tell Tomcat to add the jvmRoute value to its. .
session cookies so that mod_jk can route incoming requests。.
Edit. .
JBOSS_HOME/server/default/deploy/jbossweb-tomcat55。.sar/META-INF/jboss-service。.xml。.
.
Locate the. .
name of UseJK?, and set its value to "true":. .
35. . Now start JBoss by executing. .
following commands。.
o. .
“JBOSS_HOME/bin/run。.sh”。.
36. . Now type http://localhost:8080/ in web browser check if you can see. .
something like below If yes then it。.
means the setup of JBoss Server is successfully done. .
3 。.
ADS / ADAM Setup (LDAP Schema). .
Active Directory Server (ADS) allows user。.
authentication and Active Directory Application Mode (ADAM) stores additional. .
user information。. User information is expected to be present in the ADS/ADAM。.
schema for the authentication service to execute. . User information can be. .
populated in to the schema either by manually creating the user or by importing。.
an existing ldf file. .
3。.1 。.
Configurations and Steps for. .
Authentication on ADS 。.
The. .
Following are the steps for creating users in ADS。.
1) Create a user. . There is no restriction on. .
the hierarchy where the user should be created。. Each user created can be traced。.
(Looked up) using a "Distinguished Name" (DN). .
2) Once the user is created right click on the。.
user and reset the password. . The input password has to follow the. .
Password-policy defined for the Operating System where ADS is installed。.
3). .
The above set password and username would be used by the authentication service。.
for authenticating users. .
4)。.
The Default Domain Security Settings in ADS, allow a maximum of 24 previous. .
password histories, which means a user, in spite of having reset his password。.
would still get successfully authenticated using his previous (24) passwords. .
5)。.
To avoid multiple passwords for a single user (condition mentioned in point-4). .
set the Enforce password history to 0。. By doing so, we ensure that a user is。.
authenticated for his current password only. .
6)。.
ADAM works in conjunction with ADS. . Hence user details (attributes) will be. .
stored across ADS and ADAM schemas。. To。.
identify a user across these 2 schemas a unique attribute must be provided in. .
the user object。. ADS doesn’t support any mechanism of making an attribute unique。. Hence this has to be data-driven,。.
which means when a user details are stored in ADS an attribute, say email-id is. .
identified and stored as unique。. The same attribute is to be added in the user object。.
in ADAM, using which the corresponding user details are retrieved. .
Authentication service requires at least one。.
user's credentials to connect to ADS. . This user must exist in ADS and must be. .
an administrator。. The credentials must be entered in the security。.config using。.
which a connection to ADS is obtained. .
The。.
below fragment of security. . Config (under..
T2005_HOME\Platform\PlatformCommon\conf) captures details required for by。.
Authentication service about ADS. . Update the serverConfiguration details. . For. .
details see Appendix。.
Once a user。.
has been created in ADS, The ldap Attribute of the user has to be mapped to a. .
corresponding java attribute for the service in security。.config。.
10) The below fragment of security. . Config captures the mapping. .
between the Ldap and java attribute。.
Update. .
the javaclass mapping。.For details see Appendix。.
value=" _commonName " />
value="_commonName " />The relationship tag defines the relationship between the ADS and ADAM. .
Once the user is authenticated then the authenticated users information need to。.
be fetched from ADAM. . The relationship descriptor gives a relationship between. .
authenticated users ADS record (i。.e the binding) to the ADAM record。. Once。.
authenticated in ADS, to fetch the user's information from ADAM we use. .
“javaAttr” value in the user object and use as a filter on parentJavaAttr’s。.
ldapAttribute to fetch the rest of the information from ADAM for the particular. .
authenticated user。.
3. .2. .
Creating Schema on ADAM。.
This. .
section gives an overview on creating schema in ADAM and associating the schema。.
classes and attributes to Platform's security. . Config. .
Steps。.
for creating Application specific user in ADAM. . (For detailed description see..
the ADAM_step-by-step guide Page25 (ADAM schema snap-in))。.
1). .
Run mmc /a, SNAP-IN window opens。.
2) Add a new SNAP-IN i. . E an ADAM Schema. .
3)。.
Right click the attributes folder and create attributes UserType and. .
UserCode(Both the example attribute mentioned here are w。.r。.t to SNAP project。.)。.
4). .
Right click the classes folder and create a new class(SNAPUSER) which extends。.
user class of the ADAM schema and add UserType and UserCode as optional attribute to SANPUSER. .
3。.2。.1 。.
Creating a new SNAPUSER. .
1) Open ADAM EDSI EDIT, right click and。.
create a user for SNAPUSER. .
2) 。.
Populate values for UserType and UserCode. .
3) Populate mail attribute for the new。.
SNAPUSER, this mail value would be used by. .
AuthenticationService to query ADAM,to。.
fetch the other information SNAPUSER such as UserType and UserCode. .
3。.2。.2 。.
Associating the user to Security. . Config. .
1) Under PrinicipalUser in ldapClass set。.
value to "SNAPUSER". .
2) In。.
The PrincipalUser class associate the. .
field Name for mail, i。.e adsmail with。.
ldapattribute mail. .
3)。.
For each SNAPUSER in ADAM create a user in ADS and populate the mail attribute. .
in both ADAMUSER and ADSUSER with same value。.
value="org.iata.idfs.t2005.bdm.security.PrincipalUser">
value=" SNAPUSER
"/>3. .3. .
Configurations and Steps for。.
Authentication on ADAM. .
ADAM works as an extension to ADS; it。.
stores additional details of ADS users. . The authorization service connects to. .
ADS retrieves the available user details and then connects to ADAM to retrieve。.
additional information. .
1) TO connect to ADAM, open AdamEdit and。.
make server connections to the ADAM partition where you want to create user. .
2)。.
Create a user. . There is no restriction on the hierarchy where the user should. .
be created。.
3) By default for a user created on ADAM the. .
attribute msDS-UserAccountDisabled is set to true。. Set this attribute to false。.
to activate the user. .
4)。.
To connect to ADAM at least one admin user's credentials must be known. . Using. .
these credentials a connection to ADAM is obtained。. The credentials must be。.
entered in the security. . Config. .
The。.
below fragment of security. . Config captures details required by the. .
Authentication service about ADAM。.
Update. .
the serverConfiguration details。.For details see Appendix。.
The. .
fragment is present in security。.config under。.
T2005_HOME \ Platform \ PlatformCommon \ conf. .
5)。.
To connect to ADAM the above mentioned user must be a memberof Administrator. .
under roles, in order do so browse to CN=roles,CN=Administrator。.

3. .4. .
Changing settings for LDAP policy。.
1). .
ADS and ADAM。.
server comes with a utility called ntdsutil. . Exe which helps in changing the. .
LDAP policies。. The screenshot of the following is given below。.(Ntdsutil。.exe can。.
be found under ADAM_HOME (where ADAM is installed). .). .
4 。.
Configuration of JBoss for T2005. .
The following。.
steps will tell you how to configure JBoss server for T2005 application. . This. .
is one time activity。.
1. . Edit $ JBoss_Home / server / default / conf / jboss-service. . Xml and add. .
following lines just before 。.
line. . (Replace $ JBoss_Home with absolute path). .
code="org.iata.idfs.t2005.platform.T2005StartUpService"
name="jboss:service=T2005StartUpService">
name="BootstrapConfigPath">$JBoss_Home/server/default/conf/T2005/Platform/PlatformCommon/conf/bootstrap。.config。.
2. .
Edit。.
$ JBoss_Home / server / default / conf / jboss-service. . Xml and find the tag. .
code="org.jboss.tm.XidFactory"
name="jboss:service=XidFactory">” and uncomment the “Pad”。.
attribute. .
3。.
Comment out the section "Log4j..
Initialization” in $JBoss_Home/server/default/conf/jboss-service。.xml。.
4. .
Connect。.
to IATA_CVS and take latest. .
5。.
Copy. .
the oracle-ds。.xml and oracle-xa-ds。.xml。.
data source files from $ IATA_CVS/T2005/BuildDist/conf/deploy to. .
$JBoss_Home/server/default/deploy/ folder。.
6. .
Edit oracle-ds。.xml。.
under $ JBoss_Home / server / default / deploy / and make changes to following. .
properties with appropriate value 。.
a. .
connection-url。.
b. .
user-name。.
c. .
password。.
7. .
Edit oracle-xa-ds。.xml。.
under $ JBoss_Home / server / default / deploy / and make changes to following. .
properties with appropriate value URL。.
d. .
User。.
e. .
Password。.
5. .
Deployment of T2005 Platform Components。.
The following. .
steps will tell you how to deploy Platform Components。.
1. . Shutdown the JBoss Application Server if it is running. .
2。. Connect to IATA_CVS and take latest。.
3. . Now copy T2005 folder from $ IATA_CVS/T2005/BuildDist/conf/conf. .
directory to $JBoss_Home/server/default/conf。.
4. .
Edit bootstrap。.config。.
(Which is located under..
$JBoss_Home/server/default/conf/T2005/Platform/PlatformCommon/conf ) and change。.
the value of property "org.. iata.. idfs.. t2005.. projects.. root" to "$ JBoss_Home/server/default/conf/T2005". . Please make sure to replace. .
“$JBoss_Home” with absolute path。.
information. .
5。.
Edit security. . Config (which is located under..
$JBoss_Home/server/default/conf/T2005/Platform/PlatformCommon/conf) and make。.
changes to following properties with appropriate value. .
a) Hostname : IPAddress where ADS or ADAM is located。.
b) distinguishedName:. .
c) rootContext: 。.
d) password:. .
e) port 。.
f) userType. .
For details see serverConfiguration。.
6. .
Now copy all jars from。.
$ IATA_CVS/T2005/BuildDist/lib to $ JBoss_Home / server / default / lib. .
7。.
Now copy all files from. .
$IATA_CVS/T2005/BuildDist/deploy to $JBoss_Home/server/default/deploy。.
8. .
Now all execute all the SQLs under。.
$ IATA_CVS \ T2005 \ Platform \ deploy \ sql in numeric order against Oracle Database. .
9。.
Now start JBoss Application Server. .
6 。.
Administration Commands. .
6。.1 。.
Apache Web Server. .
6。.1。.1 。.
To Start Apache Web Server. .
To start Web。.
Server, go to bin directory under Web Server home and execute following command. .
/apachectl。.
start. .
Now type http://localhost/ in web browser check if you can see something like below。.
Then it. .
means Apache Web Server has started successfully。.
6. .1. .2. .
To Shutdown Apache Web Server 。.
To shutdown Web Server, go to bin directory. .
under Web Server home and execute following command 。.
/ Apachectl stop. .
If。.
the shutdown is complete, you will not able to see above figure. .
6。.2 。.
JBoss Application Server. .
6。.2。.1 。.
To Start JBoss Application Server. .
To start。.
Application Server, go to bin directory under Application Server home and execute. .
following command 。.
nohup. . / Run. . Sh &. .
The server may。.
take few seconds to few minutes to complete startup depending on the. .
configuration of machine。. After few seconds, type http://localhost:8080/ in web browser check if you see something。.
like below. .
This means JBoss。.
Application Server has started. .
6。.2。.2 。.
To Shutdown JBoss Application Server. .
To shutdown。.
Application Server, go to bin directory under Application Server home and. .
execute following command 。.
/ Shutdown. . Sh. .
-Djava。.naming。.provider。.url=jnp://localhost:1099。.
Shutdown process will take few seconds to. .
few minutes depending on the configuration of the machine If the shutdown is。.
complete, you will not able to see above figure. . If shutdown process failed for. .
some reason, you should be able to kill the server by doing following setups。.
1. . First find out the process id of the JBoss Application Server. .
Process by executing following commands 。.
ps-aef | grep. .
java。.
2. . After that, kill process by executing following commands. .
kill -9。.
"Process-id". .
7 。.
Appendix. .
The following section gives the detail。.
about creating users in Active Directory Server. .
7。.1 。.
Security. . Config. .
Below table gives the detailed explaination。.
on the security. . Config. .
TagName。.
Attributes. .
Mandatory。.
Expected Values. .
Defaults。.
Description. .
LDAPMapping。.
javaClass. .
Yes。.
User class with. .
package name。.
-. .
The user。.
object used internally by DirectoryAccessManager. . All. .
attributes mentioned 。.
Under attributes. .
tag will be the fecthedfrom the ADS or ADAM, and displayed in the response。.
javaClass. .
ldapClass,serverName。.
, ServerTpe, hasparent. .
,attributes,relationship,。.
extends. .
Yes。.
Package name for. .
the user object。.
-. .
Name with the package。.
Name of the java Object class associated with the user to be fetched. . In this. .
case principal。.
ldapClass. .
-。.
Yes. .
The object Class。.
of user created on ADS and ADAM. .
-。.
The object class. .
in this case would be user。.All the objectClass users attribute is mapped to java Object class Attributes。.
serverName. .
-。.
Yes. .
The serverConfiguration value it corresponds to。.
-. .
Used for mapping。.
a user to a server configuration, i. . E to identify which server the users must. .
be fetched from。.
serverTpe. .
-。.
Yes. .
ADS/ADAM。.
-. .
Used for identifying。.
if the server is an ADS or ADAM. . If ADS then security API does a two call. .
authentication。.
hasparent. .
-。.
Yes. .
True/false。.
If false the. .
javaclass doesn’t extend any other javaclass。. If true then javaclass inherits。.
the attributes of the base class. .
attributes。.
attribute. .
Yes。.
A list of. .
attributes。.
-. .
Attributes with。.
javaField name and the correponding the ADS or ADAM Attribute name. .
Attribute。.
javaAttr, ldapAttr. .
Yes。.
Consisting of. .
java Field name and ldap object Class。.
-. .
Attribute。.
consisting of mapping between the java object field passed and it's corresponding. .
ADS/ADAM attribute。.
javaAttr. .
-。.
Yes. .
Java Field Name。.
-. .
ADS/ADAM attribute value of user that needs。.
to be fetched, the value fetched is stored into the javaAttribute. . The. .
populated javaClass ,in our case principal is returned as response。.
ldapAttr. .
-。.
Yes. .
ADS attribute Name。.
-. .
ADS/ADAM。.
attribute value of user that needs to be fetched. .
relationship。.
javaAttr, parentJavaAttr. .
No。.
For Correlating between. .
ADS and ADAM。.
-. .
KeyPair for correlating。.
ADS and ADAM. . See. .
javaAttr。.
-. .
Yes。.
Java Field name. .
of the corresponding class。.
-. .
java Attribute is。.
the. .
parentKey of the。.
current class. . See. .
parentJavaAttr。.
-. .
Yes。.
ADS / ADAM. .
attribute corresponding to the java field。.
-. .
javaAttribute to。.
which the base. .
class’s attribute is linked。. See。.
Extends. .
-。.
No. .
The base class。.
name. .
The Entire。.
className with package of the base class. .
7。.1。.1 。.
ServerConfiguration Tag. .
TagName。.
Attributes. .
Mandatory。.
Expected Values. .
Defaults。.
Description. .
serverConfiguration。.
Hostname, distinguishedname,. .
rootcontext,ldapfactory, simpleauthentication, password, searchscope, port,。.
usertype. .
Yes。.
All. .
-。.
Holds the server. .
Configuartion properties of individual ADS and ADAM。.
Hostname. .
-。.
Yes. .
IPAddress where the ldap instance is running。.
-. .
Used for constructing。.
Provider_URL. .
distinguishedname。.
-. .
Yes。.
-. .
Name of the。.
environment property for specifying the identity of the principal for authenticating. .
the caller to the service。.
rootcontext. .
-。.
Yes. .
Root from where。.
search is done. .
-。.
For Making Provider_Url,. .
for specifying configuration information for the service provider to use。.
ldapfactory. .
-。.
No. .
This constant is。.
mandatory (com.. sun.. jndi..
com。.sun。.jndi。.
Ldap. . LdapCtxFactory. .
Ldap。.ldapCtxFactory)。.
Constant that holds the name of the environment property. .
for specifying the initial context factory。.
to use. .
simpleauthentication。.
-. .
Yes。.
"None",. .
"simple", "strong"。.
-. .
Constant that。.
holds the name of the environment property for specifying the security level. .
to use。.
password. .
-。.
Yes. .
User Password。.
-. .
Name of the。.
environment property for. .
specifying the credentials of the principal。.
for authenticating the caller to the service. .
searchscope。.
-. .
Yes。.
0 - Object_Scope. .
1 –。.
Onelevel_Scope. .
2 – Subtree_Scoper。.
Simple is a must. .
here。.
Name of the. .
environment property for specifying the security level to use。.
Port. .
-。.
Yes. .
Port number on。.
which the instance is running. .
389 for ADS and。.
50000 for ADAM. .
For Making Provider_Url,。.
for specifying configuration information for the service provider to use. .
Usertype。.
-. .
Yes。.
Internal / External. .
Internal。.
For distinguishing. .
the type of users the server would be used to fetch。.
7. .2. .
Oracle-da。.xml。.
TagName. .
Mandatory。.
Expected Values. .
Description。.
oracle。.jdbc。.driver。.OracleDriver。.
Class name of JDBC Driver used for connecting to database. .
jdbc: oracle: thin: @ youroraclehost:. .
1521:yoursid。.
JDBC URL to the DB instance. .
Username. .
Username for。.
accessing the DB. .
Password. .
Password for。.
accessing the DB. .
IATA_DS. .
JNDI name of the。.
datasource. .
7。.3 。.
Oracle-xa-ds. . Xml. .
TagName。.
Mandatory. .
Expected Values。.
Description. .
IATA_TX_DS. .
JNDI name of。.
datasource. .
name="URL">Yes。.
jdbc: oracle: thin: @ youroraclehost:. .
1521:yoursid。.
JDBC URL to the. .
DB instance。.
name="User">Yes. .
Username 。.
Username for. .
accessing the DB。.
name="Password">Yes. .
Password 。.
Password for. .
accessing the DB。.
7. .4. .
Bootstrap。.config。.
TagName. .
Mandatory。.
Expected Values. .
Description。.
org. . Iata. . Idfs. . T2005. .
platform。.environment。.
Yes. .
Staging/development。.
If value is. .
development then connections to resources like ADS, ADAM will not established。.
during bootstrap. .
org。.iata。.idfs。.t2005。.
projects. . Root. .
Yes。.
Location where. .
the T2005 configuration files are present。.
org. . Iata. . Idfs. . T2005. . Platform. .
scheduler。.enable。.
Yes. .
True/false。.
If value is. .
false, then scheduler service properties are not loaded and scheduler service。.
will not be started. . If value is true then scheduler service properties are. .
loaded and scheduler will be started。.
org. . Iata. . Idfs. . T2005. . Platform. .
nature。.
Yes. .
Server/client。.
Platform can be. .
run in two modes server and client mode。. But in your case, it will be always。.
server mode. .
org。.iata。.idfs。.t2005。.platform。.
non_xa. . Datasource. .
Yes。.
java: / IATA_DS. .
JNDI name for data source。.
for non managed transaction. .
org。.iata。.idfs。.t2005。.platform。.
xa. . Datasource. .
Yes。.
java: / IATA_TX_DS. .
JNDI name for data source。.
for managed transaction. .
org。.iata。.idfs。.t2005。.platform。.
session. . Timeout. .
Yes。.
7200. .
Number of seconds。.
after which session would be timeout. .
org。.iata。.idfs。.t2005。.platform。.
session. . Nature. .
Yes。.
Platform / Http. .
Describes the。.
type of session handling. . If value is Platform then session state will. .
be managed by storing session in database, else if value is Http。.
then state is managed using Http Session. .
org。.iata。.idfs。.t2005。.platform。.session。.
cookie. . Status. .
Yes。.
0 / 1. .
If value is 0 Platform。.
will not store cookies on the client, else if 1 is specified then cookies. .
would be stored at client。. This is independent of client browser’s cookie setting。.
Integrate LDAP server (IBM Tivoli) with WebSphere5. .1 Installed on REHL4 and Using LDAP server for user the authentication. .
1 Install WAS5。.1 。.
1. .1 Preparations for installation. .
Refer to Page 31 IBM Web Sphere Application Server Version5。.1 install guide doc for details。.
Refer to Platform. . Doc for quick installation. .
(Patches for Linux, creating user/group for Message Q) 。.
1. .2 Installing WAS5. .1 (HTTP Server + Application Server). .
1。.3 Patching WAS and recommended patches 。.
Please download the following fix & update to 5. .1. .1. .5 To see if still problem:. .
http://www。.ibm。.com/support/docview。.wss?rs=180&uid=swg24007195 。.
http://www. . Ibm. .com / support / docview. . Wss? Rs = 180 & uid = swg24009883. .
Recommended update 。.
http://www-1. . Ibm. .com / support / docview. . Wss? Rs = 180 & context = SSEQTP & uid = swg27004980. .
2 Install Tivoli LDAP (Windows Version) 。.
Tivoli should be installed on different Server with WAS because Tivoli includes an embedded WAS express Server which will cause port conflicting with WAS5. .1. .
Using IBM Tivoli Directory Server Installation and configuration Guide as reference book。., go through chapter 1。. Quick installation path for preparation, installation, configuration LDAP server 。.
2. .1 Creating realm, group, users for LDAP server, using IBM Tivoli Directory Server. .
Using Administration Guide as reference book to create realm, group, users。.
2. .2 Patch Tivoli LDAP server. .
http://www-1。.ibm。.com/support/docview。.wss?rs=767&context=SSVJJU&q1=error+code+32+No+Such+Object&q2=%22no+such+object%22&uid=swg24010008&loc=en_US&cs=utf-8&lang=en 。.
2. .3 According to below steps to set user to short name UID. .
3 Integrate WAS with LDAP。.
https: / /. .
Click Securityà User Registry àLDAP. .
Click advanced LDAP setting 。.
Modify two entries (User filter and Group filter) as below shown. .
User filter 。.
(&(|( Cn =% v) (uid =% v)) (objectclass = inetOrgPerson)). .
Group filter 。.
(& (Cn =% v) (| (objectclass = groupOfNames) (objectclass = groupOfUniqueNames))). .
Click confirm, it will join into GLOBAL Security 。.
Click security -> Authentication àLTPA. .
Click generate KEY , set password 。.
Click SSO, choose enable. .
4 LDAP data migration 。.
Run. .
In left frame, define export / import ldif filename, then click export / import button to export / import ldif file which contains LDAP data. .
Patch AST from below link 。.
http://www-1. . Ibm. .com / support / docview. . Wss? Rs = 180 & uid = swg24007195, you can find App Server Toolkit 5. .1. .1-HTTP only. .
(HTTP only means you can only download via HTTP, not FTP), so you can update to AST 。.
Reference. .
Command for search users created in LDAP server under Windows 。.
E: \ websphere50 \ bin> ldapsearch-h wangchen-p 389-b "dc = ibm, dc = com"-D cn = root -. .
w password "objectclass=*" 。.
http://publib. . Boulder. . Ibm. .com/infocenter/wasinfo/v5r1/topic/com. . Ibm. . Websphere. . Zseries. .doc / info / zseries / ae / tsec_selectldapreg. . Html? Resultof =% 22% 63% 6e% 3d% 72% 6f% 6f% 74% 22% 20. .
http://publib。.boulder。.ibm。.com/infocenter/wasinfo/v5r1/topic/com。.ibm。.websphere。.wbifz。.doc/info/wbifz/ae/tsec_enablingwebsec。.html?resultof=%22%63%6e%3d%72%6f%6f%74%22%20 。.
http://publib. . Boulder. . Ibm. .com/infocenter/wasinfo/v5r1/topic/com. . Ibm. . Websphere. . Base. .doc / info / aes / ae / rtrb_secconfigprobs. . Html? Resultof =% 22% 63% 6e% 3d% 72% 6f% 6f% 74% 22% 20. .
http://publib。.boulder。.ibm。.com/infocenter/wasinfo/v5r1/topic/com。.ibm。.websphere。.base。.doc/info/aes/ae/csec_ldap。.html?resultof=%22%63%6e%3d%72%6f%6f%74%22%20 。.
If you could not login with short name, please modify advanced properties of ldap server from ePerson to inetOrgPerson. .
mount -o tcp mycdrom。.hostname:/media/cdrom /mnt refer to page 11 of Platform。.doc 。.
Database using stored procedures to address efficiency issues. .
存储过程是利用数据库提供的工具编写一组SQL语句,编译后存放在数据库中,完成交易的逻辑处理工作。客户机上进行数据输入/输出处理,逻辑处理通过调用服务器上的存储过程来实现,客户机调用存储过程如同调用一个函数一样。.
This approach reduces client access to database interaction times, with transparent access to data, higher efficiency, but compared with the messaging middleware, the network speed, the lower, stored procedure run more slowly. .
当存储过程运行结束,所有数据库操作也就完成了,但问题是传送的应答数据可能丢失,导致客户机失败,而服务器成功,使数据的一致性得不到保证。另外,当存储过程处理结果返回到客户机上,而操作员决定取消该交易时,需通过调用另一存储过程来取消上一笔交易的结果,应用程序的编写量增大。.
TongLINK and TongEASY with this type of transplant procedure will be more convenient, simply transform into a service program stored procedures, the front-end functions of the program calls the stored procedure call service program to transform the statement. .
从实际应用结果来看,在低速网上TongLINK和TongEASY的运行效率明显高于存储过程。而且,TongLINK和TongEASY有助于了解应用系统的各方面运行状况,包括节点的连接情况、交易处理情况、程序运行情况等,方便系统的管理,应用程序的开发也具有很大的灵活性。.
7 - CallableStatement. .
本概述是从《JDBCTM Database Access from JavaTM: A Tutorial and Annotated Reference 》这本书中摘引来的。JavaSoft 目前正在准备这本书。这本书是一本教程,同时也是 JDBC 的重要参考手册,它将作为 Java 系列的组成部份在 1997 年春季由 Addison-Wesley 出版公司出版。.
7. .1 Overview. .
CallableStatement 对象为所有的 DBMS 提供了一种以标准形式调用已储存过程的方法。已储存过程储存在数据库中。对已储存过程的调用是 CallableStatement 对象所含的内容。这种调用是用一种换码语法来写的,有两种形式:一种形式带结果参数,另一种形式不带结果参数(有关换码语法的信息,参见第 4 节“语句”)。结果参数是一种输出 (OUT) 参数,是已储存过程的返回值。Two forms can be input with a variable number (IN parameters), output (OUT parameter) or the input and output (INOUT parameters) parameters. Question mark will be used as parameter placeholders. .
在 JDBC 中调用已储存过程的语法如下所示。注意,方括号表示其间的内容是可选项;方括号本身并不是语法的组成部份。.
(Call procedure name [(?,?, 。.)]}。 .
返回结果参数的过程的语法为: 。.
(? = Call procedure name [(?,?, 。.)]}。 .
不带参数的已储存过程的语法类似: 。.
(Call procedure name). .
通常,创建 CallableStatement 对象的人应当知道所用的 DBMS 是支持已储存过程的,并且知道这些过程都是些什么。然而,如果需要检查,多种 DatabaseMetaData 方法都可以提供这样的信息。例如,如果 DBMS 支持已储存过程的调用,则 supportsStoredProcedures 方法将返回 true,而 getProcedures 方法将返回对已储存过程的描述。.
CallableStatement inherits Statement methods (they used to deal with the general SQL statements), also inherited PreparedStatement methods (they used to deal with IN parameters).CallableStatement 中定义的所有方法都用于处理 OUT 参数或 INOUT 参数的输出部分:注册 OUT 参数的 JDBC 类型(一般 SQL 类型)、从这些参数中检索结果,或者检查所返回的值是否为 JDBC NULL。.
7. .1. .1 Create a CallableStatement object. .
CallableStatement 对象是用 Connection 方法 prepareCall 创建的。下例创建 CallableStatement 的实例,其中含有对已储存过程 getTestData 调用。该过程有两个变量,但不含结果参数: 。.
CallableStatement cstmt = con. . PrepareCall (..
"{call getTestData(?, ?)}");。.
Where? Placeholder for the IN, OUT or INOUT parameters depends on the stored procedure getTestData. .
7。.1。.2 IN 和 OUT 参数。.
IN parameters to pass CallableStatement object is done by setXXX method. The method inherited from PreparedStatement. The incoming parameter determines the type used setXXX methods (for example, to pass with setFloat float value, etc.). .
如果已储存过程返回 OUT 参数,则在执行 CallableStatement 对象以前必须先注册每个 OUT 参数的 JDBC 类型(这是必需的,因为某些 DBMS 要求 JDBC 类型)。注册 JDBC 类型是用 registerOutParameter 方法来完成的。语句执行完后,CallableStatement 的 getXXX 方法将取回参数值。Correct getXXX is registered for each parameter type of the corresponding JDBC Java type (JDBC types to Java types from the standard mapping, see 8. .6. .1 Section table). In other words, registerOutParameter using JDBC type (so it returns the JDBC type of the database matches), while getXXX transform them into Java types. .
作为示例,下述代码先注册 OUT 参数,执行由 cstmt 所调用的已储存过程,然后检索在 OUT 参数中返回的值。方法 getByte 从第一个 OUT 参数中取出一个 Java 字节,而 getBigDecimal 从第二个 OUT 参数中取出一个 BigDecimal 对象(小数点后面带三位数): 。.
CallableStatement cstmt = con. . PrepareCall (..
"{call getTestData(?, ?)}");。.
cstmt. . RegisterOutParameter (1, java.. Sql.. Types.. TINYINT);. .
cstmt。.registerOutParameter(2, java。.sql。.Types。.DECIMAL, 3);。.
cstmt. . ExecuteQuery ();. .
byte x = cstmt。.getByte(1);。.
java. . Math. . BigDecimal n = cstmt. . GetBigDecimal (2, 3);. .
CallableStatement 与 ResultSet 不同,它不提供用增量方式检索大 OUT 值的特殊机制。.
7. .1. .3 INOUT parameter. .
既支持输入又接受输出的参数(INOUT 参数)除了调用 registerOutParameter 方法外,还要求调用适当的 setXXX 方法(该方法是从 PreparedStatement 继承来的)。setXXX 方法将参数值设置为输入参数,而 registerOutParameter 方法将它的 JDBC 类型注册为输出参数。setXXX method provides a Java value, while the driver is first converted to JDBC value of this value, and then send it to the database. .
这种 IN 值的 JDBC 类型和提供给 registerOutParameter 方法的 JDBC 类型应该相同。然后,要检索输出值,就要用对应的 getXXX 方法。例如,Java 类型为 byte 的参数应该使用方法 setByte 来赋输入值。RegisterOutParameter should be provided to the JDBC type TINYINT type, also should be used to retrieve the output value getByte (Section 8 "JDBC and Java type mapping between" will give detailed information and type mapping table). .
下例假设有一个已储存过程 reviseTotal,其唯一参数是 INOUT 参数。方法 setByte 把此参数设为 25,驱动程序将把它作为 JDBC TINYINT 类型送到数据库中。接着,registerOutParameter 将该参数注册为 JDBC TINYINT。执行完该已储存过程后,将返回一个新的 JDBC TINYINT 值。Methods getByte will this new value as a Java byte type search. .
CallableStatement cstmt = con。.prepareCall(。.
"(Call reviseTotal (?)}");。 .
cstmt。.setByte(1, 25);。.
cstmt. . RegisterOutParameter (1, java.. Sql.. Types.. TINYINT);. .
cstmt。.executeUpdate();。.
byte x = cstmt. . GetByte (1);. .
7。.1。.4 先检索结果,再检索 OUT 参数。.
Since the restriction of certain DBMS, in order to achieve maximum portability, it is recommended by the Executive CallableStatement object retrieve the result, then use the CallableStatement. . GetXXX method to retrieve OUT parameter. .
如果 CallableStatement 对象返回多个 ResultSet 对象(通过调用 execute 方法),在检索 OUT 参数前应先检索所有的结果。这种情况下,为确保对所有的结果都进行了访问,必须对 Statement 方法 getResultSet、getUpdateCount 和 getMoreResults 进行调用,直到不再有结果为止。.
Search the results of all completed, you can use the CallableStatement. . GetXXX method to retrieve OUT parameter values. .
7。.1。.5 检索作为 OUT 参数的 NULL 值。.
Back to the OUT parameter value may be JDBC NULL. When this situation occurs when the JDBC NULL value will be converted to make getXXX method returns a value of null, 0 or false, depending on the type getXXX method. For the ResultSet object, to know whether 0 or false from the only way to JDBC NULL is to use the method wasNull testing.如果 getXXX 方法读取的最后一个值是 JDBC NULL,则该方法返回 true,否则返回 flase。第 5 节“ResultSet”将给出详细信息。.
PostgreSQL 7. .4 Document. .
Prev。.
Fast Backward. .
Chapter 31。. JDBC 接口。.
Fast Forward. .
Next。.
31. .5. . Call a stored procedure. .
PostgreSQL’s JDBC 驱动完全支持调用 PostgreSQL 存储过程。.
Example 31-4. . Call a built-in memory function. .
这个例子显示了如何调用一个 PostgreSQL 内置的函数, upper,它只是简单地把你提供的字串参数转换成大写。.
/ / Close the transaction. .
con。.setAutoCommit(false);。.
/ / Procedure call. .
CallableStatement upperProc = con。.prepareCall("{ ? = call upper( ? ) }");。.
upperProc. . RegisterOutParameter (1, Types.. VARCHAR);. .
upperProc。.setString(2, "lowercase to uppercase");。.
upperProc. . Execute ();. .
String upperCased = upperProc。.getString(1);。.
upperProc. . Close ();. .
一、JSP工作原理 。.
The first time in a JSP file is requested, JSP engine to the JSP file into a servlet. While the engine itself is a servlet, in JSWDK or WEBLOGIC, it is JspServlet. JSP引擎先把该JSP文件转换成一个Java源文件,在转换时如果发现jsp文件有任何语法错误,转换过程将中断,并向服务端和客户端输出出错信息;如果转换成功, JSP引擎用javac把该Java源文件编译成相应的class文件。然后创建一个该SERVLET的实例,该SERVLET的jspInit()方法被执行,jspInit()方法在servlet的生命周期中只被执行一次。Then jspService () method is called to handle client requests. For each request, JSP engines create a new thread to handle the request. If there are multiple clients simultaneously request the JSP file, JSP engine will create multiple threads. Each client request corresponding to a thread. To multi-threaded manner may significantly reduce the demand on system resources and improve the system's concurrency and response time. . But it should be noted that multi-threaded programming limitations, as the servlet is always in the memory, so the response is very fast. If. .jsp文件被修改了,服务器将根据设置决定是否对该文件重新编译,如果需要重新编译,则将编译结果取代内存中的servlet,并继续上述处理过程。 虽然JSP效率很高,但在第一次调用时由于需要转换和编译而有一些轻微的延迟。此外,如果在任何时候如果由于系统资源不足的原因,JSP引擎将以某种不确定的方式将servlet从内存中移去。When this happens jspDestroy () method is called first, then servlet instance will be marked by adding "garbage collection" treatment. jspInit () and jspDestory () format as follows: in jspInit () in some initialization work, such as the establishment of the database connection or a network connection from the configuration file to take a number of parameters in jspDestory () to release appropriate resources. .
<%!
public void jspInit()
{
System.out.println("jspinit");
}
%>
<%!
public void jspDestory()
{
System.out.println("jspDestory");
}
%>二、服务端的输出缓冲区 。.
Default: server to output the contents to the client, not directly written to the client, but first write an output buffer. . Only three of the following circumstances, only the contents of the buffer output to the client:. .
该JSP网页已完成信息的输出 。.
Output buffer is full. .
JSP中调用了out。.flush()或response。.flushbuffer() 。.
The size of the output buffer can be: or response. . SetBufferSize () settings, as follows:. .
设置输出缓冲区的大小为1KB。或response。.setBufferSize(1); 。.
Set the output buffer size to 0, that is, no buffer. Or response. . SetBufferSize (0);. .
用response。.getBufferSize ()或out。.getBufferSize()可取的输出缓冲区的大小,单位为字节。. 用response。.isCommitted()可检查看服务端是否已将数据输出到客户端。. 如果返回值是TRUE则已将数据输出到客户端,是FALSE则还没有。.
Third, the service ended output redirection. .
有以下3种方法可以做到输出重定向: 。.
RESPONSE. . SETREDERECT ("URL") of the method by modifying the HTTP protocol of the HEADER part, redirect the browser to issue instructions to redirect web browser to display the content. . Response. . SendRedirect ("http://localhost:7001/index.. Html");. .
下面的方法也能改变HTTP HEADER属性,它的原理和 1 是一样的。.
<%
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
String newLocn="/index.html";
response.setHeader("Location",newLocn);
% >
采用
(1) 。.
<%@page buffer="1kb"%>
<%
long i=0;
for(i=0;i<10;i++)
{
out.println("@@@@@@@@@@@@@@@@@");
}
%>
<%@page buffer="1kb"%>
<%
long i=0;
for(i=0;i<600;i++)
{
out.println("@@@@@@@@@@@@@@@@@");
}
%>说明: 。.
1. . Methods (1), (2) can use the variable that redirection address; method (3) can not use variables that redirection address. .
String add="。./index。.html"; 。.
String add=http://localhost:7001/index。.html 。.
response. . SendRedirect (add);. .
可以重定向到http://localhost:7001/index。.html中去。.
2. . Using method (1), (2) request in the variable (by request.. SetAttribute () to request the value stored) can not be used in the new page, using method (3) can. . In summary, we should be using (1), (2) redirect is better. .
四、JSP中正确应用类: 。.
Should be the class to use as a JAVA BEAN, do not. .
<% %> 中直接使用。. 如下的代码(1)经过JSP引擎转化后会变为代码(2): 。.
From which we can see if a class as a JAVA BEAN use in JSP, JSP scope in accordance with its role to save it to the corresponding internal object. .
如作用范围为request,则把它保存到request对象中。.并且只在第一次调用(对象的值为null)它时进行实例化。. 而如果在。.
<% %>Directly create an object class, then the JSP is called each time, they must re-create the object, will affect performance. .
代码(1) 。.
<%
test.print("this is use java bean");
testdemo td= new testdemo();
td.print("this is use new");
%>Code (2). .
demo。.com。.testdemo test = (demo。.com。.testdemo)request。.getAttribute("test"); 。.
if (test == null). .
{ 。.
try. .
{ 。.
test = (demo.. com.. testdemo) java. . Beans. . Beans. . Instantiate (getClass ().. GetClassLoader (), "demo.. Com.. Testdemo");. .
} 。.
catch (Exception _beanException). .
{ 。.
throw new weblogic. . Utils. . NestedRuntimeException ("cannot instantiate 'demo.. Com.. Testdemo'", _beanException);. .
} 。.
request. . SetAttribute ("test", test);. .
out。.print("\r\n"); 。.
). .
out。.print("\r\n\r\n\r\n"); 。.
test. . Print ("this is use java bean");. .
testdemo td= new testdemo(); 。.
td. . Print ("this is use new");. .
五、JSP的调试 。.
JSP debugging is troublesome, especially when the bean is a session exists, the more difficult. Several pages from the beginning was entered, and go Caixing. Is usually out. . Println () or System. . Out. . Print () to play a lot of information to look into the problem. If this is done using jbuilder development, it can directly debugging JSP. . But more important is that the error causes and solutions. Following some common mistakes of JSP programming. .
(1)。.java。.lang。.NullPointerException异常 。.
Generally is a NULL value for the variable operation caused. . If the following operation will be thrown. .
java。.lang。.NullPointerException 。.
String a = null;. .
a。.substring(0,1); 。.
To avoid this exception the best in the variable before you check to see if it is NULL value. . Such as:. .
<% String ss=Session.getAttribute("NAME")
if isnull(ss)
{
}
else
{
}
%>(2)。. JSP是用JAVA写的,所以它是大小写敏感的,用过其他编程语言的人最容易犯这个错误。另外在浏览器的地址栏中输入的访问JSP的地址也是区分大小写的。.如http://localhost:7001/demo/t。.jsp与http://localhost:7001/Demo/t。.jsp是不一样的 。.
(3). . In the jsp in the string to use compareTo method to judge, do not use == because in java in the String variable is not a simple variable but a class instance, different methods will be different results, as follows:. .
。.
String str1 = "ABCD";. .
String str2="ABCD"; (或 String str2="AB"+"CD"; 。.
if (str1 == str2). .
out。.print("yes"); 。.
else. .
out。.print("no"); 。.
The result is "yes". .
。.
String str1, str2, str3;. .
str1="ABCD"; 。.
str2 = "AB";. .
str3=str2+"CD"; 。.
if (str1 == str3). .
out。.print("yes"); 。.
else. .
out。.print("no"); 。.
The result is "no". .
String str1=new String("ABCD"); 。.
String str2 = new String ("ABCD");. .
if (str1==str2) 。.
out. . Print ("yes");. .
else 。.
out. . Print ("no");. .
结果是"no"。.
String str1 = new String ("ABCD");. .
String str2=new String("ABCD"); 。.
if (str1.. compareTo (str2) == 0). .
out。.print("yes"); 。.
else. .
out。.print("no"); 。.
The result is "yes". .
(4)防止JSP或SERVLET中的输出被浏览器保存在缓冲区中: 。.
Default browser will browse the web pages stored in the buffer, in commissioning, generally do not want this. . The following script to join the program, you can prevent the output of JSP or SERVLET in the browser stored in the buffer. .
<%
response.setHeader("Cache-Control","no-store"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>在IE中也可通过设置实现:把/工具/INTERNET选项/常规/设置/的检察所存页面的较新版本,设为每次访问该页时都检查。.
6, COOKIE. .
HTTP COOKIE实质是服务端与在客户端之间传送的普通HTTP头,可保存也可不保存在客户的硬盘上。.如果保存,每一个文件大小不超过4K的文本文件。.多个 COOKIE可保存到同一个文件中。. 如果从编程角度来看,在JSP中COOKIE就是JAVA提供的一个类。.常用的方法如下所表示,因为客户端可能不接受COOKIE,所以建议不用它,改用 SESSION等其他方式。.
public class cookie. .
{ 。.
public String getDomain () / / returns the COOKIE effective domain. .
public int getMaxAge() //返回该COOKIE的有效期,单位为秒 。.
public String getName () / / return the name of the COOKIE. .
public String getPath() //返回该COOKIE的有效路径 。.
public boolean getSecure () / / return the COOKIE security settings. .
public String getvalue() //返回该COOKIE的值 。.
public void setDomain (java.. lang.. String pattern) / / set the effective field of the COOKIE. .
public void setMaxAge(int expiry) //设置该COOKIE的有效期,单位为秒 。.
public void setPath (java.. lang.. String uri) / / set the effective path of the COOKIE. .
public void setSecure(boolean flag) //设置该COOKIE的安全设置 。.
public void setvalue (java.. lang.. String newvalue) / / set the value of the COOKIE. .
} 。.
A COOKIE contains the following five parts:. .
NAME/value对,设置该COOKIE的名字及它保存的值 。.
COOKIE usually server related, if the field set to JAVA. . SUN. . COM, then the COOKIE on and the field related to the site only works when browsing the site, the browser will send the contents of the COOKIE server, COOKIE as part of HTTP HEADER to be sent, if not set a domain, then COOKIE COOKIE on only the server and create the associated. .
路径用于指定服务器上可以使用该COOKIE的文件所在的路径,它只对该网址下的该路径下的应用起作用。."/"表示服务器上所有目录都可以使用该COOKIE。.
COOKIE has a validity period of the default value is -1, which means that does not keep the COOKIE, when the browser exits, the COOKIE immediately be invalidated. .
安全选项true/false,如果设置为true,那么在服务端与在客户端之间传送该COOKIE的内容时,采用HTTPS协议。.
How to check a client whether to support the method COOKIE:. .
用下面的方法写一个COOKIE到客户端,并确认成功 。.
try. .
{ 。.
Cookie c = new Cookie ("mycookie", "COOKIE TEST");. .
response。.addCookie(c); 。.
). .
catch(Exception e) 。.
(. .
System。.out。.println(e); 。.
). .
然后在一个新的JSP文件中:用下面的方法取客户端的COOKIE到cookies中, 如果cookies。.length ==0,说明该客户端的浏览器不支持COOKIE 。.
try. .
{ 。.
Cookie [] cookies = request. . GetCookies ();. .
if(cookies。.length ==0) 。.
(. .
System。.out。.println("not support cookie"); 。.
). .
} 。.
catch (Exception e). .
{ 。.
System. . Out. . Println (e);. .
} 。.
7, JSP, and the difference between SERVLET:. .
SUN first developed a SERVLET, it features more robust, system design is also very advanced, but it prints the HTML statements or using old CGI, is a sentence output, so, write and modify HTML very inconvenient. Later, SUN launched a similar to ASP JSP, JAVA code nested HTML statement, this greatly simplifies and facilitates design and modification of Web pages. ASP, PHP, JSP is a nested type of SCRIPT language. A distributed system should be divided into three layers: presentation layer, business logic, data access layer, the J2EE architecture, SERVLET to write business logic is very powerful, but very convenient for writing the presentation layer. JSP is written primarily for the convenience of designed layer. ENTITY BEAN for data access layer, SESSION BEAN achieve business logic layer.If it is a simple application of the system, you can use JSP + BEANS of structure design, should be deposited only in JSP and presentation layer for anything, that is, only on the part of the output HTML page. And all the data calculation, data analysis, database connection handle, all belong to the business logic layer, should be placed in JAVA BEANS. JSP JAVA BEANS called for the integration of the two layers. In fact, Microsoft's DNA technology, simple, ASP + COM/DCOM technology. With JSP + BEANS completely similar, and all that layer by the ASP was completed, all the business logic from the COM / DCOM completed. Why should we use these components technology? Because pure ASP / JSP language is a very inefficient implementation, if there is a large number of user clicks, pure SCRIPT language quickly reached the limit of his capabilities, and component technology can greatly improve the function of the ceiling, accelerate the pace of implementation.On the other hand, pure SCRIPT language will be the presentation layer and business logic layer mixed together, resulting in the modification is not convenient, and the code will not be able to re-use, the use of component technology is changing components. For complex applications, you should use ENTITY BEAN implementation of the data access layer, SESSION BEAN implements the business logic layer, using JSP to call the SESSION BEAN, called by the SESSION BEAN ENTITY BEAN. Using JSP + EJB to construct a complex distributed systems. Than JSP + BEAN has a higher throughput, reliability, security. In summary, for simple applications, can use JSP + BAEN, complex application system, should be used JSP + EJB, SERVLET becomes insignificant. Can replace it entirely with JSP. Of course, do not forget structs A:). .
8 How to use errorPage and isErrorPage 。.
Example. .
index。.jsp 。.
/ / Which will invoke errorpage. . Jsp because nullpoint exception will happen during calling text. . Equals ("blah") at runtime;. .
but if you use null。.equals("blah") to replace text。.equals("blah"), index。.jsp will fail during compiling time。.
therefore it will not redirect to errorpage. . Jsp. .
<%@page errorPage="errorpage.jsp"%>
<%=System.currentTimeMillis()%>
<%String text=null
if(request.getParameter("subject")!=null)
{text=request.getParameter("subject");
text.equals("blah")}
%>
<%@page errorPage="errorpage.jsp"%>
<%=System.currentTimeMillis()%>
<%String text=null
if(request.getParameter("subject")!=null)
{text=request.getParameter("subject");
text.equals("blah")}
%>
<%@page errorPage="errorpage.jsp"%>
<%=System.currentTimeMillis()%>
<%String text=null
if(request.getParameter("subject")!=null)
{text=request.getParameter("subject");
text.equals("blah")}
%>
errorpage。.jsp。.
<% page isErrorPage="true"%>
An unexpected exception occurred:
The stack trace is:
<%exception.printStackTrace(new java.io.PrintWriter(out));%>
<% page isErrorPage="true"%>
An unexpected exception occurred:
The stack trace is:
<%exception.printStackTrace(new java.io.PrintWriter(out));%>
An unexpected exception occurred:. .
The stack trace is:。.
<%exception.printStackTrace(new java.io.PrintWriter(out));%>
9 PageContext. .
The PageContext object is an abstract helper object intended for use。.
by the container. . However, the PageContext can be used to store attrib-utes. .
(like session, request, and application) in the page scope。. The。.
PageContext object can also be used to access the other implicit objects. .
(e。.g。., the getRequest() method returns the Request object) and perform。.
dispatch methods (forward and include), which are identical to the for-ward. .
and include actions。.
Attributes Revisited. .
The most useful feature of PageContext is that it provides access to all。.
attributes a page can access, regardless of scope. . Thus you can use Page-Context. .
as a one-stop entry point for all of the attributes accessible by。.
the current page. .
The extended attribute methods have an extra integer parameter。.
with enumerated values of PAGE_SCOPE, REQUEST_SCOPE,. .
SESSION_SCOPE, and APPLICATION_SCOPE。. These scopes relate。.
to the different objects that are capable of supporting attributes. .
PAGE_SCOPE refers to the PageContext object。.
? setAttribute (), getAttribute (), removeAttribute ()-These. .
methods perform in a manner almost identical to that of the regu-lar。.
methods, with the exception of the added scope parameter. .
<%//sets Session attribute named "Test"
pageContext.setAttribute("BookTitle", "J2EE",
PageContext.SESSION_SCOPE); %>Listing 6。.18 Using the PageContext attribute methods。.
? getAttributeNamesInScope (scope)-This method returns a. .
Java。.util。.Enumeration object with the names (keys) of all of。.
the attributes in the specified scope. .
? findAttribute(key)—This method searches across all scopes。.
and returns the first instance of the named attribute. . The scope. .
search order is: page, request, session (if valid), and applica-tion。.
This is very useful if you have a default value (in applica-tion..
scope) that can be overridden by a local preference (session。.
scope). . If no attribute is found, null is returned. .
? getAttributeScope(key)—Returns the scope for the named at-tribute。.
If the attribute is not found, this returns an integer value. .
of 0。.
You can take advantage of these functions by setting default values in. .
your application or session object。. You can use PageContext to iterate。.
through the various scope levels in order to find the lowest-level defini-tion. .
of the attribute。. For example, imagine a web search engine that has。.
an optional parameter for the number of results to be returned. . You can. .
set a default value in the application object and override it locally in the。.
session or request object. . The PageContext object can select the value. .
with the narrowest scope。.
FAQ: What is J2EE. .
****** 版权声明 ********。.
* Retain this copyright notice in full and accept the following terms and conditions of the premise, you are free to access, store, use, modify, distribute this article. .
* You may obtain from third parties, the author of this article does not guarantee the correctness and consistency of this article.
* On the use of this article nor caused any direct or indirect economic loss or other damages, even if you have been informed of this risk in advance. .
* If you modify and distribute this document, and does not include any copyright notice, copyright notice automatically applied to your modifications and additions.
* If you modify and distribute this article, and add your copyright statement, you should clearly mark your modifications and additions, and declare your copyright notice applies only to modify and add your content, and the remaining content is still using the copyright notice . .
* If you are in the process of distributing this article directly or indirectly, intentionally or unintentionally profit, you should open a fully compatible and free copy of this article, the copy does not have to include your modifications or additions.
* Author: slhynju. .
* ?right 2003-4-9。.
*************************/。 .
I. prepare articles.
1 What is J2EE? It and the ordinary Java What is the difference? . .
A: the J2EE Platform, known as Java2 Enterprise Edition.
"J2EE platform is essentially a distributed server application programming environment - a Java environment, which provides:..
· A host application running infrastructure environment.
* A set of extensions used to create applications for Java API. "(Quote from" J2EE server-side high-level programming. ").
2 J2EE to learn?.
Answer: J2EE is a collection of many technologies and is still growing. .
You will encounter many proper names: for example, (X) HTML, Servlet/JSP, JDBC, JMS, JNDI, EJB, XML, Web Service ….
In particular, XML and Web Service is rapidly growing. Fortunately, you do not need to learn all the techniques until after the program began. .
J2EE generally can be divided into three major applications: Servlet/JSP, EJB, XML/Web Service and some of the supporting technologies such as JDBC and JNDI.
You can learn one by one. .
3 J2EE?.
A: used to build large, distributed enterprise applications. Or, more fashionable term that is "e-business" applications. .
These enterprises are likely to have a central database server, Web server clusters and nationwide Office Terminal, or it may be as small as just wanted to make a Web site.
4 University J2EE have a future? . .
A: in this market is only one kind of technology can be competitive and J2EE, Microsoft .NET.
Relatively speaking. . NET to the "new" number and J2EE to the "old" number. .
However, .NET used only for Windows-platforms (Microsoft claims to develop c # in Linux virtual machines but has not yet fulfilled the promise).
Taking into account the development momentum of Linux, you can trust. . NET does not dominate the world. .
5 it is said that J2EE performance as good, is .NET. really?.
A: In the sample program provided by Sun Pet Store on, Microsoft claimed that as the same. . NET program better. .
While Sun Company retorted that this program does not really reflect the performance of J2EE, and accused the Microsoft database optimized.
Author did not studied. . NET and can not jump to the next assertion. .
In any case, large, distributed performance bottlenecks in your first usually comes from bad design.
6 You said so much, I would like to learn to play. .
A: unless you wish to rely on it for a meal or as technical reserves, otherwise don't waste your time.
Flash should be much more fun. Computer games even more fun. .
7 learning J2EE how to start?.
A: First, download a J2EE server. Second, go to java. . Sun. . Com download J2EE's API. Third, find a good reference. Finally, find a dig in the IDE. .
J2EE server. You can use the Sun's J2EE SDK (free), or Weblogic (best performance, but is too big, but the author does not recommend piracy), or JBoss (free of charge, that is, the document is too low), or JRun (Developer Edition is free, the authors use this). Wrox Books author feels the J2EE server-side advanced programming of good, but too old (the author at hand is the Chinese version of 2001). You also need to download some of the latest technical information (of course, must be in English).
If your machine is configured IDE good enough (at least 512M RAM or above, 256M or less do not take into account), you can use IBM's WSAD, otherwise they continue to use Eclipse or any other. .
You can always go to smth Java Edition is a good idea, but in a post before you take a look at the essence of districts have the answers you want.
8 I have a J2EE server, but the next will not be configured. .
A: Please review the guidance documents, randomly different server configuration is different, the author can not help.
9, I found that you did not mention Tomcat. .
Answer: Tomcat is a Web server, more accurately, mainly just a Web Container.
If the words you want to learn EJB, Tomcat can not meet your needs. .
Second, the Servlet/JSP pages.
10 What is a Servlet? . .
A: a Servlet is a Java class. It handles Http (s) requests and responses, including returns an HTML page or go to another URL.
Servlet must run in a Web Container such as Tomcat. .
Javax Servlet must be. .servlet. .http. .HttpServlet subclasses,.
You can inherit doGet () or doPost () method, the two correspond Http (s) in the Get request and Post request. .
11 How do I get access to the HTTP request's parameters?.
A: HttpRequest the getParameter () method. For example: String paramValue = request. . GetParameter ("paramName");. .
12 How do I return a result?.
A: You can use the relevant API to open a output stream to write to the stream directly to an HTML page. .
But the author does not agree to do so. On the one hand, doing so is very verbose.
On the other hand from the Model-View-Controller pattern (in the "J2EE Core Model" which has been classified as Front Controller pattern) point of view. .
You should provide some HTML or JSP as a view (the view), and the Servlet is determined based on request parameters to which the view.
You can use the response. . SendRedirect (...) method or request. . GetDispatcher (...). . Forward () method to implement. .
13 sendRedirect () or forward ()?.
A: sendRedirect () is to redirect the browser sends a notification, the browser redirects to the new URL. .
The forward is on the server side to go directly to a new URL that is transparent to the browser.
The former browser's address bar shows the new URL, which the browser's address bar shows the Servlet's URL. .
Thus when the target URL is automatically refreshed, both of which can cause some differences.
14 I wrote a Servlet program, how to run it? . .
A: there is a program to develop J2EE deployment (deploy) concept is actually a development — deployment — running trilogy.
Most servers support the Hot deploy. You only need the appropriate Application directory (the specific path depends on the server) the following. .
The establishment of a WAR or EAR format (see 16, 17) directory, start the server, it can be visited through a browser.
In particular, your Servlet's class file should be placed in / WEB-INF/classes directory. .
Note the J2EE SDK does not support Hot deploy, you need to deploy through its tool to deploy.
Tomcat only supports the WAR format. .
15 EAR and WAR?.
A: EAR is a complete J2EE applications, including Web and EJB some parts. .
WAR is only one Web part.
16 EAR what format? . .
A: one EAR can contain any number of WAR or an EJB JAR and contains a META-INF directory.
In the / META-INF contains an application. . Xml, which describes what is included in the EAR module, and security configuration. .
Details see reference books.
17 WAR formats like? . .
A: a WAR contains a directory, this WEB-INF directory under the directory containing the lib directory of classes, and .xml.. the web.
/ WEB-INF/classes class organization to deposit a package file, / WEB-INF/lib directory storage jar file. .
.Xml web. describes a lot of things, please read reference books.
18 I should be placed in ordinary HTML file where? . .
A: in addition to/WEB-INF elsewhere, outside.
19 I can not access servlet, HTML file access even less! . .
A: first you do not start the server. The second you hit the wrong port. Third, you do not have the correct configuration context-path.
Fourth of your server does not support auto reload, or you turn off this option, you must restart the server. .
5 make sure you put HTML in/WEB-INF directory, it is not accessible.
20 I can not access HTML, but access to servlet. .
A: Please check your .xml file. web. Make sure you have the correct definition.
The former identifies a servlet, which will be a relative to the context-path of the URL mapped to a servlet. .
In Tomcat you can access the form through/context-path/servlet/package/servletname, servlet.
But this is only convenient access method Tomcat is not an official standard. .
Details see reference books.
21 What is JSP? What is difference between it and Servlet? . .
A: you can use JSP as an Extensible HTML..
Although, in essence, JSP file will be automatically translated into the corresponding server Servlet to perform. .
It can be said that the Servlet is a Java programmer and JSP are object-oriented HTML programmers, both features are completely equivalent.
22 shows the character of my JSP is garbled. .
A: in your JSP on line at the beginning.
<%@ page contentType=”text/html; charset=gb2312″%>If you have declared the page I think you know how to modify. .
23 JSP files are stored?.
A: In addition to / WEB-INF under anywhere. .
24 how can reference it in JSP Java Bean.
A: First, make sure you want to reference the class in the / WEB-INF/classes or in / WEB-INF/lib within one jar. .
Secondly, in the JSP Riga line.
25 I would like to pass data between the servlet.
A: The use of session. In the Servlet / JSP, you can save the data in four areas. .
1 page, this page).
2) session, used to store customer-related information, such as shopping cart, the corresponding interface javax. . Servlet. . Http. . HttpSession. .
Cookie session mechanism is essentially a Rewrite of the abstract and URL, the server automatically uses a cookie or URL Rewrite to achieve.
3) request, you can forward () when the transmission of information, the corresponding interface javax. . Servlet. . Http. . HttpRequest. .
4) application, or the information, the global context, the corresponding interface to javax. .servlet. .ServletContext.
26 how call cookie? . .
A: the author recommends using a session, you can always disable cookies certain users. This session will automatically use URL rewriting to achieve.
How to achieve 27 inside the JSP file to download? . .
Answer: actually this is a HTML problems. The answer is a hyperlink.
。
28 怎么实现文件上传?
答:客户端是HTML问题,在form中设置method为post,enctype为multi-part/form-data,加一个。
而在接收的servlet中只是一个I/O问题。
29 我想让页面自动刷新,比如聊天室。
答:这是一个HTML问题,在部分中加一条。
这是所谓的Clinet-push,客户端刷新技术。
30 我想让用户登录以后才能访问页面。
答:使用声明式安全措施。
你只需要在web.xml中定义安全角色(Role),并定义受保护的URL集合只能由特定Role访问。
大多数服务器支持基于数据库的用户映射,你只要在相应数据库中建立两张表并配置服务器就可以了。
注意J2EE SDK不支持基于数据库的用户映射。
细节请看参考书和服务器文档。
31 我想要能注册用户。
答:参看30。在接受注册请求的Servlet中执行写入数据库操作即可。
32 怎么在JSP中访问数据库?
答:标准做法是使用DAO模式,定义一个Java bean来访问数据库并在JSP中使用。
然而,当你的数据库模式很简单时,你可以使用JSTL中的
33 什么是JSTL?
答:JSTL是Jsp Standard Tag Library的缩写。这是一组通用标签并将成为JSP 2.0的一部分。
其中包含赋值
等。目前你需要像添加自定义标签库一样来添加JSTL,但是可以预计JSP 2.0会将JSTL作为组成部分。
标签库可以在 http://jakarta.apache.org 下载。注意JSTL需要在支持JSP1.2或更高版本的容器下运行。
帮助文件可以阅读sun的JSTL正式规范。
Table of contents
6.20 FAQ
Deployment
How can I deploy a library?
Can I deploy a read-only EAR?
What is delta deployment?
Do I need to connect Deploy Tool to SAP J2EE Engine to get an application
deployed?
What is the difference between deploying an application using the Deploy Tool,
the Visual Administrator and the server console?
How can I deploy an application with alt_dd.xml?
How and when to set security constraints for my applications, how to map them
to actual server users?
Can I deploy two applications with the same name?
How to use Deploy Manager API, what functions are provided?
Why does deployment of myapplication fail with ∪Error in compiling: maybe
javacnot found∩?
Why is javax.namingpackage not found when deploying an application?
Why does deployment of my application fail with IOException?
Why does deployment of my application hang on HP-UX and no error message is
shown?
Web Container and HTTP
How to disable directory browsing of a web application?
How to deny PUT access to web server resources?
How to configure my web application to use HTTPS client authentication
mechanism?
How to specify security constraints for a web application?
Can I change JSPs, servlet classes and descriptors of a web application without
redeploying it?
Can I deploy two web applications with the same name?
How can I deploy my application to be the default for the web server?
How to enable application tracing for web applications?
What information is logged for the web container and where can I find it?
Can I configure the web container to respond with custom reponse messages?
What formats of HTTP content and transfer codings does the web container
support?
Resource Adapters
How can I deploy a resource adapter?
Can I add additional properties to an already deployed resource adapter?
How can I lookup a resource-adapter connection factory instance?
How can I lookup a connection factory instance from a helper class in
additional library?
How can I configure the number of pooled connections?
Why do I get a ClassNotFoundException when deploying a resource adapter?
EJB Container
What do container type A and container type B mean?
What EJB properties can I administrate after deployment?
How can I lookup a bean from an RMI client (stand-alone Java program)?
How is database information for CMP entity beans described?
Is it possible for a bean to use helper classes from an additional library?
Can I start a new thread from a bean?
How can I lookup a bean from a class in an additional library?
How can I lookup a bean from another application?
Cluster Configuration
Are applications and libraries on server nodes synchronized?
What is the default_library.txt file for?
How to add a second server/dispatcher node on the same physical machine?
How to add a new server node located on a different physical machine to SAP
J2EE Engine cluster?
How to connect two dispatcher nodes running on different physical machines in
the cluster?
How to configure a SAP J2EE Engine node to start in background mode?
How to configure several nodes on one machine to run in background mode?
How to access the server or dispatcher to perform administrative functions when
SAP J2EE Engine is running in background mode?
When do configuration changes take effect?
How does Appclear Tool work?
How to specify SAP J2EE Engine memory settings?
Why does dispatcher/server startup fail when attempting to start Log Manager?
Why does server startup fail on DBMS service?
Why a SAP J2EE Engine server node cannot connect to a dispatcher node?
Why does server startup fail with java.net.BindException: Address in use:
JVM_Bind?
Why does SAP J2EE Engine startup on HP-UX fail with the following error
message: java.lang.OutOfMemoryError: unable to create new native thread?
XML Parser
How can I use SAPXMLToolkit in a stand-alone program?
How can I use SAPXMLToolkit in a deployed application?
How can I use Xerces parser in my application?
How can I use an HTTP proxy while parsing an XML?
Web Services
Can I register a bean as a port for a Web service in SAP J2EE Engine 6.20?
Where can I find the WSDL for a bean?
Do I have to deploy SOAPDispatcher in order to access Web Services framework?
What happens if I deploy the old soapdispatcher.ear?
How can I generate a proxy for the generated WSDL?
How can I use SAP’s SOAP implementation (inqmysoap.jar) with IBM’s UDDI4J?
How can I access a bean that had been deployed as a Web service?
Security
How to assign JNDI permission to a specific user?
How to restrict telnet access for a specific user application?
What additional libraries do I need to start Keystore and SSL services and
where should I put them?
What is the order of starting of Keystore Service and SSL Service?
How to install a server certificate?
How to generate a certificate-sending request?
How to self-sign a certificate?
How to load a certificate?
How to store a certificate/key?
Plug-ins Configuration and Remote Debugging
Where can I find information on how to configure JBuilder Plug-in?
Where can I find information on how to configure SAP J2EE Engine for remote
debugging?
Can I use JBuilder plug-in with SAP J2EE Engine cluster version?
Why is documentation Start Page no longer shown under http:\\localhost when the
server is started through JBuilder?
Monitoring
How to start the monitor server?
How can the monitored data be viewed or stored?
How can I change the monitor server startup properties?
What additional libraries do I need to export data to CCMS?
Why my monitor server cannot connect to SAP J2EE Engine cluster?
Integration
How is the communication between an SAP R/3 Dispatcher and SAP J2EE Engine
accomplished?
Where to find information on how to enable redirect from ICM to SAP J2EE
Engine?
Administration APIs
How to programatically obtain the client JAR that has been generated at
deployment time?
How to perform programatic startup of a service?
How to retrieve logs for a specific service, a manager, or whole cluster node?
How to retrieve a communication service port on a specified cluster node
How to retrieve all existing users on SAP J2EE Engine?
How to obtain information about a specific user?
How to connect to SAP J2EE Engine from a client with httptunneling layer?
P4 Service
How can I generate stubs with remote support for rmi_p4?
Can I use standard RMIC to generate stubs
Is UnicastRemoteObject supported by rmi_p4?
Are the remote classes dinamically downloaded or they must be specified in the
classpath of the RMI client?
How to use RMIC Tool?
JMS
Does SAP J2EE Engine JMS implementation support persistent messages?
Does SAP J2EE Engine JMS implementation support JTA XA API?
Does SAP J2EE Engine JSM implementation supports user/password verification
when creating connections?
How can I administrate jms destinations on SAP J2EE Engine?
Class Loading
How does SAP J2EE Engine’s class loading system work?
What kind of references between loaders can be set?
How to set a reference from an application to a library?
How to set a reference from a library to another library?
How to set a reference from a service to another service or to a library?
How to reference a library or a service from the default application?
How to reference a service or a library from a Resource Adapter?
How to deregister a reference?
Where can I put property files needed by an application so they can be loaded?
Why do I get a ClassNotFound exception when deploying or starting an
application?
Why do I get a ZipException when deploying a library or starting an
application?
Why do I get a java.lang.UnsatisfiedLinkError after restarting an application
or a pool?
Why do I get a ZipException when deploying a library or starting an
application?
Why do I get a java.lang.UnsatisfiedLinkError after restarting an application
or a pool?
6.30 FAQ
Problem: Engine stops after running only for an hour.
Possible cause:
Check:
Solution: Install a new license.
6.20 FAQ
Deployment
How can I deploy a library?
To deploy an additional library with helper classes that will be used by more
than one J2EE applications on SAP J2EE Engine, you can use Deploy Tool, the
changelib shell command or DeployManager? API. Using an additional library is
recommended only when several applications need access to its classes,
otherwise it is better to bundle the JAR files with the helper classes in the
enterprise archive file.
For more information about Deploy Tool and DeployManager? API, see Deployment
Manual.
For more information about the Deploy Service shell commands, see
Administration Manual -> Shell Commands Reference.
Can I deploy a read-only EAR?
Yes, you can do this using each of the deployment tools distributed with SAP
J2EE Engine, namely Deploy Tool, Deploy Service Runtime tab in the Visual
Administrator or Deploy Service shell commands. None of these tools changes the
original EAR file. Deploy Tool and Visual Administrator unpack it and generate
a new temporary EAR file to be deployed, whereas the deploy shell command takes
the original one but makes no changes.
What is delta deployment?
Delta deployment (also referred as application update) is a feature of SAP J2EE
Engine Deploy Service that allows for updating those parts of a specific
application that are new or have been modified. This function is available in
Deploy Tool, Deploy Service Runtime tab in SAP J2EE Engine Visual Administrator
and the Deploy Service update shell command.
Do I need to connect Deploy Tool to SAP J2EE Engine to get an application
deployed?
When Deploy Tool and SAP J2EE Engine run on the same physical machine it is
possible to deploy your application without explicitly establishing a
connection, since default values for host, port, username and password are
provided. Establishing a connection is necessary to display server users and
map application security roles. If Deploy Tool and SAP J2EE Engine run on
different physical machines, or port configuration of p4 Service has changed,
logging in and establishing a connection between them is obligatory.
What is the difference between deploying an application using the Deploy Tool,
the Visual Administrator and the server console?
There is no difference in the outcome when deploying an application through
Deploy Tool, Visual Administrator or the server console. However, when
deploying with Deploy Tool and SAP J2EE Engine Visual Administrator the
enterprise archive file is unpacked, and some properties such as environment
entries, resource references, context parameters, security roles, and mapping
can be changed. When deploying through the server console the ear file is not
unpacked, and no properties can be changed.
How can I deploy an application with alt_dd.xml?
You can deploy an application with alt_dd.xml on SAP J2EE Engine using Deploy
Tool, Deploy Service Runtime tab in the Visual Admnistrator and Deploy Service
deploy shell command. However, it is not possible to create the alt_dd.xml file
with Deploy Tool. You have to write it manually and include it as an additional
file in the application archive.
How and when to set security constraints for my applications, how to map them
to actual server users?
You can set security constraints for an application at deployment time using
Deploy Tool and SAP J2EE Engine Visual Administrator. With both tools you can
create security roles and map them to actual server users for each application
component, as well as for the entire application. SAP J2EE Engine Visual
Administrator allows for changing security roles and user mappings for EJBs
after deployment. You can do this from EJB Service Runtime control tab.
Can I deploy two applications with the same name?
No. Display names of applications on SAP J2EE Engine have to be unique. If you
attempt to deploy an application with the same name as another one, the first
application will be replaced. The same is true for EJBs with identical names.
If the context root of the web part of an application has the same name as an
already existing context root, a DeploymentException? is thrown.
How to use Deploy Manager API, what functions are provided?
You can use Deploy Manager API for configuration, deployment and update of
applications, as well as for deploying libraries and setting references between
loaders. It can be used either programmatically or through the deploymanager
script file located in
script takes as a parameter Deployer.xml file that describes the application,
necessary libraries and references from the application to other loaders (if
any). For more information about Deploy Manager Interface methods and the DTD
of Deployer.xml file, see Deployment Manual.
Why does deployment of myapplication fail with ∪Error in compiling: maybe
javacnot found∩?
The reason is javac is not specifiedin PATH variable. Include the directory
path to javac inyour PATH variable. This solution works properly fordeploying
all types of application components.Alternatively, you can also change the
correspondingproperties of Servlet_jsp Service or EJB Service topoint to the
javac location. For example, if you set theExternalCompiler property of
Servlet_jsp Service topoint to the javac location, it works for deploying
webapplications only. This means that if you try to deployEJBs, you will still
get that error. To be able todeploy EJBs you have to set the
ExternalCompilerproperty? of the EJB Service to point to the javaclocation too.
A possible reason for this exception mightbe also an error in compiling as
denoted by its errormessage.
Why is javax.namingpackage not found when deploying an application?
The javac that is specified in thePATH is an older version. For example, javac
version1.2.2 or lower is used instead of version 1.3). Includethe path to javac
with the proper version in your PATHvariable?. This solution works properly for
deploying alltypes of application components. Alternatively, you canalso change
the corresponding properties of Servlet_jsp Service or EJB Service to point to
the appropriate javac location. For example, if you set the ExternalCompiler?
property of Servlet_jsp Service to point to the appropriate javac location, it
works for deploying web applications only. This means that if you try to deploy
EJBs, you will still get that error. To be able to deploy EJBs you have to set
the ExternalCompiler? property of the EJB Service to point to the appropriate
javac location too.
Why does deployment of my application fail with IOException??
There are several possible reasons for this behavior: either your EAR file is
corrupted or there is not enough free disk space on the machine where you are
trying to deploy the application.
In case of a corrupted EAR file, double-check on its integrity.
In the other case, you must free enough disk space on your machine for the EAR
file to be deployed.
Another possible reason is using a third party XML parser that cannot get the
necessary document type definition (cannot pass through proxies). It is
recommended not to use different parsers than inqmyxml for component generation
and deployment on SAP J2EE Engine.
Why does deployment of my application hang on HP-UX and no error message is
shown?
There is a known problem in JDK version 1.3.1.02 on HP-UX, which sometimes
prevents the normal socket closing. Add the -XdoCloseWithReadPending? property
to the go script file of the server after the classpath and then restart it.
Web Container and HTTP
How to disable directory browsing of a web application?
You have two options to do this: using the Visual Administrator and editing the
properties file of the HTTP Service.
When using the Visual Administrator, you have to go to HTTP Service on server
node, and select the ∪Properties∩ tab. Then you must uncheck the ∪Directory
List∩ property in ∪Infer Names∩ pane. Another option is to edit the DirList?
property of Http Service thorugh the shell command setprops in the server
console.
If you choose to edit the properties file that is located in
set the DirList? property to ∪false∩.
How to deny PUT access to web server resources?
You must edit the web.xml descriptor of the web application that you want to
protect from being accessed by PUT requests. This is usually done at
application assembling phase. If you have already deployed your application
without restricting PUT access to it, you still have the opportunity to set
such restriction. You must edit the web.xml file for this application, which is
located under the
directory. However, you are not recommended to set the constraint that way! In
addition, you cannot set security roles and user mapping at runtime. Even if
you define such in the deployment descriptor, they will not take effect!
Security roles and user mappings are defined at application assembling phase!
You can deny access to various web server resources for other HTTP methods as
well. It is done the same way as for PUT method.
For more details on how to edit application∏s descriptor, see Administration
Manual -> Configuration Tasks -> How to Set up SAP J2EE Engine 6.20 Web Server
-> Setting Security Constraints section of the SAP J2EE Engine documentation.
For detailed description of the web application∏s deployment descriptor DTD,
see Java Servlet 2.3 Specification.
How to configure my web application to use HTTPS client authentication
mechanism?
You may complete this configuration task by editing the deployment descriptor
of your web application. You must set CLIENT-CERT value to the auth-method (#PCDATA)> element of the descriptor. For more information about
deployment descriptor DTD, see Java Servlet 2.3 Specification.
How to specify security constraints for a web application?
As defined in Java Servlet 2.3 Specification, a security constraint is defined
for a web resource collection and consists of authorization constraint and/or
user data constraint.
You may set the security constraints for your web applications either by
manually editing the web application∏s deployment descriptor, or using the
Deploy Tool. This must be done at application assembling phase only! If you try
to do it after deployment, changes will not take effect. At runtime, you can
only define user mapping to existing security roles using the Security Service
Runtime tab in the Visual Administrator.
If you decide to manually edit the deployment descriptor, you may refer to the
Java Servlet 2.3 Specification for a detailed DTD description. You can also
find the definitions of web resource collection, authorization constraint and
user data constraint terms there.
If you choose to use Deploy Tool, you may refer to Deploy Manual -> Deploy Tool
-> Generate J2EE Components section for information about how to do that.
Can I change JSPs, servlet classes and descriptors of a web application without
redeploying it?
Yes, you can change JSPs without redeploying the application and you even do
not need to restart it. Servlet classes and descriptors can also be changed
without redeploying the application, but they require that application be
restarted. However, we do not recommend that you change JSPs, servlets classes
or descriptors of running application that way. It may cause errors in various
cases. For example, when updating or redeploying an application, these changes
are lost, or when adding a new cluster element, these changes may be lost after
synchronization. You can use this approach of changing applications only for
testing or debug purposes!
Can I deploy two web applications with the same name?
No. The web container will reject (not deploy) a web application if another web
application with the same name was already deployed. For more information, see
Java Servlet 2.3 Specification, section 9.5 ∪Directory Structure∩.
How can I deploy my application to be the default for the web server?
To do this, you must give the
descriptor of the EAR you want to deploy, the value of ∪/∩ or ∪∩ (an empty
string). For example, if the following tags are present in the application∏s
application.xml:
Examples
examples.war
/
the application named ∪Examples∩ will be deployed as the default one for the
web server.
For more information about the application XML DTD, see Java 2 Platform
Enterprise Edition Specification, version 1.3.
How to enable application tracing for web applications?
SAP J2EE Engine application tracing mechanism allows you to log information
about user calls to different modules of the system. You can find description
of the procedure of enabling application tracing in Administration Manual ->
Configuration Tasks -> Setting up SAP J2EE Engine 6.20 for Application Tracing.
You can also find more information about what kind of events are logged for the
web container when different trace levels are set there.
What information is logged for the web container and where can I find it?
First, the location of the log files for different web container components
depends on your settings of the corresponding properties of HTTP Service and
Servlet_jsp Service. The explanation below is made for the default web
container settings that consern logging. If you have made certain changes of
these settings, you have to consider them in order to find the appropriate
information.
By default, logs about all requests and errors that appeared in HTTP Service
are saved in INFO.log. This file is located in
entry in this file contains information about the IP address of the client
machine, the first line of the request (the request method), the response
status returned and the number of bytes returned. In case of a request to a
servlet, the number of bytes returned takes the value of 0. In case of a PUT
request, the number of bytes of the request body received is logged instead of
the number of bytes returned.
HTTP Service may log in Common Log Format. In this case, the log messages are
save in http.log that is located in
All errors that occurred, as well as all servlets that had been initialized by
Servlet_jsp Service are logged in INFO.log by default. This file is located at
also contains log messages for other services.
If application tracing is enabled, more information is logged. It depends on
the trace level that you have set. Log messages of traced components are saved
in DEFAULT.log file that is located in
more information about the different trace levels and actions that can be
traced, see Administration Manual -> Configuration Tasks -> Setting up SAP J2EE
Engine 6.20 for Application Tracing.
Can I configure the web container to respond with custom reponse messages?
Yes, you can. To do this, you must define the response codes and the
corresponding messages in the web application∏s deployment descriptor. You
have to edit the element of the
descriptor. For more detailed description on how to do it, see Administration
Manual -> Services Administration Reference -> Servlet_jsp Service -> Critical
Information.
What formats of HTTP content and transfer codings does the web container
support?
It supports gzip and chunked codings (defined in HTTP 1.1 Specification, RFC
2616). You have to be aware that these codings are applied to responses only!
Resource Adapters
How can I deploy a resource adapter?
To do this, you can use either Visual Administrator or Console Administrator
tool.
In Visual Administrator use the ∪Runtime∩ tab of EISConnector? Service, which
is described in detail in Administration Manual > Services Administration
Reference > EISConnector? Service.
You can deploy a resource adapter using register_connector command from the
EISCONNECTOR command group. For information about this command, see
Administration Manual > Shell Commands Reference > EISCONNECTOR.
Can I add additional properties to an already deployed resource adapter?
No. The ∪Config Properties∩ sub-tab of EISConnector? ∪Runtime∩ tab in
Visual Administrator enables you only to edit the value of existing
configurable properties or create a new ManagedConnectionFactory? instance
configured with the same properties.
We recommend you to avoid creating new ManagedConnectionFactory? instances.
For information about the ∪Config Properties∩ sub-tab, see Administration
Manual > Services Administration Reference > EISConnector? Service.
How can I lookup a resource-adapter connection factory instance?
The following code illustrates how to lookup a connection factory:
// Obtain initial context
Context ctx = new InitialContext?();
/* Perform the JNDI lookup operation to obtain a connection factory instance.*/
javax.resource.cci.ConnectionFactory cf =
(javax.resource.cci.ConnectionFactory)
ctx.lookup (∪java:comp/env/
To lookup a connection factory instance, use the resource reference name, which
is specified in the
relevant component (that is, either ejb-jar.xml or web.xml).
How can I lookup a connection factory instance from a helper class in
additional library?
To do this, you must set a reference from this library to EISConnector? Service
in reference.txt (reference
lookup the connection factory instance by its name from the EISConnections?/
context in the Naming with the standard context properties for a stand-alone
client.
For information about editing reference.txt, see Administration Manual >
Configuration Tasks > Configuration of Additional Libraries. We recommend that
you use the Shell commands or the Deploy Tool rather than edit reference.txt
and library.txt manually.
How can I configure the number of pooled connections?
You can do this using the properties of EISConnector? ServicePoolSize? and
GranularSize?. For information about these properties, see Administration
Manual > Services Administration Reference > EISConnector? Service.
Why do I get a ClassNotFoundException? when deploying a resource adapter?
A possible cause for this exception is that the resource adapter uses an
additional library, which cannot be found.
Deploy the additional library and set a reference from the resource adapter to
the library (reference
EJB Container
What do container type A and container type B mean?
EJB Container type A and EJB Container type B are used for bean managed entity
beans. An EJB Container of type A manages a single instance for each primary
key of the bean during all transactions that currently use this entity. The
parallel calls from different threads are serialized. An EJB Container of type
B supports different instances for all transactions that currently use that
entity. For more information, see EJB 1.1 Specification, section 9.1.10
What EJB properties can I administrate after deployment?
The following properties can be modified from the runtime tab of the EJB
Service in SAP J2EE Engine Visual Administrator:
Security Tab
- the access to methods
- the mapping of security roles to users and groups
- the links of the security roles references
- new security roles can be added
- existing security roles can be removed
Environment Tab
- the value of an existing environment entry
References Tab
EJB References
- the lookup name of the referenced Bean (in the ∪Reference Link∩ field)
Resource References
- the reference link to the resource (in the ∪Resource Link∩ field)
- the user name for the predefined resource references
- the password for the predefined resource references
Additional Tab
- the display name of the bean
- the bean description
Storage Tab
- the name of the database pool
- the names of the database tables
- the names of the columns in the database tables
- the SQL criteria of the finder methods
How can I lookup a bean from an RMI client (stand-alone Java program)?
You must create the InitialContext? using the standard properties:
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
“com.inqmy.services.jndi.InitialContextFactoryImpl”);
properties.put(Context.SECURITY_PRINCIPAL, “Administrator”);
properties.put(Context.SECURITY_CREDENTIALS, “”);
properties.put(Context.PROVIDER_URL, “host:port”);
InitialContext ctx = new InitialContext?(properties);
Security principal can be any user in the system that has lookup permission for
the root context. In this way, a connection over rmi_p4 (SAP J2EE
Engine-specific protocol) is established. From this context the EJB will be
looked up by name, specified by the
However, to lookup the EJB and to create its instance, the client∏s
classloader needs the EJB client jar, located in
appName/cljarAppName.jar. This client jar must be specified in the client∏s
classpath, since SAP J2EE Engine does not support dynamic downloading of remote
stub classes.
Note: This must be used only in order to develop simple tests, not for working
scenarios. We recommend that you use application client, servlet, JSP or
another bean instead of a stand-alone Java program.
How is database information for CMP entity beans described?
The database information for CMP entity beans is described in a SAP J2EE
Engine-specific XML file calledstorage.xml. It must be located in the META-INF
directory in ejb.jar file, which is part of the application∏s archive file.
SAP J2EE Engine Deploy Tool provides options for generating and modifying
storage.xml. Alternatively, you can write your own storage.xml, but make sure
you keep the right format for storage.xml exactly as described in the
documentation.
The structure and the contents of storage.xml are described in Deployment
Manual in SAP J2EE Engine documentation.
Is it possible for a bean to use helper classes from an additional library?
Yes, it is possible. The additional library containing the helper classes must
be deployed (registered) either by using SAP J2EE Engine Deploy Tool or the
changelib shell command on the server command line. Then, a reference from the
application to the specific library must be set either by using Deploy Tool or
by using the changeref shell command on the server command line.
For more information about how to deploy libraries, see Deployment Manual.
For more information about how to register references between loaders, see
Administration Manual.
Can I start a new thread from a bean?
No, according to the Enterprise JavaBeans? 1.1 Specification (Section 18.1.2
Programming restrictions) thread management is performed by the EJB Container
and Enterprise JavaBeans? must not attempt to manage threads, which includes
starting, stopping, suspending, or resuming a thread; or changing a thread∏s
priority or name. Enterprise JavaBeans? must not attempt to manage thread
groups either.
These requirements ensure that the Container properly manages the runtime
environment.
How can I lookup a bean from a class in an additional library?
The additional library that contains the helper class must be deployed
(registered) and a reference from its loader to the application loader must be
set. Then, if the additional library is on a server in the same cluster as the
EJB application, the lookup is performed as with a stand-alone Java
programInitialContext is created using the standard properties and the EJB is
looked up by its name. The only difference between performing a lookup and
using EJBs from a stand-alone program, and a class in an additional library is
that no EJB client JAR is needed for the helper class in a library. However, if
the additional library is on a server node on a cluster different from the one
in which the EJB application is deployed, the Initial_context_factory property
for creating initial context should have the following value:
com.inqmy.services.jndi.RemoteInitialContextFactoryImpl, or the additional SAP
J2EE Engine-specific property force_remote should be set to ∪true∩. The
client JAR of the EJB application must be available to the additional library
(that is, it must be included in its JAR file or registered as a separate
library, to which a reference must be set).
How can I lookup a bean from another application?
If a bean from one application must be accessed by a JSP, servlet or another
bean from another application in the same cluster, it is enough to specify an
EJB reference (
bean and register a reference between the loaders of the applications. Then the
lookup is performed in the usual way, as if the bean is in the same
application:
javax.naming.Context context = new InitialContext?();
Object objRef = context.lookup(“java:comp/env/refName”);
UseMessageBeanHome usemessagebeanhome =
(UseMessageBeanHome?)PortableRemoteObject.narrow(objRef,
UseMessageBeanHome?.class);
If the two applications are deployed on different clusters, the one from which
the lookup will be performed should have access to the client JAR of the bean.
Here, the lookup procedure is the same as the one described for lookup of a
bean from an additional library located on a second cluster.
Cluster Configuration
Are applications and libraries on server nodes synchronized?
Yes. All applications and libraries that they use are synchronized on every
server node in SAP J2EE Engine cluster.
What is the default_library.txt file for?
This file describes the libraries that SAP J2EE Engine needs to run properly.
They are provided by default with its installation. The default_library.txt
file is located in
recommend you to avoid editting this file manually, since it is for internal
server use only.
How to add a second server/dispatcher node on the same physical machine?
SAP J2EE Engine provides a tool for creating additional server and dispatcher
nodes. Config Tool that is located in
directory has a visual and a command line interface that allow for quick and
easy startup of new SAP J2EE Engine cluster nodes.
For more information about how to use Config Tool, see Administration Manual ->
Administration Tools -> ConfigTool?.
You can add new cluster nodes by manually changing the property files of
services and managers as well. This procedure is thoroughly described in
Administration Manual -> Administration of SAP J2EE Engine 6.20 Cluster ->
Adding Nodes to SAP J2EE Engine 6.20 Cluster.
How to add a new server node located on a different physical machine to SAP
J2EE Engine cluster?
Adding a new node to an existing cluster on a different physical machine cannot
be performed with SAP J2EE Engine Config Tool, since it is for local use only.
For example, to configure a cluster installation with the following structure:
- Machine A with dispatcherA and serverA running on it
- Machine B with server B running on it
you must complete the following steps:
1. Install SAP J2EE Engine on machine A
2. Install SAP J2EE Engine on machine B
3. Run Config Tool on machine B and change the ClusterHosts? property of
Cluster Manager on the server node so that it contains the
4. Make sure the new server node has a different name and cluster ID from those
used so far.
5. Set the LocalLoadBalancing? property of Service Manager on the dispatcher to
false, so that requests are dispatched to each server in the cluster. If this
property is set to true, requests from the dispatcher are sent only to the
servers on the same physical machine.
6. Start the nodes.
How to connect two dispatcher nodes running on different physical machines in
the cluster?
To configure a cluster with the following structure:
- Machine Adispatcher A, serverA
- Machine Bdispatcher B, server B
you must complete the following steps:
1. Install SAP J2EE Engine on machine A
2. Install SAP J2EE Engine on machine B
3. Run Config Tool on machine A and change the ClusterHosts? property of
Cluster Manager on the dispatcher node so that it contains the
4. Run Config Tool on machine B and change the ClusterHosts? property of
Cluster Manager on the dispatcher node so that it contains the
5. Make sure that all cluster nodes have different names and IDs?
6. Set the LocalLoadBalancing? property of Service Manager on both dispatchers
to false, so that requests from each dispatcher are dispatched to each server
in the cluster. If this property is set to true, requests from each dispatcher
are sent only to the servers on the same physical machine.
7. Start the nodes.
How to configure a SAP J2EE Engine node to start in background mode?
You can use SAP J2EE Engine Config Tool for configuring a cluster node as a
Windows service or UNIX daemon. The procedure is thoroughly described in
Administration Manual -> Administration Tools -> ConfigTool? -> SAP J2EE Engine
6.20 as an NT/2000 Service or a Unix Daemon.
How to configure several nodes on one machine to run in background mode?
To run more that one server node in background mode on the same physical
machine, first you have to configure the nodes as service/daemon as described
in Administration Manual -> Administration Tools -> ConfigTool? -> SAP J2EE
Engine 6.20 as an NT/2000 Service or a Unix Daemon. Then manually change
Service_i_name parameter in service.ini file generated in
where ∪i∩ is the service number (each node must have a unique name) and start
it.
How to access the server or dispatcher to perform administrative functions when
SAP J2EE Engine is running in background mode?
When SAP J2EE Engine is running in background mode as NT/Windows 2000 service
or UNIX daemon, you can obtain access to the server or dispatcher using Telnet
Service. To use Telnet Service start a telnet session to the host of the
dispatcher with the same port as that of the port of Telnet Service (default
value is 2323). Use SAP J2EE Engine Visual Administrator to view the telnet
port configurationgo to Dispatcher > Services > telnet and check the port
property. This gives you access to the dispatcher node. You can use the jump
command from the dispatcher telnet console to reach a server node telnet
console.
For more information about how to connect to SAP J2EE Engine using telnet and
how to use the jump command, see Administration Manual -> Configuration Tasks
-> Remote Administration Using Telnet.
When do configuration changes take effect?
Runtime configuration changes (for example, changing a property in a runtime
control of a specific service from SAP J2EE Engine Visual Administrator) take
effect immediately.
You can change services∏ and managers∏ properties with Visual Administrator,
using the shell commands and by manually editing the corresponding property
file. Changing a manager∏s property or a core service∏s property by one of
the above-described ways requires a restart of the whole system. Changing a
property of an additional service requires a restart of the specific service
only. This restart is performed automatically when using Visual Administrator
or shell commands. However, if you change additional service property manually
from a property file, you have to take care about restart.
How does Appclear Tool work?
Appclear Tool that is distributed with SAP J2EE Engine installation, performs a
cleanup of the internal database management system, the work directories of all
containers, as well as their log files and removes all applications that are
deployed on the specific server node, respectively. It also removes all runtime
settings and tunings of the system that are not saved in property files.
Appclear Tool must not be run when the specific server node is started. Stop
it, run appclear tool and then start it again.
How to specify SAP J2EE Engine memory settings?
You can specify system memory settings for SAP J2EE Engine at installation
phase. The installation tools provide a property Maximum java heap size that
can be set prior to installing the server. If you need to change the memory
settings after installation, you must modify go script and cmd_line.properties
files of the relevant cluster node. Changes in cmd_line.properties affect the
memory used when starting SAP J2EE Engine in background mode, and go script
refers to starting it in foreground mode. In go script you must modify the
MEMORY parameter to the desired valuefor example, set MEMORY=256M sets the
maximum heap size to 256 megabytes. In cmd_line.properties you must modify the
Dmemory.manager and Xmx parameters. For example, to set the memory to 256M
enter the following in cmd_line.properties:
-Dmemory.manager=256M -Xmx256M?. You can also change Cmd_line properties using
SAP J2EE Engine Config Tool.
Why does dispatcher/server startup fail when attempting to start Log Manager?
The possible cause of this problem is not enough free disk space. To solve it
you just have to free some space on the disk of your machine.
Why does server startup fail on DBMS service?
The possible causes of this problem are:
- not enough free disk space;
- no write permission (for writing on the file system) for the user account,
with which SAP J2EE Engine is started;
- appclear script has been started while a server node was still running.
In the first of the above cases, you have to free enough disk space on your
machine. In case of no write permission for the user, you have to grant such
for that user. In the third of the above cases, you have to stop SAP J2EE
Engine, then run appclear script, and after that, you can start the system
again.
Why a SAP J2EE Engine server node cannot connect to a dispatcher node?
A possible reason for this behavior might be the wrong port configuration of
Cluster Manager on both dispatcher and server nodes. Make sure the value of one
of the entries for ClusterHosts? property of the Cluster Manager of the server
node corresponds to the JoinPort? property of the Cluster Manager on the
dispatcher node.
If starting SAP J2EE Engine in an SAP R/3 system environment, the insufficient
Security Service timeout could cause startup failure. Every time SAP J2EE
Engine starts in SAP Web AS environment, its Security Service tries to load the
SAP R/3 users. It connects to the SAP Web AS as SAPJSF user via JCo. In some
cases (for example, when the user does not exist or R3Security?.properties file
is incorrect) JCo returns too late, which causes SAP J2EE Engine∏s Service
Manager to raise “Timeout starting core services” and to stop the system. The
solution is to set greater values to CoreLoadTimeout? and
AdditionalLoadTimeout? properties of Service Manager.
Why does server startup fail with java.net.BindException: Address in use:
JVM_Bind?
Some ports used by SAP J2EE Engine could be busy. Generally, startup of
communication services such as P4 Service, HTTP Service, Monitor Service or
Telnet Service, as well as Cluster Manager, could fail if their ports are busy.
Use netstat a in a command prompt to see all ports that are busy, and free
those needed by SAP J2EE Engine, or change the port properties of communication
services.
Why does SAP J2EE Engine startup on HP-UX fail with the following error
message: java.lang.OutOfMemoryError: unable to create new native thread?
The reason for this behavior is wrong configuration of operating system kernel.
To solve it, set the following kernel params: max_thread_proc 256 (or more) and
nkthread 7200 (or more).
XML Parser
How can I use SAPXMLToolkit in a stand-alone program?
To use the SAPXML Toolkit in a stand-alone program, you can set the following
system properties:
javax.xml.parsers.DocumentBuilderFactory=
com.inqmy.lib.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory= com.inqmy.lib.jaxp.SAXParserFactoryImpl
javax.xml.transform.TransformerFactory=
com.inqmy.lib.jaxp.TransformerFactoryImpl,
or make sure the SAPXMLToolkit.jar is set in your CLASSPATH. This file must be
set before any other XML parser’s JAR file.
How can I use SAPXMLToolkit in a deployed application?
To use SAPXMLToolkit, you must register a reference to it from your
application. This can be done at deployment time using either Deploy tool or
the Deploy Service CHANGEREF command. Another possibility is to manually edit
reference.txt file located in
If you choose to manually edit reference.txt file, which is not recommended in
any way, add to it the following line:
reference
How can I use Xerces parser in my application?
There are three possible ways to use Xerces parser in your application:
1. Register Xerces as an additional library on SAP J2EE Engine. You can do this
using the Deploy Service CHANGELIB command or manually copy the archive file in
nodes and
server nodes. Then add the following line in library.txt file located in
dispatcher nodes and in
directory for server nodes:
library xerces xerces.jar
Then register a reference from your application to the Xerces library, using
the CHANGEREF shell command of Deploy Service, or manually in reference.txt
file located in the same directory as the above mentioned library.txt.
2. If you are using the Xerces parser in classes that are included in a WAR
file, add xerces.jar in the Web-Inf/lib directory in the WAR.
3. Add xerces.jar to your applications EAR.
How can I use an HTTP proxy while parsing an XML?
You must set the http.proxyHost and http.proxyPort system properties.
Web Services
Can I register a bean as a port for a Web service in SAP J2EE Engine 6.20?
You cannot register a bean as a port for a Web service. This feature is
supported by SAP J2EE Engine 6.30. However, with 6.20 version you can call a
method of the bean through SOAP.
Where can I find the WSDL for a bean?
You can find the bean∏s WSDL at the following URL:
http://localhost/soapdispatcher?WSDL=
name of your bean.
Do I have to deploy SOAPDispatcher? in order to access Web Services framework?
No. SOAPDispatcher? is a default application. To access Web Services framework,
enter http://localhost/soapdispatcher in the address bar of your browser.
What happens if I deploy the old soapdispatcher.ear?
It replaces the default SOAPDispatcher?. This affects the application
performance since the EAR contains older classes.
How can I generate a proxy for the generated WSDL?
Use the WSDL ProxyGenerator? in order to generate the proxy. For more
information, see 6.1. SAP J2EE Engine SOAP Proxy Generator section in the Web
Services document.
How can I use SAP’s SOAP implementation (inqmysoap.jar) with IBM’s UDDI4J?
You have to set the following system property:
org.uddi4j.TransportClassName= com.inqmy.lib.soap.uddi4j.InQMySOAPTransport
For more information, see the 7. UDDI4J Pluggability section in the Web
Services document.
How can I access a bean that had been deployed as a Web service?
To use the deployed bean, generate a proxy using the ProxyGenerator? and call
the proxy methods (the WSDL of the service is also required). For more
information, see 3. Setting up Web Services Framework and 6.1 SAP J2EE Engine
SOAP Proxy Generator sections in the Web Services document.
Security
How to assign JNDI permission to a specific user?
Assigning JNDI permissions to a specific user can be performed through Naming
service runtime panel in Visual Administrator. Choose the JNDI context and the
user or group for which permissions are granted. Then with the “<<” button you
can grant permissions for a specific context, and with the “<<<” you can grant
permissions for a specific context and all its subcontexts. The same applies
for denying specific permissions to users or groups. With the “>>” button you
deny permission for the specific context and with the “>>>” button for the
specific context and all its subcontexts.
How to restrict telnet access for a specific user application?
You can restrict telnet access for a specific user using the Security service
runtime panel (Resources tab) in Visual Administrator. From the Resources tree
choose System >telnet and grant or deny access to the users from Users on
Server tree.
What additional libraries do I need to start Keystore and SSL services and
where should I put them?
To start Keystore and SSL services on SAP J2EE Engine, you need the IAIK
package, namely iaik_jce.jar, iaik_jsse.jar and iaik_ssl.jar, w3c_http.jar. The
archives can be downloaded from the IAIK official site. You must put the jar
files in additional-lib folder of each cluster node:
- ../cluster/dispatcherName/additional-lib/
- ../cluster/serverName/additional-lib/
- ../alone/additional-lib/
To enable Keystore and SSL Service administration using SAP J2EE Engine Visual
Administrator, you must also put the above libraries in ../admin/lib/ directory.
What is the order of starting of Keystore Service and SSL Service?
To start both services, you first need to install the IAIK package; then start
Keystore on all cluster nodes, first on server, then on dispatcher ones. After
that start SSL service on all nodes.
How to install a server certificate?
To install and enable a server-side certificate, you have to either load the
certificate or generate one using the Keystore Service panel in Visual
Administrator. Then go to SSL Service runtime panel and select the SSL socket
for which you want to enable the certificate. From the Certificates subtab
click the “Add” button and choose your certificate from the list of available
ones. Note that when adding a new certificate the old one that was enabled is
replaced.
How to generate a certificate-sending request?
You can generate a certificate-sending request (CSR) for a key in SAP J2EE
Engine keystore using the “Generate CSR” function in Keystore runtime panel of
SAP J2EE Engine Visual Administrator.
How to self-sign a certificate?
You must specify that a certificate is self-signed when creating it. Use the
“Certificate Generation” tab of Keystore Service runtime panel in SAP J2EE
Engine Visual Administrator. Specify the required properties of the
certificate. To generate a self-signed certificate, do not specify any alias in
the “CA Key Alias” drop-down menu. SAP J2EE Engine does not support self-sign
on already existing certificates.For more information about how to generate
certificates, see Administration Manual -> Services Administration Reference ->
Keystore Service -> Certificate Generation section.
How to load a certificate?
You can load an existing certificate either using Keystore Service runtime
panel in Visual Administrator or using the LOAD shell command from the KEYSTORE
command group. For more information about the Keystore Service shell commands,
see Administration Manual -> Shell Commands Reference.For more information
about the Keystore Service runtime functions, see Administration Manual ->
Services Administration Reference -> Keystore Service section.
How to store a certificate/key?
You can store a certificate either using Keystore service runtime panel in
Visual Administrator or using the STORE shell command from the KEYSTORE command
group. Alternatively you can use the “Write” function in Keystore service
runtime panel in Visual Administrator or the WRITE shell command from KEYSTORE
command group to store certificates and keys in ASCII format. If using Visual
Administrator, the default store is ../admin. For more information about the
Keystore Service shell commands, see Administration Manual -> Shell Commands
Reference.For more information about the Keystore Service runtime functions,
see Administration Manual -> Services Administration Reference -> Keystore
Service section.
Plug-ins Configuration and Remote Debugging
Where can I find information on how to configure JBuilder Plug-in?
How to configure and use the JBuilder plug-in is described in Configuring
JBuilder Plug-in for Application Deployment and Debugging section in
Development Manual.
Where can I find information on how to configure SAP J2EE Engine for remote
debugging?
How to configure SAP J2EE Engine for remote debugging is described in
Configuration Tasks > Setting up SAP J2EE Engine for Remote Debugging section
of Administration Manual.
Can I use JBuilder plug-in with SAP J2EE Engine cluster version?
No. JBuilder plug-in is compatible with SAP J2EE Engine 6.20 stand-alone
version. It cannot be used with the cluster version.
Why is documentation Start Page no longer shown under http:\\localhost when the
server is started through JBuilder?
When starting SAP J2EE Engine through JBuilder the HTTP port on which it
listens for requests is changed, as well as the default root of the HTTP
server. Thus, in the standard configuration the HTTP port is 8080, and the
default root is the JBuilder project directory. To access the documentation
Start Page, you have to register it as an HTTP alias. Go to HTTP Service
runtime panel in Visual Administrator, enter Alias name, the name under which
you would like the Start Page to be accessible, and the full path to the docs
directory in the “Path” field. Then choose “Add.” Now, you can access the
documentation Start Page under http://localhost:8080/yourAliasName.
Monitoring
How to start the monitor server?
Execute the monitor script file on the command line. The monitor script file is
located in the
configuration file named properties exists and is located in the
the default configuration startup properties. It takes its startup properties
from that configuration file even though the file is not specified when
starting the Monitor Server.
How can the monitored data be viewed or stored?
There are several ways to view and/or export the monitored data:
- by using the SAP J2EE Engine Visual Administrator – only the current
monitored data can be viewed but cannot be monitored in progress.
- by exporting to a file system – the monitored data is stored in files.
- by exporting to SAP’s CCMS – provides options for viewing and storing the
monitored data.
- by using the browser-based monitoring – displays the monitored data in
progress.
For more information about how to configure each of the monitoring systems
above, see the Monitoring section in the Administration Manual.
How can I change the monitor server startup properties?
Create a configuration file and specify it as an argument when executing the
Monitor Server script file – for example: monitor configuration_file, where
configuration_file is the name of the configuration file.
The Monitor Server is then started using the settings from the configuration
file.
The configuration file priority is higher than the default settings. The
Monitor Server uses a default property setting only if this property is not set
in the configuration file.
The configuration file must be in text format and must be located in the same
directory as the Monitor Server script file (monitor.bat) – that is, in the
For more information about how to create the configuration file and description
of its contents, see the Administration Manual in SAP J2EE Engine documentation.
What additional libraries do I need to export data to CCMS?
You need Jmon API (jmon.dll). It is not included in the SAP J2EE Engine
distribution package and can be obtained from the SAP J2EE Engine provider.
It is critical to specify the path to jmon.dll in the monitor script file – for
example, -Djava.library.path=”%PATH%”;
Why my monitor server cannot connect to SAP J2EE Engine cluster?
The reason is that the server, to which the connection should be established,
is either down or the connection settings you specified are wrong. You must
start the server and reconnect the monitor server to it by executing the
connect shell command on the monitor server command line. Make sure the
provider url (hostname:p4_service_port), username and password you specify at
connection time are correct.
Integration
How is the communication between an SAP R/3 Dispatcher and SAP J2EE Engine
accomplished?
The communication between SAP R/3 Dispatcher and SAP J2EE Engine is performed
through R3Startup? Manager and R3Startup? Service on the J2EE side. The
R3Startup? Service, which runs on SAP J2EE Engine dispatcher node, communicates
through TCP/IP with SAP R/3 Dispatcher and holds information about all running
server nodes.
Where to find information on how to enable redirect from ICM to SAP J2EE
Engine?
You can find information on SAP J2EE Engine integration in the Integration
document. See also the following topics in SAP Web Application Server 6.20:
- SAP Library->mySAP Technogy Components->SAP Web Application Server->SAP J2EE
Engine->Integrating the SAP J2EE Application Server->Administration of the SAP
Web Application Server
- SAP Library->mySAP Technogy Components->SAP Web Application
Server->Client/Server Technology->Architecture of the SAP Web Application
Server->Parameterizing the ICM and the ICM Server Cache->Sample Profile for the
ICM
Administration APIs?
How to programatically obtain the client JAR that has been generated at
deployment time?
You can do this by using File Service interfaces that are described in detail
in the “Services Guide” section of Development Manual. In order to obtain the
File Service runtime interface (FileTransfer?), you have to lookup the service
and then call one of its createRemoteFile() methods. RemoteFile? class on the
other hand provides methods for upload and download of files that are located
on different logical servers. Its download() method can be used to retrieve the
client JAR located in
How to perform programatic startup of a service?
You can do this by using Admin Service interfaces that are described in detail
in the “Services Guide” section of Development Manual. Lookup of Admin Service
returns RemoteAdminInterface?. Using its getAdminServiceManager() method, you
can obtain AdminServiceManager? interface. AdminServiceManager? interface
provides methods for starting and stopping of a specific service by specifying
the service name and clusterId (the ID of the cluster node the service runs
on). You can also use it to retrieve and change service descriptors and
properties.
How to retrieve logs for a specific service, a manager, or whole cluster node?
You can do this by using Admin Service interfaces that are described in detail
in the “Services Guide” section of Development Manual. Lookup of Admin Service
returns RemoteAdminInterface?. You can use its getAdminServiceManager() method
to obtain AdminServiceManager? interface. AdminServiceManager? provides a
getLogViewer() method that returns AdminLogViewer? interface. From
AdminLogViewer? after initialisation with cluster id(s) logs for a specific
service, manager or entire cluster node can be retrieved. AdminLogViewer?
methods description can be found in the Admin Service part of the “Services
Guide” section of Development Manual. You may also see the Log Service APIs?
description in the same section of Development Manual.
How to retrieve a communication service port on a specified cluster node
You can do this by using Admin Service interfaces that are described in detail
in the “Services Guide” section of Development Manual. Lookup of Admin Service
returns RemoteAdminInterface?. You can use its getAdminServiceManager() method
to obtain AdminServiceManager? interface. AdminServiceManager? provides a
getServiceProperties(int clusterId, String serviceName) method that returns a
Properties object, from which you can obtain the specific communication service
port with getProperty(“portPropertyName”) method.
How to retrieve all existing users on SAP J2EE Engine?
You can do this by using Security Service interfaces that are described in
detail in the “Services Guide” section of Development Manual. Lookup of
Security Service returns RemoteSecurity? interface. It provides a
getRemoteUserManager() method that returns an interface for managing the User
Management module. RemoteUserManager? has a users(boolean user) method that
returns a String array with all users in the system if the boolean parameter is
set to true. If the boolean parameter is set to false, a String array with all
user groups in the system is returned.
How to obtain information about a specific user?
You can do this by using Security Service interfaces that are described in
detail in the “Services Guide” section of Development Manual. Lookup of
Security Service returns RemoteSecurity? interface. It provides a
getRemoteUserManager() method that returns an interface for managing the User
Management module. RemoteUserManager? has a getUserInfo(String name, boolean
user) method that returns a RemoteUserInfo? object encapsulating all properties
of the specific user. RemoteUserInfo? provides also methods for obtaining the
children and parents of the specified user or group, as well as for
administrative privileges checking.
How to connect to SAP J2EE Engine from a client with httptunneling layer?
You can look at the example of performing httptunneling connection to SAP J2EE
Engine that exists in the
directory.
In general, to establish a connection over httptunneling when creating
InitialContext? some additional properties should be put, denoting
httptunneling port, host and transport layer queue.
P4 Service
How can I generate stubs with remote support for rmi_p4?
You can do this using the RMIC Tool provided with SAP J2EE Engine 6.20. For
detailed information about the functions of this tool, see Administration
Manual > Administration Tools > RMIC Tool.
Can I use standard RMIC to generate stubs
No. Since P4 is a specific protocol for SAP J2EE Engine, standard tools do not
support it. Use the RMIC tool provided with SAP J2EE Engine to generate stubs.
Is UnicastRemoteObject? supported by rmi_p4?
No. RMI_P4 supports PortableRemoteObject? to enable remote communication.
Are the remote classes dinamically downloaded or they must be specified in the
classpath of the RMI client?
In SAP J2EE Engine 6.20 the remote classes are not downloaded dynamically. You
have to add the file that contains the stubs and the skeletons to the client’s
classpath. This will be changed in SAP J2EE Engine 6.30.
How to use RMIC Tool?
You can find information on how to use the RMIC Tool in Administration Manual >
Administration Tools > RMIC Tool.
JMS
Does SAP J2EE Engine JMS implementation support persistent messages?
Yes. The JMS Service allows using global transactions using the
XATopicConnectionFactory? or XAQueueConnectionFactory?.es, JMS Service on SAP
J2EE Engine supports persistent messages.
Does SAP J2EE Engine JMS implementation support JTA XA API?
Yes. The JMS Service allows using global transactions using the
XATopicConnectionFactory? or XAQueueConnectionFactory?.
Does SAP J2EE Engine JSM implementation supports user/password verification
when creating connections?
No, SAP J2EE Engine does not support user/password verification. Event if such
credentials are supplied, they are not taken into consideration.
How can I administrate jms destinations on SAP J2EE Engine?
Use the Console Administrator tool. In it, type “add jms” to activate the JMS
Service group of commands. Use the commands provided to create and bind Topics
and Queues and to administrate the JMS Destinations. You can also use Visual
Administrator to manage destinations. Open the JMS Service tab and choose
Topic, Queue or Subscription. Using the “Add” and “Remove” buttons, you can
easily create or remove destinations. For more information about managing
destinations using Visual Administrator, see Administration Manual -> Services
Administration Reference -> JMS Service -> Visual Administrator.
Class Loading
How does SAP J2EE Engine’s class loading system work?
The class loading system is centralized in the ClassLoaderManager?. It
implements interfaces used for registering and deregistering of loaders and
references between them, as well as for accessing loaders referenced by another
loader. SAP J2EE Engine classloading system consists of several different types
of loaders – FileClassLoader?, ReferencedLoader?, Frame Loader,
CoreClassLoader?, ServiceClassLoader?, ApplicationLoader?.
FileClassLoader is a super class for all other classloaders in SAP J2EE Engine
class loading system and implements the main loading functionality.
FrameClassLoader? is used to load the classes from Service Framework. It has
just one instance and no references to other loaders. Frame Loader is the
parent of CoreClassLoader?, ServiceClassLoader? and ApplicationLoader?.
CoreClassLoader? also has just one instance; it is used for loading managers’
classes. As their names imply, ServiceClassLoader? is used for loading
services’ classes and ApplicationLoader? is used for loading applications’
classes. Both ServiceClassLoader? and ApplicationLoader? are direct derivatives
of ReferencedLoader? and use the referencing functionality offered by it. This
way they gain access to classes loaded with a different ReferencedLoader?.
Classes in libraries that are shared between applications are also loaded with
ReferencedLoader?.
Referenced loaders are registered and kept in ClassLoaderManager?. Each loader
is distinguished from the others by its name that obeys the following
convention: the loader of each service is named service:serviceName, the loader
of each application or resource adapter is named by its display name and the
loader of each library is named library:libraryName. Each ReferencedLoader? is
wrapped in a ReferencedLoaderWrapper? that contains information about the
references of the specific loader and the ReferencedLoader? itself.
Registration and deregistration of a ReferencedLoader?, as well as of
references from a ReferencedLoader? to another ReferencedLoader?, is done by
name. If a ReferencedLoader? has loaded a class, the referred loader must not
try to load or resolve it. Thus the following mechanism is used: first locally
cached classes are checked, then the parent loader, the registered references
to other referenced loaders, and finally the ReferencedLoader? itself tries to
load the class.
What kind of references between loaders can be set?
The following types of references between loaders can be set: -A?
- Reference between two service loaders
- Reference from an application to a service
- Reference from an application to a library
- Reference from a library to an application
- Reference from a library to another library
- Reference from a library to a service
- Reference from a service to a library
Different types of references are specified in library.txt, reference.txt and
provider.xml files. library.txt file, located in
definitions of all additional libraries (for more info on library deployment
see Deployment Manual) as well as the references (if any) between this
particular library and other libraries. All application references are set in
reference.txt, and all service references are set in provider.xml. You can see
the “Configuration of Additional Libraries” section of Administration Manual
for more information about how to set the different types of references.
Generally it is not recommended to manually edit library.txt, reference.txt and
especially provider.xml files of SAP J2EE Engine services, since tools and
shell commands are provided for setting and changing references and deploying
libraries.
How to set a reference from an application to a library?
The library that is referenced must be deployed or registered on SAP J2EE
Engine server. You can do this simultaneously with the application deployment,
when you use Deploy Tool (for more information about this topic, see Deployment
Manual). Another option is to copy the library archive in
this library in library.txt located in
yourLibraryName yourArchiveName.jar). Then a reference from the application to
the library must be registered. You can do this at deployment time when you
deploy the library, using the changeref shell command or manually by adding the
reference in reference.txt located in
reference yourAppDisplayName library:yourLib). The reference can be set
programmatically using the methods provided by Deploy Service runtime
interface, described in details in Development Manual.
How to set a reference from a library to another library?
First, both libraries must be deployed either using Deploy Tool or registered
manually (for more information about this topic, see Administration Manual).
Then, by using Deploy Tool, the changeref shell command or manually editing
library.txt (this is adding the entry: reference firstLibName secondLibName),
you can set the reference between them. The reference between the libraries can
also be set programmatically with the methods provided by Deploy Service
runtime interface, described in Development Manual. Note, that if you have a
large number of additional library archives, which are interdependent, it is
recommended to register them as one library on SAP J2EE Engine server in order
to avoid complex classloader interdependencies and possible problems.
How to set a reference from a service to another service or to a library?
References from a particular service to other services and libraries are listed
in service’s provider.xml file that is located in
edit this file manually. Instead, you can use Deploy Tool or changeref shell
command. Another option (that is also not recommended) is manually editing
reference.txt file located in
from a service to a service, you can add the following line to reference.txt:
reference service:serviceOneName service:serviceTwoName.
If referencing a library, add the following line to reference.txt:
reference service:serviceName library:libName.
The reference can also be set programmatically with the methods provided by
Deploy Service runtime interface, described in details in Development Manual.
How to reference a library or a service from the default application?
The display name that must be used when registering references from the default
application on SAP J2EE Engine server is Default. You can use Deploy Tool, the
changeref shell command or manually edit the reference.txt file (as described
in “How to set a reference from an application to a library” question above) to
register a reference from it to a library, service or another application on
SAP J2EE Engine.
How to reference a service or a library from a Resource Adapter?
To reference a service, add the following line to reference.txt:
reference
To reference a library, add the following line to reference.txt:
reference
The display name of the resource adapter is the one that is specified in
META-INF/ra.xml in the resource archive (RAR) file.
You can also use Deploy Tool or changeref shell command to set these
references. Using the methods provided by Deploy Service runtime interface you
can set the references programmatically. The Deploy Service runtime interface
is described in detail in Development Manual.
How to deregister a reference?
You can use changeref shell command to remove a reference between two loaders.
Here is an example of its usage:
changeref -r application:yourApplicationName library:yourLibName
This removes the reference between the application with name
yourApplicationName and the library with name yourLibName. The same can be
accomplished by deleting the corresponding line in reference.txt file located
in
can be removed programmatically with the methods provided by Deploy Service
runtime interface that is described in details in Development Manual.
Where can I put property files needed by an application so they can be loaded?
Property files can be put in any JAR file that is part of the application,
including the JAR files, located in WEB-INF\lib directory of its web part. For
a web application the property files can also be put in the WAR file in
WEB-INF\classes directory.
If the application uses an additional library and a reference to it is set,
property files can also be included in the JAR file of the library. However, if
the property file is not bundled in a JAR file, but is just included in the
root of the application EAR file, it will not be loaded, and will not be found
by the application classes.
Why do I get a ClassNotFound? exception when deploying or starting an
application?
Probably a reference from an application to a library, or from a library to a
library is missing. You can check if all required references are set using the
ll shell command that lists all loaders on SAP J2EE Engine and the references
between them. You can also look at reference.txt file located in
Why do I get a ZipException? when deploying a library or starting an
application?
A possible cause for this problem might be a missing library JAR file, either
because a wrong file name was specified, or because the library has been
registered but the JAR file with the classes does not exist at the specified
location. Another cause of the exception might be the usage of a wrong file
separator if library.txt has been edited manually (which is not recommended in
any way). Double check if all required files exist and are correct.
Why do I get a java.lang.UnsatisfiedLinkError after restarting an application
or a pool?
Uhis exception might occur because the application or the pool is using an
additional library or a JDBC driver that has native parts in it and that are
loaded just once for the Java Virtual Machine (JVM). A possible solution is to
restart the container in which the application is running, or DBpool? Service.
Why do I get a ZipException? when deploying a library or starting an
application?
A possible cause for this problem might be a missing library JAR file, either
because a wrong file name was specified, or because the library has been
registered but the JAR file with the classes does not exist at the specified
location. Another cause of the exception might be the usage of a wrong file
separator if library.txt has been edited manually (which is not recommended in
any way). Double check if all required files exist and are correct.
Why do I get a java.lang.UnsatisfiedLinkError after restarting an application
or a pool?
Uhis exception might occur because the application or the pool is using an
additional library or a JDBC driver that has native parts in it and that are
loaded just once for the Java Virtual Machine (JVM). A possible solution is to
restart the container in which the application is running, or DBpool? Service.
6.30 FAQ
Problem: Engine stops after running only for an hour.
Possible cause:
License invalid.
Check:
look for messages in
/usr/sap/C11/JC00/j2ee/cluster/server0/log/console_logs/error.log saying that
the server will go down because the license is invalid.
Solution: Install a new license.
See http://intranet.sap.com/likey then follow the link “mySap J2EE Engine” and
there “installing a license Key in….”. — HolgerOehm – 25 Jul 2003
Topic J2EESupportFAQ . { Edit | View | Attach | Ref-By | Printable | Diffs |
r1.3 | > | r1.2 | > | r1.1 | More Actions } One Click Registration
Revision r1.3 – 17 Jun 2004 – 10:18 GMT – PavelZlatarev
Copyright ?2000-2004 by the contributing authors. All material on this
collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding BIS? Send feedback.
第一,谈谈final, finally, finalize的区别。
final?修饰符(关键字)如果一个类被声明为final,意味着它不能再派生出新的子类,不能作为父类被继承。因此一个类不能既被声明为 abstract的,又被声明为final的。将变量或方法声明为final,可以保证它们在使用中不被改变。被声明为final的变量必须在声明时给定初值,而在以后的引用中只能读取,不可修改。被声明为final的方法也同样只能使用,不能重载。
finally?再异常处理时提供 finally 块来执行任何清除操作。如果抛出一个异常,那么相匹配的 catch 子句就会执行,然后控制就会进入 finally 块(如果有的话)。
finalize?方法名。Java 技术允许使用 finalize() 方法在垃圾收集器将对象从内存中清除出去之前做必要的清理工作。这个方法是由垃圾收集器在确定这个对象没有被引用时对这个对象调用的。它是在 Object 类中定义的,因此所有的类都继承了它。子类覆盖 finalize() 方法以整理系统资源或者执行其他清理工作。finalize() 方法是在垃圾收集器删除对象之前对这个对象调用的。
第二,Anonymous Inner Class (匿名内部类) 是否可以extends(继承)其它类,是否可以implements(实现)interface(接口)?
匿名的内部类是没有名字的内部类。不能extends(继承) 其它类,但一个内部类可以作为一个接口,由另一个内部类实现。
第三,Static Nested Class 和 Inner Class的不同,说得越多越好(面试题有的很笼统)。
Nested Class (一般是C++的说法),Inner Class (一般是JAVA的说法)。Java内部类与C++嵌套类最大的不同就在于是否有指向外部的引用上。具体可见http: //www.frontfree.net/articles/services/view.asp?id=704&page=1
注: 静态内部类(Inner Class)意味着1创建一个static内部类的对象,不需要一个外部类对象,2不能从一个static内部类的一个对象访问一个外部类对象
第四,&和&&的区别。
&是位运算符。&&是布尔逻辑运算符。
op1 & op2 , 当 op1 和 op2 都为真时,返回值才为真,但总是检查op1和op2的值
op1 && op2, 当 op1 和 op2 都为真时,返回值才为真,但当op1的值为false时,op2的值就不再被查了
第五,HashMap和Hashtable的区别。
都属于Map接口的类,实现了将惟一键映射到特定的值上。
HashMap 类没有分类或者排序。它允许一个 null 键和多个 null 值。
Hashtable 类似于 HashMap,但是不允许 null 键和 null 值。它也比 HashMap 慢,因为它是同步的。
第六,Collection 和 Collections的区别。
Collections是个java.util下的类,它包含有各种有关集合操作的静态方法。
Collection是个java.util下的接口,它是各种集合结构的父接口。
第七,什么时候用assert。
断言是一个包含布尔表达式的语句,在执行这个语句时假定该表达式为 true。如果表达式计算为 false,那么系统会报告一个 Assertionerror。它用于调试目的:
assert(a > 0); // throws an Assertionerror if a <= 0
断言可以有两种形式:
assert Expression1 ;
assert Expression1 : Expression2 ;
Expression1 应该总是产生一个布尔值。
Expression2 可以是得出一个值的任意表达式。这个值用于生成显示更多调试信息的 String 消息。
断言在默认情况下是禁用的。要在编译时启用断言,需要使用 source 1.4 标记:
javac -source 1.4 Test.java
要在运行时启用断言,可使用 -enableassertions 或者 -ea 标记。
要在运行时选择禁用断言,可使用 -da 或者 -disableassertions 标记。
要系统类中启用断言,可使用 -esa 或者 -dsa 标记。还可以在包的基础上启用或者禁用断言。
可以在预计正常情况下不会到达的任何位置上放置断言。断言可以用于验证传递给私有方法的参数。不过,断言不应该用于验证传递给公有方法的参数,因为不管是否启用了断言,公有方法都必须检查其参数。不过,既可以在公有方法中,也可以在非公有方法中利用断言测试后置条件。另外,断言不应该以任何方式改变程序的状态。
第八,GC是什么? 为什么要有GC? (基础)。
GC是垃圾收集器。Java 程序员不用担心内存管理,因为垃圾收集器会自动进行管理。要请求垃圾收集,可以调用下面的方法之一:
System.gc()
Runtime.getRuntime().gc()
第九,String s = new String(“xyz”);创建了几个String Object?
两个对象,一个是“xyx”,一个是指向“xyx”的引用对象s。
第十,Math.round(11.5)等於多少? Math.round(-11.5)等於多少?
Math.round(11.5)返回(long)12,Math.round(-11.5)返回(long)-11;
第十一,short s1 = 1; s1 = s1 + 1;有什么错? short s1 = 1; s1 += 1;有什么错?
short s1 = 1; s1 = s1 + 1;有错,s1是short型,s1+1是int型,不能显式转化为short型。可修改为s1 =(short)(s1 + 1) 。short s1 = 1; s1 += 1正确。
第十二,sleep() 和 wait() 有什么区别? 搞线程的最爱
sleep()方法是使线程停止一段时间的方法。在sleep 时间间隔期满后,线程不一定立即恢复执行。这是因为在那个时刻,其它线程可能正在运行而且没有被调度为放弃执行,除非(a)“醒来”的线程具有更高的优先级 (b)正在运行的线程因为其它原因而阻塞。
wait()是线程交互时,如果线程对一个同步对象x 发出一个wait()调用,该线程会暂停执行,被调对象进入等待状态,直到被唤醒或等待时间到。
第十三,Java有没有goto?
Goto?java中的保留字,现在没有在java中使用。
第十四,数组有没有length()这个方法? String有没有length()这个方法?
数组没有length()这个方法,有length的属性。
String有有length()这个方法。
第十五,Overload和Override的区别。Overloaded的方法是否可以改变返回值的类型?
方法的重写Overriding和重载Overloading是Java多态性的不同表现。重写Overriding是父类与子类之间多态性的一种表现,重载Overloading是一个类中多态性的一种表现。如果在子类中定义某方法与其父类有相同的名称和参数,我们说该方法被重写 (Overriding)。子类的对象使用这个方法时,将调用子类中的定义,对它而言,父类中的定义如同被“屏蔽”了。如果在一个类中定义了多个同名的方法,它们或有不同的参数个数或有不同的参数类型,则称为方法的重载(Overloading)。Overloaded的方法是可以改变返回值的类型。
第十六,Set里的元素是不能重复的,那么用什么方法来区分重复与否呢? 是用==还是equals()? 它们有何区别?
Set里的元素是不能重复的,那么用iterator()方法来区分重复与否。equals()是判读两个Set是否相等。
equals()和==方法决定引用值是否指向同一对象equals()在类中被覆盖,为的是当两个分离的对象的内容和类型相配的话,返回真值。
第十七,给我一个你最常见到的runtime exception。
ArithmeticException, ArrayStoreException, BufferOverflowException, BufferUnderflowException, CannotRedoException, CannotUndoException, ClassCastException, CMMException, ConcurrentModificationException, DOMException, EmptyStackException, IllegalArgumentException, IllegalMonitorStateException, IllegalPathStateException, IllegalStateException,
ImagingOpException, IndexOutOfBoundsException, MissingResourceException, NegativeArraySizeException, NoSuchElementException, NullPointerException, ProfileDataException, ProviderException, RasterFORMatException, SecurityException, SystemException, UndeclaredThrowableException, UnmodifiableSetException, UnsupportedOperationException
第十八,error和exception有什么区别?
error 表示恢复不是不可能但很困难的情况下的一种严重问题。比如说内存溢出。不可能指望程序能处理这样的情况。
exception 表示一种设计或实现问题。也就是说,它表示如果程序运行正常,从不会发生的情况。
第十九,List, Set, Map是否继承自Collection接口?
List,Set是
Map不是
第二十,abstract class和interface有什么区别?
声明方法的存在而不去实现它的类被叫做抽象类(abstract class),它用于要创建一个体现某些基本行为的类,并为该类声明方法,但不能在该类中实现该类的情况。不能创建abstract 类的实例。然而可以创建一个变量,其类型是一个抽象类,并让它指向具体子类的一个实例。不能有抽象构造函数或抽象静态方法。Abstract 类的子类为它们父类中的所有抽象方法提供实现,否则它们也是抽象类为。取而代之,在子类中实现该方法。知道其行为的其它类可以在类中实现这些方法。
接口(interface)是抽象类的变体。在接口中,所有方法都是抽象的。多继承性可通过实现这样的接口而获得。接口中的所有方法都是抽象的,没有一个有程序体。接口只可以定义static final成员变量。接口的实现与子类相似,除了该实现类不能从接口定义中继承行为。当类实现特殊接口时,它定义(即将程序体给予)所有这种接口的方法。然后,它可以在实现了该接口的类的任何对象上调用接口的方法。由于有抽象类,它允许使用接口名作为引用变量的类型。通常的动态联编将生效。引用可以转换到接口类型或从接口类型转换,instanceof 运算符可以用来决定某对象的类是否实现了接口。
第二十一,abstract的method是否可同时是static,是否可同时是native,是否可同时是synchronized?
都不能
第二十二,接口是否可继承接口? 抽象类是否可实现(implements)接口? 抽象类是否可继承实体类(concrete class)?
接口可以继承接口。抽象类可以实现(implements)接口,抽象类是否可继承实体类,但前提是实体类必须有明确的构造函数。
第二十三,启动一个线程是用run()还是start()?
启动一个线程是调用start()方法,使线程所代表的虚拟处理机处于可运行状态,这意味着它可以由JVM调度并执行。这并不意味着线程就会立即运行。run()方法可以产生必须退出的标志来停止一个线程。
第二十四,构造器Constructor是否可被override?
构造器Constructor不能被继承,因此不能重写Overriding,但可以被重载Overloading。
第二十五,是否可以继承String类?
String类是final类故不可以继承。
第二十六,当一个线程进入一个对象的一个synchronized方法后,其它线程是否可进入此对象的其它方法?
不能,一个对象的一个synchronized方法只能由一个线程访问。
第二十七,try {}里有一个return语句,那么紧跟在这个try后的finally {}里的code会不会被执行,什么时候被执行,在return前还是后?
会执行,在return前执行。
第二十八,编程题: 用最有效率的方法算出2乘以8等於几?
有C背景的程序员特别喜欢问这种问题。
2 << 3
第二十九,两个对象值相同(x.equals(y) == true),但却可有不同的hash code,这句话对不对?
不对,有相同的hash code。
第三十,当一个对象被当作参数传递到一个方法后,此方法可改变这个对象的属性,并可返回变化后的结果,那么这里到底是值传递还是引用传递?
是值传递。Java 编程语言只由值传递参数。当一个对象实例作为一个参数被传递到方法中时,参数的值就是对该对象的引用。对象的内容可以在被调用的方法中改变,但对象的引用是永远不会改变的。
第三十一,swtich是否能作用在byte上,是否能作用在long上,是否能作用在String上?
switch(expr1)中,expr1是一个整数表达式。因此传递给 switch 和 case 语句的参数应该是 int、 short、 char 或者 byte。long,string 都不能作用于swtich。
第三十二,编程题: 写一个Singleton出来。
Singleton模式主要作用是保证在Java应用程序中,一个类Class只有一个实例存在。
一般Singleton模式通常有几种种形式:
第一种形式:定义一个类,它的构造函数为private的,它有一个static的private的该类变量,在类初始化时实例话,通过一个public的getInstance方法获取对它的引用,继而调用其中的方法。
public class Singleton {
private Singleton(){}
//在自己内部定义自己一个实例,是不是很奇怪?
//注意这是private 只供内部调用
private static Singleton instance = new Singleton();
//这里提供了一个供外部访问本class的静态方法,可以直接访问
public static Singleton getInstance() {
return instance;
}
}
第二种形式:
public class Singleton {
private static Singleton instance = null;
public static synchronized Singleton getInstance() {
//这个方法比上面有所改进,不用每次都进行生成对象,只是第一次
//使用时生成实例,提高了效率!
if (instance==null)
instance=new Singleton();
return instance; }
}
其他形式:
定义一个类,它的构造函数为private的,所有方法为static的。
一般认为第一种形式要更加安全些
Hashtable和HashMap
Hashtable继承自Dictionary类,而HashMap是Java1.2引进的Map interface的一个实现
HashMap允许将null作为一个entry的key或者value,而Hashtable不允许
还有就是,HashMap把Hashtable的contains方法去掉了,改成containsvalue和containsKey。因为contains方法容易让人引起误解。
最大的不同是,Hashtable的方法是Synchronize的,而HashMap不是,在
多个线程访问Hashtable时,不需要自己为它的方法实现同步,而HashMap
就必须为之提供外同步。
28 how to Upload Files? . .
Answer: the client is in HTML form post method to set the enctype for multi-part/form-data, plus one.
.
In the receiving servlet in only a I / O problem. .
29 I want auto-refresh the page, such as chat rooms.
A: This is a HTML problem in. .
部分中加一条。
这是所谓的Clinet-push,客户端刷新技术。
30 我想让用户登录以后才能访问页面。
答:使用声明式安全措施。
你只需要在web.xml中定义安全角色(Role),并定义受保护的URL集合只能由特定Role访问。
大多数服务器支持基于数据库的用户映射,你只要在相应数据库中建立两张表并配置服务器就可以了。
注意J2EE SDK不支持基于数据库的用户映射。
细节请看参考书和服务器文档。
31 我想要能注册用户。
答:参看30。在接受注册请求的Servlet中执行写入数据库操作即可。
32 怎么在JSP中访问数据库?
答:标准做法是使用DAO模式,定义一个Java bean来访问数据库并在JSP中使用。
然而,当你的数据库模式很简单时,你可以使用JSTL中的
33 什么是JSTL?
答:JSTL是Jsp Standard Tag Library的缩写。这是一组通用标签并将成为JSP 2.0的一部分。
其中包含赋值
等。目前你需要像添加自定义标签库一样来添加JSTL,但是可以预计JSP 2.0会将JSTL作为组成部分。
标签库可以在 http://jakarta.apache.org 下载。注意JSTL需要在支持JSP1.2或更高版本的容器下运行。
帮助文件可以阅读sun的JSTL正式规范。
Table of contents
6.20 FAQ
Deployment
How can I deploy a library?
Can I deploy a read-only EAR?
What is delta deployment?
Do I need to connect Deploy Tool to SAP J2EE Engine to get an application
deployed?
What is the difference between deploying an application using the Deploy Tool,
the Visual Administrator and the server console?
How can I deploy an application with alt_dd.xml?
How and when to set security constraints for my applications, how to map them
to actual server users?
Can I deploy two applications with the same name?
How to use Deploy Manager API, what functions are provided?
Why does deployment of myapplication fail with ∪Error in compiling: maybe
javacnot found∩?
Why is javax.namingpackage not found when deploying an application?
Why does deployment of my application fail with IOException?
Why does deployment of my application hang on HP-UX and no error message is
shown?
Web Container and HTTP
How to disable directory browsing of a web application?
How to deny PUT access to web server resources?
How to configure my web application to use HTTPS client authentication
mechanism?
How to specify security constraints for a web application?
Can I change JSPs, servlet classes and descriptors of a web application without
redeploying it?
Can I deploy two web applications with the same name?
How can I deploy my application to be the default for the web server?
How to enable application tracing for web applications?
What information is logged for the web container and where can I find it?
Can I configure the web container to respond with custom reponse messages?
What formats of HTTP content and transfer codings does the web container
support?
Resource Adapters
How can I deploy a resource adapter?
Can I add additional properties to an already deployed resource adapter?
How can I lookup a resource-adapter connection factory instance?
How can I lookup a connection factory instance from a helper class in
additional library?
How can I configure the number of pooled connections?
Why do I get a ClassNotFoundException when deploying a resource adapter?
EJB Container
What do container type A and container type B mean?
What EJB properties can I administrate after deployment?
How can I lookup a bean from an RMI client (stand-alone Java program)?
How is database information for CMP entity beans described?
Is it possible for a bean to use helper classes from an additional library?
Can I start a new thread from a bean?
How can I lookup a bean from a class in an additional library?
How can I lookup a bean from another application?
Cluster Configuration
Are applications and libraries on server nodes synchronized?
What is the default_library.txt file for?
How to add a second server/dispatcher node on the same physical machine?
How to add a new server node located on a different physical machine to SAP
J2EE Engine cluster?
How to connect two dispatcher nodes running on different physical machines in
the cluster?
How to configure a SAP J2EE Engine node to start in background mode?
How to configure several nodes on one machine to run in background mode?
How to access the server or dispatcher to perform administrative functions when
SAP J2EE Engine is running in background mode?
When do configuration changes take effect?
How does Appclear Tool work?
How to specify SAP J2EE Engine memory settings?
Why does dispatcher/server startup fail when attempting to start Log Manager?
Why does server startup fail on DBMS service?
Why a SAP J2EE Engine server node cannot connect to a dispatcher node?
Why does server startup fail with java.net.BindException: Address in use:
JVM_Bind?
Why does SAP J2EE Engine startup on HP-UX fail with the following error
message: java.lang.OutOfMemoryError: unable to create new native thread?
XML Parser
How can I use SAPXMLToolkit in a stand-alone program?
How can I use SAPXMLToolkit in a deployed application?
How can I use Xerces parser in my application?
How can I use an HTTP proxy while parsing an XML?
Web Services
Can I register a bean as a port for a Web service in SAP J2EE Engine 6.20?
Where can I find the WSDL for a bean?
Do I have to deploy SOAPDispatcher in order to access Web Services framework?
What happens if I deploy the old soapdispatcher.ear?
How can I generate a proxy for the generated WSDL?
How can I use SAP’s SOAP implementation (inqmysoap.jar) with IBM’s UDDI4J?
How can I access a bean that had been deployed as a Web service?
Security
How to assign JNDI permission to a specific user?
How to restrict telnet access for a specific user application?
What additional libraries do I need to start Keystore and SSL services and
where should I put them?
What is the order of starting of Keystore Service and SSL Service?
How to install a server certificate?
How to generate a certificate-sending request?
How to self-sign a certificate?
How to load a certificate?
How to store a certificate/key?
Plug-ins Configuration and Remote Debugging
Where can I find information on how to configure JBuilder Plug-in?
Where can I find information on how to configure SAP J2EE Engine for remote
debugging?
Can I use JBuilder plug-in with SAP J2EE Engine cluster version?
Why is documentation Start Page no longer shown under http:\\localhost when the
server is started through JBuilder?
Monitoring
How to start the monitor server?
How can the monitored data be viewed or stored?
How can I change the monitor server startup properties?
What additional libraries do I need to export data to CCMS?
Why my monitor server cannot connect to SAP J2EE Engine cluster?
Integration
How is the communication between an SAP R/3 Dispatcher and SAP J2EE Engine
accomplished?
Where to find information on how to enable redirect from ICM to SAP J2EE
Engine?
Administration APIs
How to programatically obtain the client JAR that has been generated at
deployment time?
How to perform programatic startup of a service?
How to retrieve logs for a specific service, a manager, or whole cluster node?
How to retrieve a communication service port on a specified cluster node
How to retrieve all existing users on SAP J2EE Engine?
How to obtain information about a specific user?
How to connect to SAP J2EE Engine from a client with httptunneling layer?
P4 Service
How can I generate stubs with remote support for rmi_p4?
Can I use standard RMIC to generate stubs
Is UnicastRemoteObject supported by rmi_p4?
Are the remote classes dinamically downloaded or they must be specified in the
classpath of the RMI client?
How to use RMIC Tool?
JMS
Does SAP J2EE Engine JMS implementation support persistent messages?
Does SAP J2EE Engine JMS implementation support JTA XA API?
Does SAP J2EE Engine JSM implementation supports user/password verification
when creating connections?
How can I administrate jms destinations on SAP J2EE Engine?
Class Loading
How does SAP J2EE Engine’s class loading system work?
What kind of references between loaders can be set?
How to set a reference from an application to a library?
How to set a reference from a library to another library?
How to set a reference from a service to another service or to a library?
How to reference a library or a service from the default application?
How to reference a service or a library from a Resource Adapter?
How to deregister a reference?
Where can I put property files needed by an application so they can be loaded?
Why do I get a ClassNotFound exception when deploying or starting an
application?
Why do I get a ZipException when deploying a library or starting an
application?
Why do I get a java.lang.UnsatisfiedLinkError after restarting an application
or a pool?
Why do I get a ZipException when deploying a library or starting an
application?
Why do I get a java.lang.UnsatisfiedLinkError after restarting an application
or a pool?
6.30 FAQ
Problem: Engine stops after running only for an hour.
Possible cause:
Check:
Solution: Install a new license.
6.20 FAQ
Deployment
How can I deploy a library?
To deploy an additional library with helper classes that will be used by more
than one J2EE applications on SAP J2EE Engine, you can use Deploy Tool, the
changelib shell command or DeployManager? API. Using an additional library is
recommended only when several applications need access to its classes,
otherwise it is better to bundle the JAR files with the helper classes in the
enterprise archive file.
For more information about Deploy Tool and DeployManager? API, see Deployment
Manual.
For more information about the Deploy Service shell commands, see
Administration Manual -> Shell Commands Reference.
Can I deploy a read-only EAR?
Yes, you can do this using each of the deployment tools distributed with SAP
J2EE Engine, namely Deploy Tool, Deploy Service Runtime tab in the Visual
Administrator or Deploy Service shell commands. None of these tools changes the
original EAR file. Deploy Tool and Visual Administrator unpack it and generate
a new temporary EAR file to be deployed, whereas the deploy shell command takes
the original one but makes no changes.
What is delta deployment?
Delta deployment (also referred as application update) is a feature of SAP J2EE
Engine Deploy Service that allows for updating those parts of a specific
application that are new or have been modified. This function is available in
Deploy Tool, Deploy Service Runtime tab in SAP J2EE Engine Visual Administrator
and the Deploy Service update shell command.
Do I need to connect Deploy Tool to SAP J2EE Engine to get an application
deployed?
When Deploy Tool and SAP J2EE Engine run on the same physical machine it is
possible to deploy your application without explicitly establishing a
connection, since default values for host, port, username and password are
provided. Establishing a connection is necessary to display server users and
map application security roles. If Deploy Tool and SAP J2EE Engine run on
different physical machines, or port configuration of p4 Service has changed,
logging in and establishing a connection between them is obligatory.
What is the difference between deploying an application using the Deploy Tool,
the Visual Administrator and the server console?
There is no difference in the outcome when deploying an application through
Deploy Tool, Visual Administrator or the server console. However, when
deploying with Deploy Tool and SAP J2EE Engine Visual Administrator the
enterprise archive file is unpacked, and some properties such as environment
entries, resource references, context parameters, security roles, and mapping
can be changed. When deploying through the server console the ear file is not
unpacked, and no properties can be changed.
How can I deploy an application with alt_dd.xml?
You can deploy an application with alt_dd.xml on SAP J2EE Engine using Deploy
Tool, Deploy Service Runtime tab in the Visual Admnistrator and Deploy Service
deploy shell command. However, it is not possible to create the alt_dd.xml file
with Deploy Tool. You have to write it manually and include it as an additional
file in the application archive.
How and when to set security constraints for my applications, how to map them
to actual server users?
You can set security constraints for an application at deployment time using
Deploy Tool and SAP J2EE Engine Visual Administrator. With both tools you can
create security roles and map them to actual server users for each application
component, as well as for the entire application. SAP J2EE Engine Visual
Administrator allows for changing security roles and user mappings for EJBs
after deployment. You can do this from EJB Service Runtime control tab.
Can I deploy two applications with the same name?
No. Display names of applications on SAP J2EE Engine have to be unique. If you
attempt to deploy an application with the same name as another one, the first
application will be replaced. The same is true for EJBs with identical names.
If the context root of the web part of an application has the same name as an
already existing context root, a DeploymentException? is thrown.
How to use Deploy Manager API, what functions are provided?
You can use Deploy Manager API for configuration, deployment and update of
applications, as well as for deploying libraries and setting references between
loaders. It can be used either programmatically or through the deploymanager
script file located in
script takes as a parameter Deployer.xml file that describes the application,
necessary libraries and references from the application to other loaders (if
any). For more information about Deploy Manager Interface methods and the DTD
of Deployer.xml file, see Deployment Manual.
Why does deployment of myapplication fail with ∪Error in compiling: maybe
javacnot found∩?
The reason is javac is not specifiedin PATH variable. Include the directory
path to javac inyour PATH variable. This solution works properly fordeploying
all types of application components.Alternatively, you can also change the
correspondingproperties of Servlet_jsp Service or EJB Service topoint to the
javac location. For example, if you set theExternalCompiler property of
Servlet_jsp Service topoint to the javac location, it works for deploying
webapplications only. This means that if you try to deployEJBs, you will still
get that error. To be able todeploy EJBs you have to set the
ExternalCompilerproperty? of the EJB Service to point to the javaclocation too.
A possible reason for this exception mightbe also an error in compiling as
denoted by its errormessage.
Why is javax.namingpackage not found when deploying an application?
The javac that is specified in thePATH is an older version. For example, javac
version1.2.2 or lower is used instead of version 1.3). Includethe path to javac
with the proper version in your PATHvariable?. This solution works properly for
deploying alltypes of application components. Alternatively, you canalso change
the corresponding properties of Servlet_jsp Service or EJB Service to point to
the appropriate javac location. For example, if you set the ExternalCompiler?
property of Servlet_jsp Service to point to the appropriate javac location, it
works for deploying web applications only. This means that if you try to deploy
EJBs, you will still get that error. To be able to deploy EJBs you have to set
the ExternalCompiler? property of the EJB Service to point to the appropriate
javac location too.
Why does deployment of my application fail with IOException??
There are several possible reasons for this behavior: either your EAR file is
corrupted or there is not enough free disk space on the machine where you are
trying to deploy the application.
In case of a corrupted EAR file, double-check on its integrity.
In the other case, you must free enough disk space on your machine for the EAR
file to be deployed.
Another possible reason is using a third party XML parser that cannot get the
necessary document type definition (cannot pass through proxies). It is
recommended not to use different parsers than inqmyxml for component generation
and deployment on SAP J2EE Engine.
Why does deployment of my application hang on HP-UX and no error message is
shown?
There is a known problem in JDK version 1.3.1.02 on HP-UX, which sometimes
prevents the normal socket closing. Add the -XdoCloseWithReadPending? property
to the go script file of the server after the classpath and then restart it.
Web Container and HTTP
How to disable directory browsing of a web application?
You have two options to do this: using the Visual Administrator and editing the
properties file of the HTTP Service.
When using the Visual Administrator, you have to go to HTTP Service on server
node, and select the ∪Properties∩ tab. Then you must uncheck the ∪Directory
List∩ property in ∪Infer Names∩ pane. Another option is to edit the DirList?
property of Http Service thorugh the shell command setprops in the server
console.
If you choose to edit the properties file that is located in
set the DirList? property to ∪false∩.
How to deny PUT access to web server resources?
You must edit the web.xml descriptor of the web application that you want to
protect from being accessed by PUT requests. This is usually done at
application assembling phase. If you have already deployed your application
without restricting PUT access to it, you still have the opportunity to set
such restriction. You must edit the web.xml file for this application, which is
located under the
directory. However, you are not recommended to set the constraint that way! In
addition, you cannot set security roles and user mapping at runtime. Even if
you define such in the deployment descriptor, they will not take effect!
Security roles and user mappings are defined at application assembling phase!
You can deny access to various web server resources for other HTTP methods as
well. It is done the same way as for PUT method.
For more details on how to edit application∏s descriptor, see Administration
Manual -> Configuration Tasks -> How to Set up SAP J2EE Engine 6.20 Web Server
-> Setting Security Constraints section of the SAP J2EE Engine documentation.
For detailed description of the web application∏s deployment descriptor DTD,
see Java Servlet 2.3 Specification.
How to configure my web application to use HTTPS client authentication
mechanism?
You may complete this configuration task by editing the deployment descriptor
of your web application. You must set CLIENT-CERT value to the auth-method (#PCDATA)> element of the descriptor. For more information about
deployment descriptor DTD, see Java Servlet 2.3 Specification.
How to specify security constraints for a web application?
As defined in Java Servlet 2.3 Specification, a security constraint is defined
for a web resource collection and consists of authorization constraint and/or
user data constraint.
You may set the security constraints for your web applications either by
manually editing the web application∏s deployment descriptor, or using the
Deploy Tool. This must be done at application assembling phase only! If you try
to do it after deployment, changes will not take effect. At runtime, you can
only define user mapping to existing security roles using the Security Service
Runtime tab in the Visual Administrator.
If you decide to manually edit the deployment descriptor, you may refer to the
Java Servlet 2.3 Specification for a detailed DTD description. You can also
find the definitions of web resource collection, authorization constraint and
user data constraint terms there.
If you choose to use Deploy Tool, you may refer to Deploy Manual -> Deploy Tool
-> Generate J2EE Components section for information about how to do that.
Can I change JSPs, servlet classes and descriptors of a web application without
redeploying it?
Yes, you can change JSPs without redeploying the application and you even do
not need to restart it. Servlet classes and descriptors can also be changed
without redeploying the application, but they require that application be
restarted. However, we do not recommend that you change JSPs, servlets classes
or descriptors of running application that way. It may cause errors in various
cases. For example, when updating or redeploying an application, these changes
are lost, or when adding a new cluster element, these changes may be lost after
synchronization. You can use this approach of changing applications only for
testing or debug purposes!
Can I deploy two web applications with the same name?
No. The web container will reject (not deploy) a web application if another web
application with the same name was already deployed. For more information, see
Java Servlet 2.3 Specification, section 9.5 ∪Directory Structure∩.
How can I deploy my application to be the default for the web server?
To do this, you must give the
descriptor of the EAR you want to deploy, the value of ∪/∩ or ∪∩ (an empty
string). For example, if the following tags are present in the application∏s
application.xml:
Examples
examples.war
/
the application named ∪Examples∩ will be deployed as the default one for the
web server.
For more information about the application XML DTD, see Java 2 Platform
Enterprise Edition Specification, version 1.3.
How to enable application tracing for web applications?
SAP J2EE Engine application tracing mechanism allows you to log information
about user calls to different modules of the system. You can find description
of the procedure of enabling application tracing in Administration Manual ->
Configuration Tasks -> Setting up SAP J2EE Engine 6.20 for Application Tracing.
You can also find more information about what kind of events are logged for the
web container when different trace levels are set there.
What information is logged for the web container and where can I find it?
First, the location of the log files for different web container components
depends on your settings of the corresponding properties of HTTP Service and
Servlet_jsp Service. The explanation below is made for the default web
container settings that consern logging. If you have made certain changes of
these settings, you have to consider them in order to find the appropriate
information.
By default, logs about all requests and errors that appeared in HTTP Service
are saved in INFO.log. This file is located in
entry in this file contains information about the IP address of the client
machine, the first line of the request (the request method), the response
status returned and the number of bytes returned. In case of a request to a
servlet, the number of bytes returned takes the value of 0. In case of a PUT
request, the number of bytes of the request body received is logged instead of
the number of bytes returned.
HTTP Service may log in Common Log Format. In this case, the log messages are
save in http.log that is located in
All errors that occurred, as well as all servlets that had been initialized by
Servlet_jsp Service are logged in INFO.log by default. This file is located at
also contains log messages for other services.
If application tracing is enabled, more information is logged. It depends on
the trace level that you have set. Log messages of traced components are saved
in DEFAULT.log file that is located in
more information about the different trace levels and actions that can be
traced, see Administration Manual -> Configuration Tasks -> Setting up SAP J2EE
Engine 6.20 for Application Tracing.
Can I configure the web container to respond with custom reponse messages?
Yes, you can. To do this, you must define the response codes and the
corresponding messages in the web application∏s deployment descriptor. You
have to edit the element of the
descriptor. For more detailed description on how to do it, see Administration
Manual -> Services Administration Reference -> Servlet_jsp Service -> Critical
Information.
What formats of HTTP content and transfer codings does the web container
support?
It supports gzip and chunked codings (defined in HTTP 1.1 Specification, RFC
2616). You have to be aware that these codings are applied to responses only!
Resource Adapters
How can I deploy a resource adapter?
To do this, you can use either Visual Administrator or Console Administrator
tool.
In Visual Administrator use the ∪Runtime∩ tab of EISConnector? Service, which
is described in detail in Administration Manual > Services Administration
Reference > EISConnector? Service.
You can deploy a resource adapter using register_connector command from the
EISCONNECTOR command group. For information about this command, see
Administration Manual > Shell Commands Reference > EISCONNECTOR.
Can I add additional properties to an already deployed resource adapter?
No. The ∪Config Properties∩ sub-tab of EISConnector? ∪Runtime∩ tab in
Visual Administrator enables you only to edit the value of existing
configurable properties or create a new ManagedConnectionFactory? instance
configured with the same properties.
We recommend you to avoid creating new ManagedConnectionFactory? instances.
For information about the ∪Config Properties∩ sub-tab, see Administration
Manual > Services Administration Reference > EISConnector? Service.
How can I lookup a resource-adapter connection factory instance?
The following code illustrates how to lookup a connection factory:
// Obtain initial context
Context ctx = new InitialContext?();
/* Perform the JNDI lookup operation to obtain a connection factory instance.*/
javax.resource.cci.ConnectionFactory cf =
(javax.resource.cci.ConnectionFactory)
ctx.lookup (∪java:comp/env/
To lookup a connection factory instance, use the resource reference name, which
is specified in the
relevant component (that is, either ejb-jar.xml or web.xml).
How can I lookup a connection factory instance from a helper class in
additional library?
To do this, you must set a reference from this library to EISConnector? Service
in reference.txt (reference
lookup the connection factory instance by its name from the EISConnections?/
context in the Naming with the standard context properties for a stand-alone
client.
For information about editing reference.txt, see Administration Manual >
Configuration Tasks > Configuration of Additional Libraries. We recommend that
you use the Shell commands or the Deploy Tool rather than edit reference.txt
and library.txt manually.
How can I configure the number of pooled connections?
You can do this using the properties of EISConnector? ServicePoolSize? and
GranularSize?. For information about these properties, see Administration
Manual > Services Administration Reference > EISConnector? Service.
Why do I get a ClassNotFoundException? when deploying a resource adapter?
A possible cause for this exception is that the resource adapter uses an
additional library, which cannot be found.
Deploy the additional library and set a reference from the resource adapter to
the library (reference
EJB Container
What do container type A and container type B mean?
EJB Container type A and EJB Container type B are used for bean managed entity
beans. An EJB Container of type A manages a single instance for each primary
key of the bean during all transactions that currently use this entity. The
parallel calls from different threads are serialized. An EJB Container of type
B supports different instances for all transactions that currently use that
entity. For more information, see EJB 1.1 Specification, section 9.1.10
What EJB properties can I administrate after deployment?
The following properties can be modified from the runtime tab of the EJB
Service in SAP J2EE Engine Visual Administrator:
Security Tab
- the access to methods
- the mapping of security roles to users and groups
- the links of the security roles references
- new security roles can be added
- existing security roles can be removed
Environment Tab
- the value of an existing environment entry
References Tab
EJB References
- the lookup name of the referenced Bean (in the ∪Reference Link∩ field)
Resource References
- the reference link to the resource (in the ∪Resource Link∩ field)
- the user name for the predefined resource references
- the password for the predefined resource references
Additional Tab
- the display name of the bean
- the bean description
Storage Tab
- the name of the database pool
- the names of the database tables
- the names of the columns in the database tables
- the SQL criteria of the finder methods
How can I lookup a bean from an RMI client (stand-alone Java program)?
You must create the InitialContext? using the standard properties:
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
“com.inqmy.services.jndi.InitialContextFactoryImpl”);
properties.put(Context.SECURITY_PRINCIPAL, “Administrator”);
properties.put(Context.SECURITY_CREDENTIALS, “”);
properties.put(Context.PROVIDER_URL, “host:port”);
InitialContext ctx = new InitialContext?(properties);
Security principal can be any user in the system that has lookup permission for
the root context. In this way, a connection over rmi_p4 (SAP J2EE
Engine-specific protocol) is established. From this context the EJB will be
looked up by name, specified by the
However, to lookup the EJB and to create its instance, the client∏s
classloader needs the EJB client jar, located in
appName/cljarAppName.jar. This client jar must be specified in the client∏s
classpath, since SAP J2EE Engine does not support dynamic downloading of remote
stub classes.
Note: This must be used only in order to develop simple tests, not for working
scenarios. We recommend that you use application client, servlet, JSP or
another bean instead of a stand-alone Java program.
How is database information for CMP entity beans described?
The database information for CMP entity beans is described in a SAP J2EE
Engine-specific XML file calledstorage.xml. It must be located in the META-INF
directory in ejb.jar file, which is part of the application∏s archive file.
SAP J2EE Engine Deploy Tool provides options for generating and modifying
storage.xml. Alternatively, you can write your own storage.xml, but make sure
you keep the right format for storage.xml exactly as described in the
documentation.
The structure and the contents of storage.xml are described in Deployment
Manual in SAP J2EE Engine documentation.
Is it possible for a bean to use helper classes from an additional library?
Yes, it is possible. The additional library containing the helper classes must
be deployed (registered) either by using SAP J2EE Engine Deploy Tool or the
changelib shell command on the server command line. Then, a reference from the
application to the specific library must be set either by using Deploy Tool or
by using the changeref shell command on the server command line.
For more information about how to deploy libraries, see Deployment Manual.
For more information about how to register references between loaders, see
Administration Manual.
Can I start a new thread from a bean?
No, according to the Enterprise JavaBeans? 1.1 Specification (Section 18.1.2
Programming restrictions) thread management is performed by the EJB Container
and Enterprise JavaBeans? must not attempt to manage threads, which includes
starting, stopping, suspending, or resuming a thread; or changing a thread∏s
priority or name. Enterprise JavaBeans? must not attempt to manage thread
groups either.
These requirements ensure that the Container properly manages the runtime
environment.
How can I lookup a bean from a class in an additional library?
The additional library that contains the helper class must be deployed
(registered) and a reference from its loader to the application loader must be
set. Then, if the additional library is on a server in the same cluster as the
EJB application, the lookup is performed as with a stand-alone Java
programInitialContext is created using the standard properties and the EJB is
looked up by its name. The only difference between performing a lookup and
using EJBs from a stand-alone program, and a class in an additional library is
that no EJB client JAR is needed for the helper class in a library. However, if
the additional library is on a server node on a cluster different from the one
in which the EJB application is deployed, the Initial_context_factory property
for creating initial context should have the following value:
com.inqmy.services.jndi.RemoteInitialContextFactoryImpl, or the additional SAP
J2EE Engine-specific property force_remote should be set to ∪true∩. The
client JAR of the EJB application must be available to the additional library
(that is, it must be included in its JAR file or registered as a separate
library, to which a reference must be set).
How can I lookup a bean from another application?
If a bean from one application must be accessed by a JSP, servlet or another
bean from another application in the same cluster, it is enough to specify an
EJB reference (
bean and register a reference between the loaders of the applications. Then the
lookup is performed in the usual way, as if the bean is in the same
application:
javax.naming.Context context = new InitialContext?();
Object objRef = context.lookup(“java:comp/env/refName”);
UseMessageBeanHome usemessagebeanhome =
(UseMessageBeanHome?)PortableRemoteObject.narrow(objRef,
UseMessageBeanHome?.class);
If the two applications are deployed on different clusters, the one from which
the lookup will be performed should have access to the client JAR of the bean.
Here, the lookup procedure is the same as the one described for lookup of a
bean from an additional library located on a second cluster.
Cluster Configuration
Are applications and libraries on server nodes synchronized?
Yes. All applications and libraries that they use are synchronized on every
server node in SAP J2EE Engine cluster.
What is the default_library.txt file for?
This file describes the libraries that SAP J2EE Engine needs to run properly.
They are provided by default with its installation. The default_library.txt
file is located in
recommend you to avoid editting this file manually, since it is for internal
server use only.
How to add a second server/dispatcher node on the same physical machine?
SAP J2EE Engine provides a tool for creating additional server and dispatcher
nodes. Config Tool that is located in
directory has a visual and a command line interface that allow for quick and
easy startup of new SAP J2EE Engine cluster nodes.
For more information about how to use Config Tool, see Administration Manual ->
Administration Tools -> ConfigTool?.
You can add new cluster nodes by manually changing the property files of
services and managers as well. This procedure is thoroughly described in
Administration Manual -> Administration of SAP J2EE Engine 6.20 Cluster ->
Adding Nodes to SAP J2EE Engine 6.20 Cluster.
How to add a new server node located on a different physical machine to SAP
J2EE Engine cluster?
Adding a new node to an existing cluster on a different physical machine cannot
be performed with SAP J2EE Engine Config Tool, since it is for local use only.
For example, to configure a cluster installation with the following structure:
- Machine A with dispatcherA and serverA running on it
- Machine B with server B running on it
you must complete the following steps:
1. Install SAP J2EE Engine on machine A
2. Install SAP J2EE Engine on machine B
3. Run Config Tool on machine B and change the ClusterHosts? property of
Cluster Manager on the server node so that it contains the
4. Make sure the new server node has a different name and cluster ID from those
used so far.
5. Set the LocalLoadBalancing? property of Service Manager on the dispatcher to
false, so that requests are dispatched to each server in the cluster. If this
property is set to true, requests from the dispatcher are sent only to the
servers on the same physical machine.
6. Start the nodes.
How to connect two dispatcher nodes running on different physical machines in
the cluster?
To configure a cluster with the following structure:
- Machine Adispatcher A, serverA
- Machine Bdispatcher B, server B
you must complete the following steps:
1. Install SAP J2EE Engine on machine A
2. Install SAP J2EE Engine on machine B
3. Run Config Tool on machine A and change the ClusterHosts? property of
Cluster Manager on the dispatcher node so that it contains the
4. Run Config Tool on machine B and change the ClusterHosts? property of
Cluster Manager on the dispatcher node so that it contains the
5. Make sure that all cluster nodes have different names and IDs?
6. Set the LocalLoadBalancing? property of Service Manager on both dispatchers
to false, so that requests from each dispatcher are dispatched to each server
in the cluster. If this property is set to true, requests from each dispatcher
are sent only to the servers on the same physical machine.
7. Start the nodes.
How to configure a SAP J2EE Engine node to start in background mode?
You can use SAP J2EE Engine Config Tool for configuring a cluster node as a
Windows service or UNIX daemon. The procedure is thoroughly described in
Administration Manual -> Administration Tools -> ConfigTool? -> SAP J2EE Engine
6.20 as an NT/2000 Service or a Unix Daemon.
How to configure several nodes on one machine to run in background mode?
To run more that one server node in background mode on the same physical
machine, first you have to configure the nodes as service/daemon as described
in Administration Manual -> Administration Tools -> ConfigTool? -> SAP J2EE
Engine 6.20 as an NT/2000 Service or a Unix Daemon. Then manually change
Service_i_name parameter in service.ini file generated in
where ∪i∩ is the service number (each node must have a unique name) and start
it.
How to access the server or dispatcher to perform administrative functions when
SAP J2EE Engine is running in background mode?
When SAP J2EE Engine is running in background mode as NT/Windows 2000 service
or UNIX daemon, you can obtain access to the server or dispatcher using Telnet
Service. To use Telnet Service start a telnet session to the host of the
dispatcher with the same port as that of the port of Telnet Service (default
value is 2323). Use SAP J2EE Engine Visual Administrator to view the telnet
port configurationgo to Dispatcher > Services > telnet and check the port
property. This gives you access to the dispatcher node. You can use the jump
command from the dispatcher telnet console to reach a server node telnet
console.
For more information about how to connect to SAP J2EE Engine using telnet and
how to use the jump command, see Administration Manual -> Configuration Tasks
-> Remote Administration Using Telnet.
When do configuration changes take effect?
Runtime configuration changes (for example, changing a property in a runtime
control of a specific service from SAP J2EE Engine Visual Administrator) take
effect immediately.
You can change services∏ and managers∏ properties with Visual Administrator,
using the shell commands and by manually editing the corresponding property
file. Changing a manager∏s property or a core service∏s property by one of
the above-described ways requires a restart of the whole system. Changing a
property of an additional service requires a restart of the specific service
only. This restart is performed automatically when using Visual Administrator
or shell commands. However, if you change additional service property manually
from a property file, you have to take care about restart.
How does Appclear Tool work?
Appclear Tool that is distributed with SAP J2EE Engine installation, performs a
cleanup of the internal database management system, the work directories of all
containers, as well as their log files and removes all applications that are
deployed on the specific server node, respectively. It also removes all runtime
settings and tunings of the system that are not saved in property files.
Appclear Tool must not be run when the specific server node is started. Stop
it, run appclear tool and then start it again.
How to specify SAP J2EE Engine memory settings?
You can specify system memory settings for SAP J2EE Engine at installation
phase. The installation tools provide a property Maximum java heap size that
can be set prior to installing the server. If you need to change the memory
settings after installation, you must modify go script and cmd_line.properties
files of the relevant cluster node. Changes in cmd_line.properties affect the
memory used when starting SAP J2EE Engine in background mode, and go script
refers to starting it in foreground mode. In go script you must modify the
MEMORY parameter to the desired valuefor example, set MEMORY=256M sets the
maximum heap size to 256 megabytes. In cmd_line.properties you must modify the
Dmemory.manager and Xmx parameters. For example, to set the memory to 256M
enter the following in cmd_line.properties:
-Dmemory.manager=256M -Xmx256M?. You can also change Cmd_line properties using
SAP J2EE Engine Config Tool.
Why does dispatcher/server startup fail when attempting to start Log Manager?
The possible cause of this problem is not enough free disk space. To solve it
you just have to free some space on the disk of your machine.
Why does server startup fail on DBMS service?
The possible causes of this problem are:
- not enough free disk space;
- no write permission (for writing on the file system) for the user account,
with which SAP J2EE Engine is started;
- appclear script has been started while a server node was still running.
In the first of the above cases, you have to free enough disk space on your
machine. In case of no write permission for the user, you have to grant such
for that user. In the third of the above cases, you have to stop SAP J2EE
Engine, then run appclear script, and after that, you can start the system
again.
Why a SAP J2EE Engine server node cannot connect to a dispatcher node?
A possible reason for this behavior might be the wrong port configuration of
Cluster Manager on both dispatcher and server nodes. Make sure the value of one
of the entries for ClusterHosts? property of the Cluster Manager of the server
node corresponds to the JoinPort? property of the Cluster Manager on the
dispatcher node.
If starting SAP J2EE Engine in an SAP R/3 system environment, the insufficient
Security Service timeout could cause startup failure. Every time SAP J2EE
Engine starts in SAP Web AS environment, its Security Service tries to load the
SAP R/3 users. It connects to the SAP Web AS as SAPJSF user via JCo. In some
cases (for example, when the user does not exist or R3Security?.properties file
is incorrect) JCo returns too late, which causes SAP J2EE Engine∏s Service
Manager to raise “Timeout starting core services” and to stop the system. The
solution is to set greater values to CoreLoadTimeout? and
AdditionalLoadTimeout? properties of Service Manager.
Why does server startup fail with java.net.BindException: Address in use:
JVM_Bind?
Some ports used by SAP J2EE Engine could be busy. Generally, startup of
communication services such as P4 Service, HTTP Service, Monitor Service or
Telnet Service, as well as Cluster Manager, could fail if their ports are busy.
Use netstat a in a command prompt to see all ports that are busy, and free
those needed by SAP J2EE Engine, or change the port properties of communication
services.
Why does SAP J2EE Engine startup on HP-UX fail with the following error
message: java.lang.OutOfMemoryError: unable to create new native thread?
The reason for this behavior is wrong configuration of operating system kernel.
To solve it, set the following kernel params: max_thread_proc 256 (or more) and
nkthread 7200 (or more).
XML Parser
How can I use SAPXMLToolkit in a stand-alone program?
To use the SAPXML Toolkit in a stand-alone program, you can set the following
system properties:
javax.xml.parsers.DocumentBuilderFactory=
com.inqmy.lib.jaxp.DocumentBuilderFactoryImpl
javax.xml.parsers.SAXParserFactory= com.inqmy.lib.jaxp.SAXParserFactoryImpl
javax.xml.transform.TransformerFactory=
com.inqmy.lib.jaxp.TransformerFactoryImpl,
or make sure the SAPXMLToolkit.jar is set in your CLASSPATH. This file must be
set before any other XML parser’s JAR file.
How can I use SAPXMLToolkit in a deployed application?
To use SAPXMLToolkit, you must register a reference to it from your
application. This can be done at deployment time using either Deploy tool or
the Deploy Service CHANGEREF command. Another possibility is to manually edit
reference.txt file located in
If you choose to manually edit reference.txt file, which is not recommended in
any way, add to it the following line:
reference
How can I use Xerces parser in my application?
There are three possible ways to use Xerces parser in your application:
1. Register Xerces as an additional library on SAP J2EE Engine. You can do this
using the Deploy Service CHANGELIB command or manually copy the archive file in
nodes and
server nodes. Then add the following line in library.txt file located in
dispatcher nodes and in
directory for server nodes:
library xerces xerces.jar
Then register a reference from your application to the Xerces library, using
the CHANGEREF shell command of Deploy Service, or manually in reference.txt
file located in the same directory as the above mentioned library.txt.
2. If you are using the Xerces parser in classes that are included in a WAR
file, add xerces.jar in the Web-Inf/lib directory in the WAR.
3. Add xerces.jar to your applications EAR.
How can I use an HTTP proxy while parsing an XML?
You must set the http.proxyHost and http.proxyPort system properties.
Web Services
Can I register a bean as a port for a Web service in SAP J2EE Engine 6.20?
You cannot register a bean as a port for a Web service. This feature is
supported by SAP J2EE Engine 6.30. However, with 6.20 version you can call a
method of the bean through SOAP.
Where can I find the WSDL for a bean?
You can find the bean∏s WSDL at the following URL:
http://localhost/soapdispatcher?WSDL=
name of your bean.
Do I have to deploy SOAPDispatcher? in order to access Web Services framework?
No. SOAPDispatcher? is a default application. To access Web Services framework,
enter http://localhost/soapdispatcher in the address bar of your browser.
What happens if I deploy the old soapdispatcher.ear?
It replaces the default SOAPDispatcher?. This affects the application
performance since the EAR contains older classes.
How can I generate a proxy for the generated WSDL?
Use the WSDL ProxyGenerator? in order to generate the proxy. For more
information, see 6.1. SAP J2EE Engine SOAP Proxy Generator section in the Web
Services document.
How can I use SAP’s SOAP implementation (inqmysoap.jar) with IBM’s UDDI4J?
You have to set the following system property:
org.uddi4j.TransportClassName= com.inqmy.lib.soap.uddi4j.InQMySOAPTransport
For more information, see the 7. UDDI4J Pluggability section in the Web
Services document.
How can I access a bean that had been deployed as a Web service?
To use the deployed bean, generate a proxy using the ProxyGenerator? and call
the proxy methods (the WSDL of the service is also required). For more
information, see 3. Setting up Web Services Framework and 6.1 SAP J2EE Engine
SOAP Proxy Generator sections in the Web Services document.
Security
How to assign JNDI permission to a specific user?
Assigning JNDI permissions to a specific user can be performed through Naming
service runtime panel in Visual Administrator. Choose the JNDI context and the
user or group for which permissions are granted. Then with the “<<” button you
can grant permissions for a specific context, and with the “<<<” you can grant
permissions for a specific context and all its subcontexts. The same applies
for denying specific permissions to users or groups. With the “>>” button you
deny permission for the specific context and with the “>>>” button for the
specific context and all its subcontexts.
How to restrict telnet access for a specific user application?
You can restrict telnet access for a specific user using the Security service
runtime panel (Resources tab) in Visual Administrator. From the Resources tree
choose System >telnet and grant or deny access to the users from Users on
Server tree.
What additional libraries do I need to start Keystore and SSL services and
where should I put them?
To start Keystore and SSL services on SAP J2EE Engine, you need the IAIK
package, namely iaik_jce.jar, iaik_jsse.jar and iaik_ssl.jar, w3c_http.jar. The
archives can be downloaded from the IAIK official site. You must put the jar
files in additional-lib folder of each cluster node:
- ../cluster/dispatcherName/additional-lib/
- ../cluster/serverName/additional-lib/
- ../alone/additional-lib/
To enable Keystore and SSL Service administration using SAP J2EE Engine Visual
Administrator, you must also put the above libraries in ../admin/lib/ directory.
What is the order of starting of Keystore Service and SSL Service?
To start both services, you first need to install the IAIK package; then start
Keystore on all cluster nodes, first on server, then on dispatcher ones. After
that start SSL service on all nodes.
How to install a server certificate?
To install and enable a server-side certificate, you have to either load the
certificate or generate one using the Keystore Service panel in Visual
Administrator. Then go to SSL Service runtime panel and select the SSL socket
for which you want to enable the certificate. From the Certificates subtab
click the “Add” button and choose your certificate from the list of available
ones. Note that when adding a new certificate the old one that was enabled is
replaced.
How to generate a certificate-sending request?
You can generate a certificate-sending request (CSR) for a key in SAP J2EE
Engine keystore using the “Generate CSR” function in Keystore runtime panel of
SAP J2EE Engine Visual Administrator.
How to self-sign a certificate?
You must specify that a certificate is self-signed when creating it. Use the
“Certificate Generation” tab of Keystore Service runtime panel in SAP J2EE
Engine Visual Administrator. Specify the required properties of the
certificate. To generate a self-signed certificate, do not specify any alias in
the “CA Key Alias” drop-down menu. SAP J2EE Engine does not support self-sign
on already existing certificates.For more information about how to generate
certificates, see Administration Manual -> Services Administration Reference ->
Keystore Service -> Certificate Generation section.
How to load a certificate?
You can load an existing certificate either using Keystore Service runtime
panel in Visual Administrator or using the LOAD shell command from the KEYSTORE
command group. For more information about the Keystore Service shell commands,
see Administration Manual -> Shell Commands Reference.For more information
about the Keystore Service runtime functions, see Administration Manual ->
Services Administration Reference -> Keystore Service section.
How to store a certificate/key?
You can store a certificate either using Keystore service runtime panel in
Visual Administrator or using the STORE shell command from the KEYSTORE command
group. Alternatively you can use the “Write” function in Keystore service
runtime panel in Visual Administrator or the WRITE shell command from KEYSTORE
command group to store certificates and keys in ASCII format. If using Visual
Administrator, the default store is ../admin. For more information about the
Keystore Service shell commands, see Administration Manual -> Shell Commands
Reference.For more information about the Keystore Service runtime functions,
see Administration Manual -> Services Administration Reference -> Keystore
Service section.
Plug-ins Configuration and Remote Debugging
Where can I find information on how to configure JBuilder Plug-in?
How to configure and use the JBuilder plug-in is described in Configuring
JBuilder Plug-in for Application Deployment and Debugging section in
Development Manual.
Where can I find information on how to configure SAP J2EE Engine for remote
debugging?
How to configure SAP J2EE Engine for remote debugging is described in
Configuration Tasks > Setting up SAP J2EE Engine for Remote Debugging section
of Administration Manual.
Can I use JBuilder plug-in with SAP J2EE Engine cluster version?
No. JBuilder plug-in is compatible with SAP J2EE Engine 6.20 stand-alone
version. It cannot be used with the cluster version.
Why is documentation Start Page no longer shown under http:\\localhost when the
server is started through JBuilder?
When starting SAP J2EE Engine through JBuilder the HTTP port on which it
listens for requests is changed, as well as the default root of the HTTP
server. Thus, in the standard configuration the HTTP port is 8080, and the
default root is the JBuilder project directory. To access the documentation
Start Page, you have to register it as an HTTP alias. Go to HTTP Service
runtime panel in Visual Administrator, enter Alias name, the name under which
you would like the Start Page to be accessible, and the full path to the docs
directory in the “Path” field. Then choose “Add.” Now, you can access the
documentation Start Page under http://localhost:8080/yourAliasName.
Monitoring
How to start the monitor server?
Execute the monitor script file on the command line. The monitor script file is
located in the
configuration file named properties exists and is located in the
the default configuration startup properties. It takes its startup properties
from that configuration file even though the file is not specified when
starting the Monitor Server.
How can the monitored data be viewed or stored?
There are several ways to view and/or export the monitored data:
- by using the SAP J2EE Engine Visual Administrator – only the current
monitored data can be viewed but cannot be monitored in progress.
- by exporting to a file system – the monitored data is stored in files.
- by exporting to SAP’s CCMS – provides options for viewing and storing the
monitored data.
- by using the browser-based monitoring – displays the monitored data in
progress.
For more information about how to configure each of the monitoring systems
above, see the Monitoring section in the Administration Manual.
How can I change the monitor server startup properties?
Create a configuration file and specify it as an argument when executing the
Monitor Server script file – for example: monitor configuration_file, where
configuration_file is the name of the configuration file.
The Monitor Server is then started using the settings from the configuration
file.
The configuration file priority is higher than the default settings. The
Monitor Server uses a default property setting only if this property is not set
in the configuration file.
The configuration file must be in text format and must be located in the same
directory as the Monitor Server script file (monitor.bat) – that is, in the
For more information about how to create the configuration file and description
of its contents, see the Administration Manual in SAP J2EE Engine documentation.
What additional libraries do I need to export data to CCMS?
You need Jmon API (jmon.dll). It is not included in the SAP J2EE Engine
distribution package and can be obtained from the SAP J2EE Engine provider.
It is critical to specify the path to jmon.dll in the monitor script file – for
example, -Djava.library.path=”%PATH%”;
Why my monitor server cannot connect to SAP J2EE Engine cluster?
The reason is that the server, to which the connection should be established,
is either down or the connection settings you specified are wrong. You must
start the server and reconnect the monitor server to it by executing the
connect shell command on the monitor server command line. Make sure the
provider url (hostname:p4_service_port), username and password you specify at
connection time are correct.
Integration
How is the communication between an SAP R/3 Dispatcher and SAP J2EE Engine
accomplished?
The communication between SAP R/3 Dispatcher and SAP J2EE Engine is performed
through R3Startup? Manager and R3Startup? Service on the J2EE side. The
R3Startup? Service, which runs on SAP J2EE Engine dispatcher node, communicates
through TCP/IP with SAP R/3 Dispatcher and holds information about all running
server nodes.
Where to find information on how to enable redirect from ICM to SAP J2EE
Engine?
You can find information on SAP J2EE Engine integration in the Integration
document. See also the following topics in SAP Web Application Server 6.20:
- SAP Library->mySAP Technogy Components->SAP Web Application Server->SAP J2EE
Engine->Integrating the SAP J2EE Application Server->Administration of the SAP
Web Application Server
- SAP Library->mySAP Technogy Components->SAP Web Application
Server->Client/Server Technology->Architecture of the SAP Web Application
Server->Parameterizing the ICM and the ICM Server Cache->Sample Profile for the
ICM
Administration APIs?
How to programatically obtain the client JAR that has been generated at
deployment time?
You can do this by using File Service interfaces that are described in detail
in the “Services Guide” section of Development Manual. In order to obtain the
File Service runtime interface (FileTransfer?), you have to lookup the service
and then call one of its createRemoteFile() methods. RemoteFile? class on the
other hand provides methods for upload and download of files that are located
on different logical servers. Its download() method can be used to retrieve the
client JAR located in
How to perform programatic startup of a service?
You can do this by using Admin Service interfaces that are described in detail
in the “Services Guide” section of Development Manual. Lookup of Admin Service
returns RemoteAdminInterface?. Using its getAdminServiceManager() method, you
can obtain AdminServiceManager? interface. AdminServiceManager? interface
provides methods for starting and stopping of a specific service by specifying
the service name and clusterId (the ID of the cluster node the service runs
on). You can also use it to retrieve and change service descriptors and
properties.
How to retrieve logs for a specific service, a manager, or whole cluster node?
You can do this by using Admin Service interfaces that are described in detail
in the “Services Guide” section of Development Manual. Lookup of Admin Service
returns RemoteAdminInterface?. You can use its getAdminServiceManager() method
to obtain AdminServiceManager? interface. AdminServiceManager? provides a
getLogViewer() method that returns AdminLogViewer? interface. From
AdminLogViewer? after initialisation with cluster id(s) logs for a specific
service, manager or entire cluster node can be retrieved. AdminLogViewer?
methods description can be found in the Admin Service part of the “Services
Guide” section of Development Manual. You may also see the Log Service APIs?
description in the same section of Development Manual.
How to retrieve a communication service port on a specified cluster node
You can do this by using Admin Service interfaces that are described in detail
in the “Services Guide” section of Development Manual. Lookup of Admin Service
returns RemoteAdminInterface?. You can use its getAdminServiceManager() method
to obtain AdminServiceManager? interface. AdminServiceManager? provides a
getServiceProperties(int clusterId, String serviceName) method that returns a
Properties object, from which you can obtain the specific communication service
port with getProperty(“portPropertyName”) method.
How to retrieve all existing users on SAP J2EE Engine?
You can do this by using Security Service interfaces that are described in
detail in the “Services Guide” section of Development Manual. Lookup of
Security Service returns RemoteSecurity? interface. It provides a
getRemoteUserManager() method that returns an interface for managing the User
Management module. RemoteUserManager? has a users(boolean user) method that
returns a String array with all users in the system if the boolean parameter is
set to true. If the boolean parameter is set to false, a String array with all
user groups in the system is returned.
How to obtain information about a specific user?
You can do this by using Security Service interfaces that are described in
detail in the “Services Guide” section of Development Manual. Lookup of
Security Service returns RemoteSecurity? interface. It provides a
getRemoteUserManager() method that returns an interface for managing the User
Management module. RemoteUserManager? has a getUserInfo(String name, boolean
user) method that returns a RemoteUserInfo? object encapsulating all properties
of the specific user. RemoteUserInfo? provides also methods for obtaining the
children and parents of the specified user or group, as well as for
administrative privileges checking.
How to connect to SAP J2EE Engine from a client with httptunneling layer?
You can look at the example of performing httptunneling connection to SAP J2EE
Engine that exists in the
directory.
In general, to establish a connection over httptunneling when creating
InitialContext? some additional properties should be put, denoting
httptunneling port, host and transport layer queue.
P4 Service
How can I generate stubs with remote support for rmi_p4?
You can do this using the RMIC Tool provided with SAP J2EE Engine 6.20. For
detailed information about the functions of this tool, see Administration
Manual > Administration Tools > RMIC Tool.
Can I use standard RMIC to generate stubs
No. Since P4 is a specific protocol for SAP J2EE Engine, standard tools do not
support it. Use the RMIC tool provided with SAP J2EE Engine to generate stubs.
Is UnicastRemoteObject? supported by rmi_p4?
No. RMI_P4 supports PortableRemoteObject? to enable remote communication.
Are the remote classes dinamically downloaded or they must be specified in the
classpath of the RMI client?
In SAP J2EE Engine 6.20 the remote classes are not downloaded dynamically. You
have to add the file that contains the stubs and the skeletons to the client’s
classpath. This will be changed in SAP J2EE Engine 6.30.
How to use RMIC Tool?
You can find information on how to use the RMIC Tool in Administration Manual >
Administration Tools > RMIC Tool.
JMS
Does SAP J2EE Engine JMS implementation support persistent messages?
Yes. The JMS Service allows using global transactions using the
XATopicConnectionFactory? or XAQueueConnectionFactory?.es, JMS Service on SAP
J2EE Engine supports persistent messages.
Does SAP J2EE Engine JMS implementation support JTA XA API?
Yes. The JMS Service allows using global transactions using the
XATopicConnectionFactory? or XAQueueConnectionFactory?.
Does SAP J2EE Engine JSM implementation supports user/password verification
when creating connections?
No, SAP J2EE Engine does not support user/password verification. Event if such
credentials are supplied, they are not taken into consideration.
How can I administrate jms destinations on SAP J2EE Engine?
Use the Console Administrator tool. In it, type “add jms” to activate the JMS
Service group of commands. Use the commands provided to create and bind Topics
and Queues and to administrate the JMS Destinations. You can also use Visual
Administrator to manage destinations. Open the JMS Service tab and choose
Topic, Queue or Subscription. Using the “Add” and “Remove” buttons, you can
easily create or remove destinations. For more information about managing
destinations using Visual Administrator, see Administration Manual -> Services
Administration Reference -> JMS Service -> Visual Administrator.
Class Loading
How does SAP J2EE Engine’s class loading system work?
The class loading system is centralized in the ClassLoaderManager?. It
implements interfaces used for registering and deregistering of loaders and
references between them, as well as for accessing loaders referenced by another
loader. SAP J2EE Engine classloading system consists of several different types
of loaders – FileClassLoader?, ReferencedLoader?, Frame Loader,
CoreClassLoader?, ServiceClassLoader?, ApplicationLoader?.
FileClassLoader is a super class for all other classloaders in SAP J2EE Engine
class loading system and implements the main loading functionality.
FrameClassLoader? is used to load the classes from Service Framework. It has
just one instance and no references to other loaders. Frame Loader is the
parent of CoreClassLoader?, ServiceClassLoader? and ApplicationLoader?.
CoreClassLoader? also has just one instance; it is used for loading managers’
classes. As their names imply, ServiceClassLoader? is used for loading
services’ classes and ApplicationLoader? is used for loading applications’
classes. Both ServiceClassLoader? and ApplicationLoader? are direct derivatives
of ReferencedLoader? and use the referencing functionality offered by it. This
way they gain access to classes loaded with a different ReferencedLoader?.
Classes in libraries that are shared between applications are also loaded with
ReferencedLoader?.
Referenced loaders are registered and kept in ClassLoaderManager?. Each loader
is distinguished from the others by its name that obeys the following
convention: the loader of each service is named service:serviceName, the loader
of each application or resource adapter is named by its display name and the
loader of each library is named library:libraryName. Each ReferencedLoader? is
wrapped in a ReferencedLoaderWrapper? that contains information about the
references of the specific loader and the ReferencedLoader? itself.
Registration and deregistration of a ReferencedLoader?, as well as of
references from a ReferencedLoader? to another ReferencedLoader?, is done by
name. If a ReferencedLoader? has loaded a class, the referred loader must not
try to load or resolve it. Thus the following mechanism is used: first locally
cached classes are checked, then the parent loader, the registered references
to other referenced loaders, and finally the ReferencedLoader? itself tries to
load the class.
What kind of references between loaders can be set?
The following types of references between loaders can be set: -A?
- Reference between two service loaders
- Reference from an application to a service
- Reference from an application to a library
- Reference from a library to an application
- Reference from a library to another library
- Reference from a library to a service
- Reference from a service to a library
Different types of references are specified in library.txt, reference.txt and
provider.xml files. library.txt file, located in
definitions of all additional libraries (for more info on library deployment
see Deployment Manual) as well as the references (if any) between this
particular library and other libraries. All application references are set in
reference.txt, and all service references are set in provider.xml. You can see
the “Configuration of Additional Libraries” section of Administration Manual
for more information about how to set the different types of references.
Generally it is not recommended to manually edit library.txt, reference.txt and
especially provider.xml files of SAP J2EE Engine services, since tools and
shell commands are provided for setting and changing references and deploying
libraries.
How to set a reference from an application to a library?
The library that is referenced must be deployed or registered on SAP J2EE
Engine server. You can do this simultaneously with the application deployment,
when you use Deploy Tool (for more information about this topic, see Deployment
Manual). Another option is to copy the library archive in
this library in library.txt located in
yourLibraryName yourArchiveName.jar). Then a reference from the application to
the library must be registered. You can do this at deployment time when you
deploy the library, using the changeref shell command or manually by adding the
reference in reference.txt located in
reference yourAppDisplayName library:yourLib). The reference can be set
programmatically using the methods provided by Deploy Service runtime
interface, described in details in Development Manual.
How to set a reference from a library to another library?
First, both libraries must be deployed either using Deploy Tool or registered
manually (for more information about this topic, see Administration Manual).
Then, by using Deploy Tool, the changeref shell command or manually editing
library.txt (this is adding the entry: reference firstLibName secondLibName),
you can set the reference between them. The reference between the libraries can
also be set programmatically with the methods provided by Deploy Service
runtime interface, described in Development Manual. Note, that if you have a
large number of additional library archives, which are interdependent, it is
recommended to register them as one library on SAP J2EE Engine server in order
to avoid complex classloader interdependencies and possible problems.
How to set a reference from a service to another service or to a library?
References from a particular service to other services and libraries are listed
in service’s provider.xml file that is located in
edit this file manually. Instead, you can use Deploy Tool or changeref shell
command. Another option (that is also not recommended) is manually editing
reference.txt file located in
from a service to a service, you can add the following line to reference.txt:
reference service:serviceOneName service:serviceTwoName.
If referencing a library, add the following line to reference.txt:
reference service:serviceName library:libName.
The reference can also be set programmatically with the methods provided by
Deploy Service runtime interface, described in details in Development Manual.
How to reference a library or a service from the default application?
The display name that must be used when registering references from the default
application on SAP J2EE Engine server is Default. You can use Deploy Tool, the
changeref shell command or manually edit the reference.txt file (as described
in “How to set a reference from an application to a library” question above) to
register a reference from it to a library, service or another application on
SAP J2EE Engine.
How to reference a service or a library from a Resource Adapter?
To reference a service, add the following line to reference.txt:
reference
To reference a library, add the following line to reference.txt:
reference
The display name of the resource adapter is the one that is specified in
META-INF/ra.xml in the resource archive (RAR) file.
You can also use Deploy Tool or changeref shell command to set these
references. Using the methods provided by Deploy Service runtime interface you
can set the references programmatically. The Deploy Service runtime interface
is described in detail in Development Manual.
How to deregister a reference?
You can use changeref shell command to remove a reference between two loaders.
Here is an example of its usage:
changeref -r application:yourApplicationName library:yourLibName
This removes the reference between the application with name
yourApplicationName and the library with name yourLibName. The same can be
accomplished by deleting the corresponding line in reference.txt file located
in
can be removed programmatically with the methods provided by Deploy Service
runtime interface that is described in details in Development Manual.
Where can I put property files needed by an application so they can be loaded?
Property files can be put in any JAR file that is part of the application,
including the JAR files, located in WEB-INF\lib directory of its web part. For
a web application the property files can also be put in the WAR file in
WEB-INF\classes directory.
If the application uses an additional library and a reference to it is set,
property files can also be included in the JAR file of the library. However, if
the property file is not bundled in a JAR file, but is just included in the
root of the application EAR file, it will not be loaded, and will not be found
by the application classes.
Why do I get a ClassNotFound? exception when deploying or starting an
application?
Probably a reference from an application to a library, or from a library to a
library is missing. You can check if all required references are set using the
ll shell command that lists all loaders on SAP J2EE Engine and the references
between them. You can also look at reference.txt file located in
Why do I get a ZipException? when deploying a library or starting an
application?
A possible cause for this problem might be a missing library JAR file, either
because a wrong file name was specified, or because the library has been
registered but the JAR file with the classes does not exist at the specified
location. Another cause of the exception might be the usage of a wrong file
separator if library.txt has been edited manually (which is not recommended in
any way). Double check if all required files exist and are correct.
Why do I get a java.lang.UnsatisfiedLinkError after restarting an application
or a pool?
Uhis exception might occur because the application or the pool is using an
additional library or a JDBC driver that has native parts in it and that are
loaded just once for the Java Virtual Machine (JVM). A possible solution is to
restart the container in which the application is running, or DBpool? Service.
Why do I get a ZipException? when deploying a library or starting an
application?
A possible cause for this problem might be a missing library JAR file, either
because a wrong file name was specified, or because the library has been
registered but the JAR file with the classes does not exist at the specified
location. Another cause of the exception might be the usage of a wrong file
separator if library.txt has been edited manually (which is not recommended in
any way). Double check if all required files exist and are correct.
Why do I get a java.lang.UnsatisfiedLinkError after restarting an application
or a pool?
Uhis exception might occur because the application or the pool is using an
additional library or a JDBC driver that has native parts in it and that are
loaded just once for the Java Virtual Machine (JVM). A possible solution is to
restart the container in which the application is running, or DBpool? Service.
6.30 FAQ
Problem: Engine stops after running only for an hour.
Possible cause:
License invalid.
Check:
look for messages in
/usr/sap/C11/JC00/j2ee/cluster/server0/log/console_logs/error.log saying that
the server will go down because the license is invalid.
Solution: Install a new license.
See http://intranet.sap.com/likey then follow the link “mySap J2EE Engine” and
there “installing a license Key in….”. — HolgerOehm – 25 Jul 2003
Topic J2EESupportFAQ . { Edit | View | Attach | Ref-By | Printable | Diffs |
r1.3 | > | r1.2 | > | r1.1 | More Actions } One Click Registration
Revision r1.3 – 17 Jun 2004 – 10:18 GMT – PavelZlatarev
Copyright ?2000-2004 by the contributing authors. All material on this
collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding BIS? Send feedback.
第一,谈谈final, finally, finalize的区别。
final?修饰符(关键字)如果一个类被声明为final,意味着它不能再派生出新的子类,不能作为父类被继承。因此一个类不能既被声明为 abstract的,又被声明为final的。将变量或方法声明为final,可以保证它们在使用中不被改变。被声明为final的变量必须在声明时给定初值,而在以后的引用中只能读取,不可修改。被声明为final的方法也同样只能使用,不能重载。
finally?再异常处理时提供 finally 块来执行任何清除操作。如果抛出一个异常,那么相匹配的 catch 子句就会执行,然后控制就会进入 finally 块(如果有的话)。
finalize?方法名。Java 技术允许使用 finalize() 方法在垃圾收集器将对象从内存中清除出去之前做必要的清理工作。这个方法是由垃圾收集器在确定这个对象没有被引用时对这个对象调用的。它是在 Object 类中定义的,因此所有的类都继承了它。子类覆盖 finalize() 方法以整理系统资源或者执行其他清理工作。finalize() 方法是在垃圾收集器删除对象之前对这个对象调用的。
第二,Anonymous Inner Class (匿名内部类) 是否可以extends(继承)其它类,是否可以implements(实现)interface(接口)?
匿名的内部类是没有名字的内部类。不能extends(继承) 其它类,但一个内部类可以作为一个接口,由另一个内部类实现。
第三,Static Nested Class 和 Inner Class的不同,说得越多越好(面试题有的很笼统)。
Nested Class (一般是C++的说法),Inner Class (一般是JAVA的说法)。Java内部类与C++嵌套类最大的不同就在于是否有指向外部的引用上。具体可见http: //www.frontfree.net/articles/services/view.asp?id=704&page=1
注: 静态内部类(Inner Class)意味着1创建一个static内部类的对象,不需要一个外部类对象,2不能从一个static内部类的一个对象访问一个外部类对象
第四,&和&&的区别。
&是位运算符。&&是布尔逻辑运算符。
op1 & op2 , 当 op1 和 op2 都为真时,返回值才为真,但总是检查op1和op2的值
op1 && op2, 当 op1 和 op2 都为真时,返回值才为真,但当op1的值为false时,op2的值就不再被查了
第五,HashMap和Hashtable的区别。
都属于Map接口的类,实现了将惟一键映射到特定的值上。
HashMap 类没有分类或者排序。它允许一个 null 键和多个 null 值。
Hashtable 类似于 HashMap,但是不允许 null 键和 null 值。它也比 HashMap 慢,因为它是同步的。
第六,Collection 和 Collections的区别。
Collections是个java.util下的类,它包含有各种有关集合操作的静态方法。
Collection是个java.util下的接口,它是各种集合结构的父接口。
第七,什么时候用assert。
断言是一个包含布尔表达式的语句,在执行这个语句时假定该表达式为 true。如果表达式计算为 false,那么系统会报告一个 Assertionerror。它用于调试目的:
assert(a > 0); // throws an Assertionerror if a <= 0
断言可以有两种形式:
assert Expression1 ;
assert Expression1 : Expression2 ;
Expression1 应该总是产生一个布尔值。
Expression2 可以是得出一个值的任意表达式。这个值用于生成显示更多调试信息的 String 消息。
断言在默认情况下是禁用的。要在编译时启用断言,需要使用 source 1.4 标记:
javac -source 1.4 Test.java
要在运行时启用断言,可使用 -enableassertions 或者 -ea 标记。
要在运行时选择禁用断言,可使用 -da 或者 -disableassertions 标记。
要系统类中启用断言,可使用 -esa 或者 -dsa 标记。还可以在包的基础上启用或者禁用断言。
可以在预计正常情况下不会到达的任何位置上放置断言。断言可以用于验证传递给私有方法的参数。不过,断言不应该用于验证传递给公有方法的参数,因为不管是否启用了断言,公有方法都必须检查其参数。不过,既可以在公有方法中,也可以在非公有方法中利用断言测试后置条件。另外,断言不应该以任何方式改变程序的状态。
第八,GC是什么? 为什么要有GC? (基础)。
GC是垃圾收集器。Java 程序员不用担心内存管理,因为垃圾收集器会自动进行管理。要请求垃圾收集,可以调用下面的方法之一:
System.gc()
Runtime.getRuntime().gc()
第九,String s = new String(“xyz”);创建了几个String Object?
两个对象,一个是“xyx”,一个是指向“xyx”的引用对象s。
第十,Math.round(11.5)等於多少? Math.round(-11.5)等於多少?
Math.round(11.5)返回(long)12,Math.round(-11.5)返回(long)-11;
第十一,short s1 = 1; s1 = s1 + 1;有什么错? short s1 = 1; s1 += 1;有什么错?
short s1 = 1; s1 = s1 + 1;有错,s1是short型,s1+1是int型,不能显式转化为short型。可修改为s1 =(short)(s1 + 1) 。short s1 = 1; s1 += 1正确。
第十二,sleep() 和 wait() 有什么区别? 搞线程的最爱
sleep()方法是使线程停止一段时间的方法。在sleep 时间间隔期满后,线程不一定立即恢复执行。这是因为在那个时刻,其它线程可能正在运行而且没有被调度为放弃执行,除非(a)“醒来”的线程具有更高的优先级 (b)正在运行的线程因为其它原因而阻塞。
wait()是线程交互时,如果线程对一个同步对象x 发出一个wait()调用,该线程会暂停执行,被调对象进入等待状态,直到被唤醒或等待时间到。
第十三,Java有没有goto?
Goto?java中的保留字,现在没有在java中使用。
第十四,数组有没有length()这个方法? String有没有length()这个方法?
数组没有length()这个方法,有length的属性。
String有有length()这个方法。
第十五,Overload和Override的区别。Overloaded的方法是否可以改变返回值的类型?
方法的重写Overriding和重载Overloading是Java多态性的不同表现。重写Overriding是父类与子类之间多态性的一种表现,重载Overloading是一个类中多态性的一种表现。如果在子类中定义某方法与其父类有相同的名称和参数,我们说该方法被重写 (Overriding)。子类的对象使用这个方法时,将调用子类中的定义,对它而言,父类中的定义如同被“屏蔽”了。如果在一个类中定义了多个同名的方法,它们或有不同的参数个数或有不同的参数类型,则称为方法的重载(Overloading)。Overloaded的方法是可以改变返回值的类型。
第十六,Set里的元素是不能重复的,那么用什么方法来区分重复与否呢? 是用==还是equals()? 它们有何区别?
Set里的元素是不能重复的,那么用iterator()方法来区分重复与否。equals()是判读两个Set是否相等。
equals()和==方法决定引用值是否指向同一对象equals()在类中被覆盖,为的是当两个分离的对象的内容和类型相配的话,返回真值。
第十七,给我一个你最常见到的runtime exception。
ArithmeticException, ArrayStoreException, BufferOverflowException, BufferUnderflowException, CannotRedoException, CannotUndoException, ClassCastException, CMMException, ConcurrentModificationException, DOMException, EmptyStackException, IllegalArgumentException, IllegalMonitorStateException, IllegalPathStateException, IllegalStateException,
ImagingOpException, IndexOutOfBoundsException, MissingResourceException, NegativeArraySizeException, NoSuchElementException, NullPointerException, ProfileDataException, ProviderException, RasterFORMatException, SecurityException, SystemException, UndeclaredThrowableException, UnmodifiableSetException, UnsupportedOperationException
第十八,error和exception有什么区别?
error 表示恢复不是不可能但很困难的情况下的一种严重问题。比如说内存溢出。不可能指望程序能处理这样的情况。
exception 表示一种设计或实现问题。也就是说,它表示如果程序运行正常,从不会发生的情况。
第十九,List, Set, Map是否继承自Collection接口?
List,Set是
Map不是
第二十,abstract class和interface有什么区别?
声明方法的存在而不去实现它的类被叫做抽象类(abstract class),它用于要创建一个体现某些基本行为的类,并为该类声明方法,但不能在该类中实现该类的情况。不能创建abstract 类的实例。然而可以创建一个变量,其类型是一个抽象类,并让它指向具体子类的一个实例。不能有抽象构造函数或抽象静态方法。Abstract 类的子类为它们父类中的所有抽象方法提供实现,否则它们也是抽象类为。取而代之,在子类中实现该方法。知道其行为的其它类可以在类中实现这些方法。
接口(interface)是抽象类的变体。在接口中,所有方法都是抽象的。多继承性可通过实现这样的接口而获得。接口中的所有方法都是抽象的,没有一个有程序体。接口只可以定义static final成员变量。接口的实现与子类相似,除了该实现类不能从接口定义中继承行为。当类实现特殊接口时,它定义(即将程序体给予)所有这种接口的方法。然后,它可以在实现了该接口的类的任何对象上调用接口的方法。由于有抽象类,它允许使用接口名作为引用变量的类型。通常的动态联编将生效。引用可以转换到接口类型或从接口类型转换,instanceof 运算符可以用来决定某对象的类是否实现了接口。
第二十一,abstract的method是否可同时是static,是否可同时是native,是否可同时是synchronized?
都不能
第二十二,接口是否可继承接口? 抽象类是否可实现(implements)接口? 抽象类是否可继承实体类(concrete class)?
接口可以继承接口。抽象类可以实现(implements)接口,抽象类是否可继承实体类,但前提是实体类必须有明确的构造函数。
第二十三,启动一个线程是用run()还是start()?
启动一个线程是调用start()方法,使线程所代表的虚拟处理机处于可运行状态,这意味着它可以由JVM调度并执行。这并不意味着线程就会立即运行。run()方法可以产生必须退出的标志来停止一个线程。
第二十四,构造器Constructor是否可被override?
构造器Constructor不能被继承,因此不能重写Overriding,但可以被重载Overloading。
第二十五,是否可以继承String类?
String类是final类故不可以继承。
第二十六,当一个线程进入一个对象的一个synchronized方法后,其它线程是否可进入此对象的其它方法?
不能,一个对象的一个synchronized方法只能由一个线程访问。
第二十七,try {}里有一个return语句,那么紧跟在这个try后的finally {}里的code会不会被执行,什么时候被执行,在return前还是后?
会执行,在return前执行。
第二十八,编程题: 用最有效率的方法算出2乘以8等於几?
有C背景的程序员特别喜欢问这种问题。
2 << 3
第二十九,两个对象值相同(x.equals(y) == true),但却可有不同的hash code,这句话对不对?
不对,有相同的hash code。
第三十,当一个对象被当作参数传递到一个方法后,此方法可改变这个对象的属性,并可返回变化后的结果,那么这里到底是值传递还是引用传递?
是值传递。Java 编程语言只由值传递参数。当一个对象实例作为一个参数被传递到方法中时,参数的值就是对该对象的引用。对象的内容可以在被调用的方法中改变,但对象的引用是永远不会改变的。
第三十一,swtich是否能作用在byte上,是否能作用在long上,是否能作用在String上?
switch(expr1)中,expr1是一个整数表达式。因此传递给 switch 和 case 语句的参数应该是 int、 short、 char 或者 byte。long,string 都不能作用于swtich。
第三十二,编程题: 写一个Singleton出来。
Singleton模式主要作用是保证在Java应用程序中,一个类Class只有一个实例存在。
一般Singleton模式通常有几种种形式:
第一种形式:定义一个类,它的构造函数为private的,它有一个static的private的该类变量,在类初始化时实例话,通过一个public的getInstance方法获取对它的引用,继而调用其中的方法。
public class Singleton {
private Singleton(){}
//在自己内部定义自己一个实例,是不是很奇怪?
//注意这是private 只供内部调用
private static Singleton instance = new Singleton();
//这里提供了一个供外部访问本class的静态方法,可以直接访问
public static Singleton getInstance() {
return instance;
}
}
第二种形式:
public class Singleton {
private static Singleton instance = null;
public static synchronized Singleton getInstance() {
//这个方法比上面有所改进,不用每次都进行生成对象,只是第一次
//使用时生成实例,提高了效率!
if (instance==null)
instance=new Singleton();
return instance; }
}
其他形式:
定义一个类,它的构造函数为private的,所有方法为static的。
一般认为第一种形式要更加安全些
Hashtable和HashMap
Hashtable继承自Dictionary类,而HashMap是Java1.2引进的Map interface的一个实现
HashMap允许将null作为一个entry的key或者value,而Hashtable不允许
还有就是,HashMap把Hashtable的contains方法去掉了,改成containsvalue和containsKey。因为contains方法容易让人引起误解。
最大的不同是,Hashtable的方法是Synchronize的,而HashMap不是,在
多个线程访问Hashtable时,不需要自己为它的方法实现同步,而HashMap
就必须为之提供外同步。
Section plus a..
.
This is the so-called Clinet-push, the client refresh technology. .
30 I want to let users log in to access the page.
Answer: Use declarative security. .
You only need web. define security roles in .xml (Role), and define a protected URL collection can only be accessed by a specific Role.
Most servers support user-based database mapping, you just set up two in the corresponding database tables and configure the server on it. .
Note the J2EE SDK does not support mapping based on the database user.
Details see references and server documentation. .
31 I want to be a registered user.
A: See 30. Servlet accepting registration requests to perform database operations you can write. .
32 how to access the database in JSP?.
A: The standard practice is to use the DAO pattern, defines a Java bean to access the database and used in the JSP. .
However, when your database schema is very simple, you can use the JSTL.
33 what JSTL?.
A: JSTL is the abbreviation Jsp Standard Tag Library. This is a generic label will be the JSP 2. .0 Part. .
Contains the assignment.
Tag library can http://jakarta. .apache. .org download. Note the JSTL need support JSP1. .2 or later to run under the container.
Help file can read the full sun of the JSTL specification. .
Table of contents 。.
6. .20 FAQ. .
Deployment 。.
How can I deploy a library?. .
Can I deploy a read-only EAR? 。.
What is delta deployment?. .
Do I need to connect Deploy Tool to SAP J2EE Engine to get an application 。.
deployed?. .
What is the difference between deploying an application using the Deploy Tool, 。.
the Visual Administrator and the server console?. .
How can I deploy an application with alt_dd。.xml? 。.
How and when to set security constraints for my applications, how to map them. .
to actual server users? 。.
Can I deploy two applications with the same name?. .
How to use Deploy Manager API, what functions are provided? 。.
Why does deployment of myapplication fail with ∪ Error in compiling: maybe. .
javacnot found∩? 。.
Why is javax. . Namingpackage not found when deploying an application?. .
Why does deployment of my application fail with IOException? 。.
Why does deployment of my application hang on HP-UX and no error message is. .
shown? 。.
Web Container and HTTP. .
How to disable directory browsing of a web application? 。.
How to deny PUT access to web server resources?. .
How to configure my web application to use HTTPS client authentication 。.
mechanism?. .
How to specify security constraints for a web application? 。.
Can I change JSPs, servlet classes and descriptors of a web application without. .
redeploying it? 。.
Can I deploy two web applications with the same name?. .
How can I deploy my application to be the default for the web server? 。.
How to enable application tracing for web applications?. .
What information is logged for the web container and where can I find it? 。.
Can I configure the web container to respond with custom reponse messages?. .
What formats of HTTP content and transfer codings does the web container 。.
support?. .
Resource Adapters 。.
How can I deploy a resource adapter?. .
Can I add additional properties to an already deployed resource adapter? 。.
How can I lookup a resource-adapter connection factory instance?. .
How can I lookup a connection factory instance from a helper class in 。.
additional library?. .
How can I configure the number of pooled connections? 。.
Why do I get a ClassNotFoundException when deploying a resource adapter?. .
EJB Container 。.
What do container type A and container type B mean?. .
What EJB properties can I administrate after deployment? 。.
How can I lookup a bean from an RMI client (stand-alone Java program)?. .
How is database information for CMP entity beans described? 。.
Is it possible for a bean to use helper classes from an additional library?. .
Can I start a new thread from a bean? 。.
How can I lookup a bean from a class in an additional library?. .
How can I lookup a bean from another application? 。.
Cluster Configuration. .
Are applications and libraries on server nodes synchronized? 。.
What is the default_library. . Txt file for?. .
How to add a second server/dispatcher node on the same physical machine? 。.
How to add a new server node located on a different physical machine to SAP. .
J2EE Engine cluster? 。.
How to connect two dispatcher nodes running on different physical machines in. .
the cluster? 。.
How to configure a SAP J2EE Engine node to start in background mode?. .
How to configure several nodes on one machine to run in background mode? 。.
How to access the server or dispatcher to perform administrative functions when. .
SAP J2EE Engine is running in background mode? 。.
When do configuration changes take effect?. .
How does Appclear Tool work? 。.
How to specify SAP J2EE Engine memory settings?. .
Why does dispatcher/server startup fail when attempting to start Log Manager? 。.
Why does server startup fail on DBMS service?. .
Why a SAP J2EE Engine server node cannot connect to a dispatcher node? 。.
Why does server startup fail with java. . Net. . BindException: Address in use:. .
JVM_Bind? 。.
Why does SAP J2EE Engine startup on HP-UX fail with the following error. .
message: java。.lang。.OutOfMemoryError: unable to create new native thread?。.
XML Parser. .
How can I use SAPXMLToolkit in a stand-alone program? 。.
How can I use SAPXMLToolkit in a deployed application?. .
How can I use Xerces parser in my application? 。.
How can I use an HTTP proxy while parsing an XML?. .
Web Services 。.
Can I register a bean as a port for a Web service in SAP J2EE Engine 6. .20?. .
Where can I find the WSDL for a bean? 。.
Do I have to deploy SOAPDispatcher in order to access Web Services framework?. .
What happens if I deploy the old soapdispatcher。.ear? 。.
How can I generate a proxy for the generated WSDL?. .
How can I use SAP’s SOAP implementation (inqmysoap。.jar) with IBM’s UDDI4J? 。.
How can I access a bean that had been deployed as a Web service?. .
Security 。.
How to assign JNDI permission to a specific user?. .
How to restrict telnet access for a specific user application? 。.
What additional libraries do I need to start Keystore and SSL services and. .
where should I put them? 。.
What is the order of starting of Keystore Service and SSL Service?. .
How to install a server certificate? 。.
How to generate a certificate-sending request?. .
How to self-sign a certificate? 。.
How to load a certificate?. .
How to store a certificate/key? 。.
Plug-ins Configuration and Remote Debugging. .
Where can I find information on how to configure JBuilder Plug-in? 。.
Where can I find information on how to configure SAP J2EE Engine for remote. .
debugging? 。.
Can I use JBuilder plug-in with SAP J2EE Engine cluster version?. .
Why is documentation Start Page no longer shown under http:\\localhost when the 。.
server is started through JBuilder?. .
Monitoring 。.
How to start the monitor server?. .
How can the monitored data be viewed or stored? 。.
How can I change the monitor server startup properties?. .
What additional libraries do I need to export data to CCMS? 。.
Why my monitor server cannot connect to SAP J2EE Engine cluster?. .
Integration 。.
How is the communication between an SAP R / 3 Dispatcher and SAP J2EE Engine. .
accomplished? 。.
Where to find information on how to enable redirect from ICM to SAP J2EE. .
Engine? 。.
Administration APIs. .
How to programatically obtain the client JAR that has been generated at 。.
deployment time?. .
How to perform programatic startup of a service? 。.
How to retrieve logs for a specific service, a manager, or whole cluster node?. .
How to retrieve a communication service port on a specified cluster node 。.
How to retrieve all existing users on SAP J2EE Engine?. .
How to obtain information about a specific user? 。.
How to connect to SAP J2EE Engine from a client with httptunneling layer?. .
P4 Service 。.
How can I generate stubs with remote support for rmi_p4?. .
Can I use standard RMIC to generate stubs 。.
Is UnicastRemoteObject supported by rmi_p4?. .
Are the remote classes dinamically downloaded or they must be specified in the 。.
classpath of the RMI client?. .
How to use RMIC Tool? 。.
JMS. .
Does SAP J2EE Engine JMS implementation support persistent messages? 。.
Does SAP J2EE Engine JMS implementation support JTA XA API?. .
Does SAP J2EE Engine JSM implementation supports user/password verification 。.
when creating connections?. .
How can I administrate jms destinations on SAP J2EE Engine? 。.
Class Loading. .
How does SAP J2EE Engine’s class loading system work? 。.
What kind of references between loaders can be set?. .
How to set a reference from an application to a library? 。.
How to set a reference from a library to another library?. .
How to set a reference from a service to another service or to a library? 。.
How to reference a library or a service from the default application?. .
How to reference a service or a library from a Resource Adapter? 。.
How to deregister a reference?. .
Where can I put property files needed by an application so they can be loaded? 。.
Why do I get a ClassNotFound exception when deploying or starting an. .
application? 。.
Why do I get a ZipException when deploying a library or starting an. .
application? 。.
Why do I get a java. . Lang. . UnsatisfiedLinkError after restarting an application. .
or a pool? 。.
Why do I get a ZipException when deploying a library or starting an. .
application? 。.
Why do I get a java. . Lang. . UnsatisfiedLinkError after restarting an application. .
or a pool? 。.
6. .30 FAQ. .
Problem: Engine stops after running only for an hour。.
Possible cause:. .
Check: 。.
Solution: Install a new license. .
6。.20 FAQ 。.
Deployment. .
How can I deploy a library? 。.
To deploy an additional library with helper classes that will be used by more. .
than one J2EE applications on SAP J2EE Engine, you can use Deploy Tool, the 。.
changelib shell command or DeployManager? API. . Using an additional library is. .
recommended only when several applications need access to its classes, 。.
otherwise it is better to bundle the JAR files with the helper classes in the. .
enterprise archive file。.
For more information about Deploy Tool and DeployManager? API, see Deployment. .
Manual。.
For more information about the Deploy Service shell commands, see. .
Administration Manual -> Shell Commands Reference。.
Can I deploy a read-only EAR?. .
Yes, you can do this using each of the deployment tools distributed with SAP 。.
J2EE Engine, namely Deploy Tool, Deploy Service Runtime tab in the Visual. .
Administrator or Deploy Service shell commands。. None of these tools changes the 。.
original EAR file. . Deploy Tool and Visual Administrator unpack it and generate. .
a new temporary EAR file to be deployed, whereas the deploy shell command takes 。.
the original one but makes no changes. .
What is delta deployment? 。.
Delta deployment (also referred as application update) is a feature of SAP J2EE. .
Engine Deploy Service that allows for updating those parts of a specific 。.
application that are new or have been modified. . This function is available in. .
Deploy Tool, Deploy Service Runtime tab in SAP J2EE Engine Visual Administrator 。.
and the Deploy Service update shell command. .
Do I need to connect Deploy Tool to SAP J2EE Engine to get an application 。.
deployed?. .
When Deploy Tool and SAP J2EE Engine run on the same physical machine it is 。.
possible to deploy your application without explicitly establishing a. .
connection, since default values for host, port, username and password are 。.
provided. . Establishing a connection is necessary to display server users and. .
map application security roles。. If Deploy Tool and SAP J2EE Engine run on 。.
different physical machines, or port configuration of p4 Service has changed,. .
logging in and establishing a connection between them is obligatory。.
What is the difference between deploying an application using the Deploy Tool,. .
the Visual Administrator and the server console? 。.
There is no difference in the outcome when deploying an application through. .
Deploy Tool, Visual Administrator or the server console。. However, when 。.
deploying with Deploy Tool and SAP J2EE Engine Visual Administrator the. .
enterprise archive file is unpacked, and some properties such as environment 。.
entries, resource references, context parameters, security roles, and mapping. .
can be changed。. When deploying through the server console the ear file is not 。.
unpacked, and no properties can be changed. .
How can I deploy an application with alt_dd。.xml? 。.
You can deploy an application with alt_dd. . Xml on SAP J2EE Engine using Deploy. .
Tool, Deploy Service Runtime tab in the Visual Admnistrator and Deploy Service 。.
deploy shell command. . However, it is not possible to create the alt_dd. . Xml file. .
with Deploy Tool。. You have to write it manually and include it as an additional 。.
file in the application archive. .
How and when to set security constraints for my applications, how to map them 。.
to actual server users?. .
You can set security constraints for an application at deployment time using 。.
Deploy Tool and SAP J2EE Engine Visual Administrator. . With both tools you can. .
create security roles and map them to actual server users for each application 。.
component, as well as for the entire application. . SAP J2EE Engine Visual. .
Administrator allows for changing security roles and user mappings for EJBs 。.
after deployment. . You can do this from EJB Service Runtime control tab. .
Can I deploy two applications with the same name? 。.
No. . Display names of applications on SAP J2EE Engine have to be unique. . If you. .
attempt to deploy an application with the same name as another one, the first 。.
application will be replaced. . The same is true for EJBs with identical names. .
If the context root of the web part of an application has the same name as an 。.
already existing context root, a DeploymentException? is thrown. .
How to use Deploy Manager API, what functions are provided? 。.
You can use Deploy Manager API for configuration, deployment and update of. .
applications, as well as for deploying libraries and setting references between 。.
loaders. . It can be used either programmatically or through the deploymanager. .
script file located in 。.
script takes as a parameter Deployer。.xml file that describes the application, 。.
necessary libraries and references from the application to other loaders (if..
any)。. For more information about Deploy Manager Interface methods and the DTD 。.
of Deployer. . Xml file, see Deployment Manual. .
Why does deployment of myapplication fail with ∪Error in compiling: maybe 。.
javacnot found ∩?. .
The reason is javac is not specifiedin PATH variable。. Include the directory 。.
path to javac inyour PATH variable. . This solution works properly fordeploying. .
all types of application components。.Alternatively, you can also change the 。.
correspondingproperties of Servlet_jsp Service or EJB Service topoint to the. .
javac location。. For example, if you set theExternalCompiler property of 。.
Servlet_jsp Service topoint to the javac location, it works for deploying. .
webapplications only。. This means that if you try to deployEJBs, you will still 。.
get that error. . To be able todeploy EJBs you have to set the. .
ExternalCompilerproperty? of the EJB Service to point to the javaclocation too。.
A possible reason for this exception mightbe also an error in compiling as. .
denoted by its errormessage。.
Why is javax. . Namingpackage not found when deploying an application?. .
The javac that is specified in thePATH is an older version。. For example, javac 。.
version1. .2. .2 Or lower is used instead of version 1. .3). . Includethe path to javac. .
with the proper version in your PATHvariable?。. This solution works properly for 。.
deploying alltypes of application components. . Alternatively, you canalso change. .
the corresponding properties of Servlet_jsp Service or EJB Service to point to 。.
the appropriate javac location. . For example, if you set the ExternalCompiler?. .
property of Servlet_jsp Service to point to the appropriate javac location, it 。.
works for deploying web applications only. . This means that if you try to deploy. .
EJBs, you will still get that error。. To be able to deploy EJBs you have to set 。.
the ExternalCompiler? property of the EJB Service to point to the appropriate. .
javac location too。.
Why does deployment of my application fail with IOException??. .
There are several possible reasons for this behavior: either your EAR file is 。.
corrupted or there is not enough free disk space on the machine where you are. .
trying to deploy the application。.
In case of a corrupted EAR file, double-check on its integrity. .
In the other case, you must free enough disk space on your machine for the EAR 。.
file to be deployed. .
Another possible reason is using a third party XML parser that cannot get the 。.
necessary document type definition (cannot pass through proxies). . It is. .
recommended not to use different parsers than inqmyxml for component generation 。.
and deployment on SAP J2EE Engine. .
Why does deployment of my application hang on HP-UX and no error message is 。.
shown?. .
There is a known problem in JDK version 1。.3。.1。.02 on HP-UX, which sometimes 。.
prevents the normal socket closing. . Add the-XdoCloseWithReadPending? Property. .
to the go script file of the server after the classpath and then restart it。.
Web Container and HTTP. .
How to disable directory browsing of a web application? 。.
You have two options to do this: using the Visual Administrator and editing the. .
properties file of the HTTP Service。.
When using the Visual Administrator, you have to go to HTTP Service on server. .
node, and select the ∪Properties∩ tab。. Then you must uncheck the ∪Directory 。.
List ∩ property in ∪ Infer Names ∩ pane. . Another option is to edit the DirList?. .
property of Http Service thorugh the shell command setprops in the server 。.
console. .
If you choose to edit the properties file that is located in 。.
set the DirList? property to ∪false∩。.
How to deny PUT access to web server resources?. .
You must edit the web。.xml descriptor of the web application that you want to 。.
protect from being accessed by PUT requests. . This is usually done at. .
application assembling phase。. If you have already deployed your application 。.
without restricting PUT access to it, you still have the opportunity to set. .
such restriction。. You must edit the web。.xml file for this application, which is 。.
located under the. .
directory。. However, you are not recommended to set the constraint that way! In 。.
addition, you cannot set security roles and user mapping at runtime. . Even if. .
you define such in the deployment descriptor, they will not take effect! 。.
Security roles and user mappings are defined at application assembling phase!. .
You can deny access to various web server resources for other HTTP methods as 。.
well. . It is done the same way as for PUT method. .
For more details on how to edit application∏s descriptor, see Administration 。.
Manual -> Configuration Tasks -> How to Set up SAP J2EE Engine 6. .20 Web Server. .
-> Setting Security Constraints section of the SAP J2EE Engine documentation。.
For detailed description of the web applicationΠs deployment descriptor DTD,. .
see Java Servlet 2。.3 Specification。.
How to configure my web application to use HTTPS client authentication. .
mechanism? 。.
You may complete this configuration task by editing the deployment descriptor. .
of your web application。. You must set CLIENT-CERT value to the 。.
auth-method (#PCDATA)>element of the descriptor. . For more information about. .
deployment descriptor DTD, see Java Servlet 2。.3 Specification。.
How to specify security constraints for a web application?. .
As defined in Java Servlet 2。.3 Specification, a security constraint is defined 。.
for a web resource collection and consists of authorization constraint and / or. .
user data constraint。.
You may set the security constraints for your web applications either by. .
manually editing the web application∏s deployment descriptor, or using the 。.
Deploy Tool. . This must be done at application assembling phase only! If you try. .
to do it after deployment, changes will not take effect。. At runtime, you can 。.
only define user mapping to existing security roles using the Security Service. .
Runtime tab in the Visual Administrator。.
If you decide to manually edit the deployment descriptor, you may refer to the. .
Java Servlet 2。.3 Specification for a detailed DTD description。. You can also 。.
find the definitions of web resource collection, authorization constraint and. .
user data constraint terms there。.
If you choose to use Deploy Tool, you may refer to Deploy Manual -> Deploy Tool. .
-> Generate J2EE Components section for information about how to do that。.
Can I change JSPs, servlet classes and descriptors of a web application without. .
redeploying it? 。.
Yes, you can change JSPs without redeploying the application and you even do. .
not need to restart it。. Servlet classes and descriptors can also be changed 。.
without redeploying the application, but they require that application be. .
restarted。. However, we do not recommend that you change JSPs, servlets classes 。.
or descriptors of running application that way. . It may cause errors in various. .
cases。. For example, when updating or redeploying an application, these changes 。.
are lost, or when adding a new cluster element, these changes may be lost after. .
synchronization。. You can use this approach of changing applications only for 。.
testing or debug purposes!. .
Can I deploy two web applications with the same name? 。.
No. . The web container will reject (not deploy) a web application if another web. .
application with the same name was already deployed。. For more information, see 。.
Java Servlet 2. .3 Specification, section 9. .5 ∪ Directory Structure ∩. .
How can I deploy my application to be the default for the web server? 。.
To do this, you must give the. .
descriptor of the EAR you want to deploy, the value of ∪ / ∩ or ∪ ∩ (an empty..
string)。. For example, if the following tags are present in the application∏s 。.
application. . Xml:. .
the application named ∪ Examples ∩ will be deployed as the default one for the. .
web server。.
For more information about the application XML DTD, see Java 2 Platform. .
Enterprise Edition Specification, version 1。.3。.
How to enable application tracing for web applications?. .
SAP J2EE Engine application tracing mechanism allows you to log information 。.
about user calls to different modules of the system. . You can find description. .
of the procedure of enabling application tracing in Administration Manual -> 。.
Configuration Tasks -> Setting up SAP J2EE Engine 6. .20 For Application Tracing. .
You can also find more information about what kind of events are logged for the 。.
web container when different trace levels are set there. .
What information is logged for the web container and where can I find it? 。.
First, the location of the log files for different web container components. .
depends on your settings of the corresponding properties of HTTP Service and 。.
Servlet_jsp Service. . The explanation below is made for the default web. .
container settings that consern logging。. If you have made certain changes of 。.
these settings, you have to consider them in order to find the appropriate. .
information。.
By default, logs about all requests and errors that appeared in HTTP Service. .
are saved in INFO。.log。. This file is located in 。.
entry in this file contains information about the IP address of the client 。.
machine, the first line of the request (the request method), the response. .
status returned and the number of bytes returned。. In case of a request to a 。.
servlet, the number of bytes returned takes the value of 0. . In case of a PUT. .
request, the number of bytes of the request body received is logged instead of 。.
the number of bytes returned. .
HTTP Service may log in Common Log Format。. In this case, the log messages are 。.
save in http. . Log that is located in. .
All errors that occurred, as well as all servlets that had been initialized by. .
Servlet_jsp Service are logged in INFO。.log by default。. This file is located at 。.
also contains log messages for other services。.
If application tracing is enabled, more information is logged. . It depends on. .
the trace level that you have set。. Log messages of traced components are saved 。.
in DEFAULT. . Log file that is located in. .
more information about the different trace levels and actions that can be. .
traced, see Administration Manual -> Configuration Tasks -> Setting up SAP J2EE 。.
Engine 6. .20 For Application Tracing. .
Can I configure the web container to respond with custom reponse messages? 。.
Yes, you can. . To do this, you must define the response codes and the. .
corresponding messages in the web application∏s deployment descriptor。. You 。.
have to edit the. .
element of the 。.
descriptor. . For more detailed description on how to do it, see Administration. .
Manual -> Services Administration Reference -> Servlet_jsp Service -> Critical 。.
Information. .
What formats of HTTP content and transfer codings does the web container 。.
support?. .
It supports gzip and chunked codings (defined in HTTP 1。.1 Specification, RFC 。.
2616). . You have to be aware that these codings are applied to responses only!. .
Resource Adapters 。.
How can I deploy a resource adapter?. .
To do this, you can use either Visual Administrator or Console Administrator 。.
tool. .
In Visual Administrator use the ∪Runtime∩ tab of EISConnector? Service, which 。.
is described in detail in Administration Manual> Services Administration. .
Reference > EISConnector? Service。.
You can deploy a resource adapter using register_connector command from the. .
EISCONNECTOR command group。. For information about this command, see 。.
Administration Manual> Shell Commands Reference> EISCONNECTOR. .
Can I add additional properties to an already deployed resource adapter? 。.
No. . The ∪ Config Properties ∩ sub-tab of EISConnector? ∪ Runtime ∩ tab in. .
Visual Administrator enables you only to edit the value of existing 。.
configurable properties or create a new ManagedConnectionFactory? instance. .
configured with the same properties。.
We recommend you to avoid creating new ManagedConnectionFactory? Instances. .
For information about the ∪Config Properties∩ sub-tab, see Administration 。.
Manual> Services Administration Reference> EISConnector? Service. .
How can I lookup a resource-adapter connection factory instance? 。.
The following code illustrates how to lookup a connection factory:. .
// Obtain initial context 。.
Context ctx = new InitialContext ?();。 .
/* Perform the JNDI lookup operation to obtain a connection factory instance。.*/ 。.
javax. . Resource. . Cci. . ConnectionFactory cf =. .
(javax。.resource。.cci。.ConnectionFactory) 。.
ctx. . Lookup (∪ java: comp / env /..
To lookup a connection factory instance, use the resource reference name, which. .
is specified in the 。.
relevant component (that is, either ejb-jar。.xml or web。.xml)。.
How can I lookup a connection factory instance from a helper class in. .
additional library? 。.
To do this, you must set a reference from this library to EISConnector? Service. .
in reference。.txt (reference 。.
lookup the connection factory instance by its name from the EISConnections?/ 。.
context in the Naming with the standard context properties for a stand-alone. .
client。.
For information about editing reference. . Txt, see Administration Manual>. .
Configuration Tasks > Configuration of Additional Libraries。. We recommend that 。.
you use the Shell commands or the Deploy Tool rather than edit reference. . Txt. .
and library。.txt manually。.
How can I configure the number of pooled connections?. .
You can do this using the properties of EISConnector? ServicePoolSize? and 。.
GranularSize?. . For information about these properties, see Administration. .
Manual > Services Administration Reference > EISConnector? Service。.
Why do I get a ClassNotFoundException? When deploying a resource adapter?. .
A possible cause for this exception is that the resource adapter uses an 。.
additional library, which cannot be found. .
Deploy the additional library and set a reference from the resource adapter to 。.
the library (reference..
EJB Container 。.
What do container type A and container type B mean?. .
EJB Container type A and EJB Container type B are used for bean managed entity 。.
beans. . An EJB Container of type A manages a single instance for each primary. .
key of the bean during all transactions that currently use this entity。. The 。.
parallel calls from different threads are serialized. . An EJB Container of type. .
B supports different instances for all transactions that currently use that 。.
entity. . For more information, see EJB 1. .1 Specification, section 9. .1. .10. .
What EJB properties can I administrate after deployment? 。.
The following properties can be modified from the runtime tab of the EJB. .
Service in SAP J2EE Engine Visual Administrator: 。.
Security Tab. .
- the access to methods。.
- The mapping of security roles to users and groups. .
- the links of the security roles references。.
- New security roles can be added. .
- existing security roles can be removed。.
Environment Tab. .
- the value of an existing environment entry。.
References Tab. .
EJB References。.
- The lookup name of the referenced Bean (in the ∪ Reference Link ∩ field). .
Resource References。.
- The reference link to the resource (in the ∪ Resource Link ∩ field). .
- the user name for the predefined resource references。.
- The password for the predefined resource references. .
Additional Tab。.
- The display name of the bean. .
- the bean description。.
Storage Tab. .
- the name of the database pool。.
- The names of the database tables. .
- the names of the columns in the database tables。.
- The SQL criteria of the finder methods. .
How can I lookup a bean from an RMI client (stand-alone Java program)? 。.
You must create the InitialContext? Using the standard properties:. .
Properties properties = new Properties(); 。.
properties. . Put (Context.. INITIAL_CONTEXT_FACTORY,..
“com。.inqmy。.services。.jndi。.InitialContextFactoryImpl”); 。.
properties. . Put (Context.. SECURITY_PRINCIPAL, "Administrator");. .
properties。.put(Context。.SECURITY_CREDENTIALS, “”); 。.
properties. . Put (Context.. PROVIDER_URL, "host: port");. .
InitialContext ctx = new InitialContext?(properties);。.
Security principal can be any user in the system that has lookup permission for. .
the root context。. In this way, a connection over rmi_p4 (SAP J2EE 。.
Engine-specific protocol) is established. . From this context the EJB will be. .
looked up by name, specified by the 。.
However, to lookup the EJB and to create its instance, the client∏s 。.
classloader needs the EJB client jar, located in. .
appName / cljarAppName. . Jar. . This client jar must be specified in the clientΠs. .
classpath, since SAP J2EE Engine does not support dynamic downloading of remote 。.
stub classes. .
Note: This must be used only in order to develop simple tests, not for working 。.
scenarios. . We recommend that you use application client, servlet, JSP or. .
another bean instead of a stand-alone Java program。.
How is database information for CMP entity beans described?. .
The database information for CMP entity beans is described in a SAP J2EE 。.
Engine-specific XML file calledstorage. . Xml. . It must be located in the META-INF. .
directory in ejb。.jar file, which is part of the application∏s archive file。.
SAP J2EE Engine Deploy Tool provides options for generating and modifying. .
storage。.xml。. Alternatively, you can write your own storage。.xml, but make sure 。.
you keep the right format for storage. . Xml exactly as described in the. .
documentation。.
The structure and the contents of storage. . Xml are described in Deployment. .
Manual in SAP J2EE Engine documentation。.
Is it possible for a bean to use helper classes from an additional library?. .
Yes, it is possible。. The additional library containing the helper classes must 。.
be deployed (registered) either by using SAP J2EE Engine Deploy Tool or the. .
changelib shell command on the server command line。. Then, a reference from the 。.
application to the specific library must be set either by using Deploy Tool or. .
by using the changeref shell command on the server command line。.
For more information about how to deploy libraries, see Deployment Manual. .
For more information about how to register references between loaders, see 。.
Administration Manual. .
Can I start a new thread from a bean? 。.
No, according to the Enterprise JavaBeans? 1. .1 Specification (Section 18. .1. .2..
Programming restrictions) thread management is performed by the EJB Container 。.
and Enterprise JavaBeans? must not attempt to manage threads, which includes. .
starting, stopping, suspending, or resuming a thread; or changing a thread∏s 。.
priority or name. . Enterprise JavaBeans? Must not attempt to manage thread. .
groups either。.
These requirements ensure that the Container properly manages the runtime. .
environment。.
How can I lookup a bean from a class in an additional library?. .
The additional library that contains the helper class must be deployed 。.
(Registered) and a reference from its loader to the application loader must be. .
set。. Then, if the additional library is on a server in the same cluster as the 。.
EJB application, the lookup is performed as with a stand-alone Java. .
programInitialContext is created using the standard properties and the EJB is 。.
looked up by its name. . The only difference between performing a lookup and. .
using EJBs from a stand-alone program, and a class in an additional library is 。.
that no EJB client JAR is needed for the helper class in a library. . However, if. .
the additional library is on a server node on a cluster different from the one 。.
in which the EJB application is deployed, the Initial_context_factory property. .
for creating initial context should have the following value: 。.
com. . Inqmy. . Services. . Jndi. . RemoteInitialContextFactoryImpl, or the additional SAP. .
J2EE Engine-specific property force_remote should be set to ∪true∩。. The 。.
client JAR of the EJB application must be available to the additional library. .
(that is, it must be included in its JAR file or registered as a separate 。.
library, to which a reference must be set). .
How can I lookup a bean from another application? 。.
If a bean from one application must be accessed by a JSP, servlet or another. .
bean from another application in the same cluster, it is enough to specify an 。.
EJB reference (..
bean and register a reference between the loaders of the applications. . Then the. .
lookup is performed in the usual way, as if the bean is in the same 。.
application:. .
javax。.naming。.Context context = new InitialContext?(); 。.
Object objRef = context. . Lookup ("java: comp / env / refName");. .
UseMessageBeanHome usemessagebeanhome = 。.
(UseMessageBeanHome?) PortableRemoteObject. . Narrow (objRef,..
UseMessageBeanHome?。.class);。.
If the two applications are deployed on different clusters, the one from which. .
the lookup will be performed should have access to the client JAR of the bean。.
Here, the lookup procedure is the same as the one described for lookup of a. .
bean from an additional library located on a second cluster。.
Cluster Configuration. .
Are applications and libraries on server nodes synchronized? 。.
Yes. . All applications and libraries that they use are synchronized on every. .
server node in SAP J2EE Engine cluster。.
What is the default_library. . Txt file for?. .
This file describes the libraries that SAP J2EE Engine needs to run properly。.
They are provided by default with its installation. . The default_library. . Txt. .
file is located in 。.
recommend you to avoid editting this file manually, since it is for internal 。.
server use only. .
How to add a second server/dispatcher node on the same physical machine? 。.
SAP J2EE Engine provides a tool for creating additional server and dispatcher. .
nodes。. Config Tool that is located in 。.
directory has a visual and a command line interface that allow for quick and 。.
easy startup of new SAP J2EE Engine cluster nodes. .
For more information about how to use Config Tool, see Administration Manual -> 。.
Administration Tools -> ConfigTool?. .
You can add new cluster nodes by manually changing the property files of 。.
services and managers as well. . This procedure is thoroughly described in. .
Administration Manual -> Administration of SAP J2EE Engine 6。.20 Cluster -> 。.
Adding Nodes to SAP J2EE Engine 6. .20 Cluster. .
How to add a new server node located on a different physical machine to SAP 。.
J2EE Engine cluster?. .
Adding a new node to an existing cluster on a different physical machine cannot 。.
be performed with SAP J2EE Engine Config Tool, since it is for local use only. .
For example, to configure a cluster installation with the following structure: 。.
- Machine A with dispatcherA and serverA running on it. .
- Machine B with server B running on it。.
you must complete the following steps:. .
1。. Install SAP J2EE Engine on machine A。.
2. . Install SAP J2EE Engine on machine B. .
3。. Run Config Tool on machine B and change the ClusterHosts? property of 。.
Cluster Manager on the server node so that it contains the. .
4。. Make sure the new server node has a different name and cluster ID from those 。.
used so far. .
5。. Set the LocalLoadBalancing? property of Service Manager on the dispatcher to 。.
false, so that requests are dispatched to each server in the cluster. . If this. .
property is set to true, requests from the dispatcher are sent only to the 。.
servers on the same physical machine. .
6。. Start the nodes。.
How to connect two dispatcher nodes running on different physical machines in. .
the cluster? 。.
To configure a cluster with the following structure:. .
- Machine Adispatcher A, serverA。.
- Machine Bdispatcher B, server B. .
you must complete the following steps:。.
1. . Install SAP J2EE Engine on machine A. .
2。. Install SAP J2EE Engine on machine B。.
3. . Run Config Tool on machine A and change the ClusterHosts? Property of. .
Cluster Manager on the dispatcher node so that it contains the 。.
4. . Run Config Tool on machine B and change the ClusterHosts? Property of. .
Cluster Manager on the dispatcher node so that it contains the 。.
5. . Make sure that all cluster nodes have different names and IDs?. .
6。. Set the LocalLoadBalancing? property of Service Manager on both dispatchers 。.
to false, so that requests from each dispatcher are dispatched to each server. .
in the cluster。. If this property is set to true, requests from each dispatcher 。.
are sent only to the servers on the same physical machine. .
7。. Start the nodes。.
How to configure a SAP J2EE Engine node to start in background mode?. .
You can use SAP J2EE Engine Config Tool for configuring a cluster node as a 。.
Windows service or UNIX daemon. . The procedure is thoroughly described in. .
Administration Manual -> Administration Tools -> ConfigTool? -> SAP J2EE Engine 。.
6. .20 As an NT/2000 Service or a Unix Daemon. .
How to configure several nodes on one machine to run in background mode? 。.
To run more that one server node in background mode on the same physical. .
machine, first you have to configure the nodes as service/daemon as described 。.
in Administration Manual -> Administration Tools -> ConfigTool? -> SAP J2EE. .
Engine 6。.20 as an NT/2000 Service or a Unix Daemon。. Then manually change 。.
Service_i_name parameter in service. . Ini file generated in. .
where ∪ i ∩ is the service number (each node must have a unique name) and start. .
it。.
How to access the server or dispatcher to perform administrative functions when. .
SAP J2EE Engine is running in background mode? 。.
When SAP J2EE Engine is running in background mode as NT / Windows 2000 service. .
or UNIX daemon, you can obtain access to the server or dispatcher using Telnet 。.
Service. . To use Telnet Service start a telnet session to the host of the. .
dispatcher with the same port as that of the port of Telnet Service (default 。.
value is 2323). . Use SAP J2EE Engine Visual Administrator to view the telnet. .
port configurationgo to Dispatcher > Services > telnet and check the port 。.
property. . This gives you access to the dispatcher node. . You can use the jump. .
command from the dispatcher telnet console to reach a server node telnet 。.
console. .
For more information about how to connect to SAP J2EE Engine using telnet and 。.
how to use the jump command, see Administration Manual -> Configuration Tasks. .
-> Remote Administration Using Telnet。.
When do configuration changes take effect?. .
Runtime configuration changes (for example, changing a property in a runtime 。.
control of a specific service from SAP J2EE Engine Visual Administrator) take. .
effect immediately。.
You can change servicesΠ and managersΠ properties with Visual Administrator,. .
using the shell commands and by manually editing the corresponding property 。.
file. . Changing a managerΠs property or a core serviceΠs property by one of. .
the above-described ways requires a restart of the whole system。. Changing a 。.
property of an additional service requires a restart of the specific service. .
only。. This restart is performed automatically when using Visual Administrator 。.
or shell commands. . However, if you change additional service property manually. .
from a property file, you have to take care about restart。.
How does Appclear Tool work?. .
Appclear Tool that is distributed with SAP J2EE Engine installation, performs a 。.
cleanup of the internal database management system, the work directories of all. .
containers, as well as their log files and removes all applications that are 。.
deployed on the specific server node, respectively. . It also removes all runtime. .
settings and tunings of the system that are not saved in property files。.
Appclear Tool must not be run when the specific server node is started. . Stop. .
it, run appclear tool and then start it again。.
How to specify SAP J2EE Engine memory settings?. .
You can specify system memory settings for SAP J2EE Engine at installation 。.
phase. . The installation tools provide a property Maximum java heap size that. .
can be set prior to installing the server。. If you need to change the memory 。.
settings after installation, you must modify go script and cmd_line. . Properties. .
files of the relevant cluster node。. Changes in cmd_line。.properties affect the 。.
memory used when starting SAP J2EE Engine in background mode, and go script. .
refers to starting it in foreground mode。. In go script you must modify the 。.
MEMORY parameter to the desired valuefor example, set MEMORY = 256M sets the. .
maximum heap size to 256 megabytes。. In cmd_line。.properties you must modify the 。.
Dmemory. . Manager and Xmx parameters. . For example, to set the memory to 256M. .
enter the following in cmd_line。.properties: 。.
-Dmemory. . Manager = 256M-Xmx256M?. . You can also change Cmd_line properties using. .
SAP J2EE Engine Config Tool。.
Why does dispatcher / server startup fail when attempting to start Log Manager?. .
The possible cause of this problem is not enough free disk space。. To solve it 。.
you just have to free some space on the disk of your machine. .
Why does server startup fail on DBMS service? 。.
The possible causes of this problem are:. .
- not enough free disk space;。.
- No write permission (for writing on the file system) for the user account,. .
with which SAP J2EE Engine is started;。.
- Appclear script has been started while a server node was still running. .
In the first of the above cases, you have to free enough disk space on your 。.
machine. . In case of no write permission for the user, you have to grant such. .
for that user。. In the third of the above cases, you have to stop SAP J2EE 。.
Engine, then run appclear script, and after that, you can start the system. .
again。.
Why a SAP J2EE Engine server node cannot connect to a dispatcher node?. .
A possible reason for this behavior might be the wrong port configuration of 。.
Cluster Manager on both dispatcher and server nodes. . Make sure the value of one. .
of the entries for ClusterHosts? property of the Cluster Manager of the server 。.
node corresponds to the JoinPort? property of the Cluster Manager on the. .
dispatcher node。.
If starting SAP J2EE Engine in an SAP R / 3 system environment, the insufficient. .
Security Service timeout could cause startup failure。. Every time SAP J2EE 。.
Engine starts in SAP Web AS environment, its Security Service tries to load the. .
SAP R/3 users。. It connects to the SAP Web AS as SAPJSF user via JCo。. In some 。.
cases (for example, when the user does not exist or R3Security?.. properties file..
is incorrect) JCo returns too late, which causes SAP J2EE Engine∏s Service 。.
Manager to raise "Timeout starting core services" and to stop the system. . The. .
solution is to set greater values to CoreLoadTimeout? and 。.
AdditionalLoadTimeout? Properties of Service Manager. .
Why does server startup fail with java。.net。.BindException: Address in use: 。.
JVM_Bind?. .
Some ports used by SAP J2EE Engine could be busy。. Generally, startup of 。.
communication services such as P4 Service, HTTP Service, Monitor Service or. .
Telnet Service, as well as Cluster Manager, could fail if their ports are busy。.
Use netstat a in a command prompt to see all ports that are busy, and free. .
those needed by SAP J2EE Engine, or change the port properties of communication 。.
services. .
Why does SAP J2EE Engine startup on HP-UX fail with the following error 。.
message: java. . Lang. . OutOfMemoryError: unable to create new native thread?. .
The reason for this behavior is wrong configuration of operating system kernel。.
To solve it, set the following kernel params: max_thread_proc 256 (or more) and. .
nkthread 7200 (or more)。.
XML Parser. .
How can I use SAPXMLToolkit in a stand-alone program? 。.
To use the SAPXML Toolkit in a stand-alone program, you can set the following. .
system properties: 。.
javax. . Xml. . Parsers. . DocumentBuilderFactory =. .
com。.inqmy。.lib。.jaxp。.DocumentBuilderFactoryImpl。.
javax. . Xml. . Parsers. . SAXParserFactory = com. . Inqmy. . Lib. . Jaxp. . SAXParserFactoryImpl. .
javax。.xml。.transform。.TransformerFactory= 。.
com. . Inqmy. . Lib. . Jaxp. . TransformerFactoryImpl,. .
or make sure the SAPXMLToolkit。.jar is set in your CLASSPATH。. This file must be 。.
set before any other XML parser's JAR file. .
How can I use SAPXMLToolkit in a deployed application? 。.
To use SAPXMLToolkit, you must register a reference to it from your. .
application。. This can be done at deployment time using either Deploy tool or 。.
the Deploy Service CHANGEREF command. . Another possibility is to manually edit. .
reference。.txt file located in 。.
If you choose to manually edit reference。.txt file, which is not recommended in 。.
any way, add to it the following line:. .
reference 。.
How can I use Xerces parser in my application? 。.
There are three possible ways to use Xerces parser in your application:. .
1。. Register Xerces as an additional library on SAP J2EE Engine。. You can do this 。.
using the Deploy Service CHANGELIB command or manually copy the archive file in. .
nodes and. .
server nodes. . Then add the following line in library. . Txt file located in. .
dispatcher nodes and in. .
directory for server nodes:. .
library xerces xerces。.jar。.
Then register a reference from your application to the Xerces library, using. .
the CHANGEREF shell command of Deploy Service, or manually in reference。.txt 。.
file located in the same directory as the above mentioned library. . Txt. .
2。. If you are using the Xerces parser in classes that are included in a WAR 。.
file, add xerces. . Jar in the Web-Inf/lib directory in the WAR. .
3。. Add xerces。.jar to your applications EAR。.
How can I use an HTTP proxy while parsing an XML?. .
You must set the http。.proxyHost and http。.proxyPort system properties。.
Web Services. .
Can I register a bean as a port for a Web service in SAP J2EE Engine 6。.20? 。.
You cannot register a bean as a port for a Web service. . This feature is. .
supported by SAP J2EE Engine 6。.30。. However, with 6。.20 version you can call a 。.
method of the bean through SOAP. .
Where can I find the WSDL for a bean? 。.
You can find the beanΠs WSDL at the following URL:. .
http://localhost/soapdispatcher?WSDL=。.
name of your bean。.
Do I have to deploy SOAPDispatcher? In order to access Web Services framework?. .
No。. SOAPDispatcher? is a default application。. To access Web Services framework, 。.
enter http://localhost/soapdispatcher in the address bar of your browser. .
What happens if I deploy the old soapdispatcher。.ear? 。.
It replaces the default SOAPDispatcher?. . This affects the application. .
performance since the EAR contains older classes。.
How can I generate a proxy for the generated WSDL?. .
Use the WSDL ProxyGenerator? in order to generate the proxy。. For more 。.
information, see 6. .1. . SAP J2EE Engine SOAP Proxy Generator section in the Web. .
Services document。.
How can I use SAP's SOAP implementation (inqmysoap.. Jar) with IBM's UDDI4J?. .
You have to set the following system property: 。.
org. . Uddi4j. . TransportClassName = com. . Inqmy. . Lib. . Soap. . Uddi4j. . InQMySOAPTransport. .
For more information, see the 7。. UDDI4J Pluggability section in the Web 。.
Services document. .
How can I access a bean that had been deployed as a Web service? 。.
To use the deployed bean, generate a proxy using the ProxyGenerator? And call. .
the proxy methods (the WSDL of the service is also required)。. For more 。.
information, see 3. . Setting up Web Services Framework and 6. .1 SAP J2EE Engine. .
SOAP Proxy Generator sections in the Web Services document。.
Security. .
How to assign JNDI permission to a specific user? 。.
Assigning JNDI permissions to a specific user can be performed through Naming. .
service runtime panel in Visual Administrator。. Choose the JNDI context and the 。.
user or group for which permissions are granted. . Then with the "<<" button you. .
can grant permissions for a specific context, and with the “<<<” you can grant 。.
permissions for a specific context and all its subcontexts. . The same applies. .
for denying specific permissions to users or groups。. With the “>>” button you 。.
deny permission for the specific context and with the ">>>" button for the. .
specific context and all its subcontexts。.
How to restrict telnet access for a specific user application?. .
You can restrict telnet access for a specific user using the Security service 。.
runtime panel (Resources tab) in Visual Administrator. . From the Resources tree. .
choose System >telnet and grant or deny access to the users from Users on 。.
Server tree. .
What additional libraries do I need to start Keystore and SSL services and 。.
where should I put them?. .
To start Keystore and SSL services on SAP J2EE Engine, you need the IAIK 。.
package, namely iaik_jce. . Jar, iaik_jsse. . Jar and iaik_ssl. . Jar, w3c_http. . Jar. . The. .
archives can be downloaded from the IAIK official site。. You must put the jar 。.
files in additional-lib folder of each cluster node:. .
- 。./cluster/dispatcherName/additional-lib/。.
-. . / Cluster / serverName / additional-lib /. .
- 。./alone/additional-lib/。.
To enable Keystore and SSL Service administration using SAP J2EE Engine Visual. .
Administrator, you must also put the above libraries in 。./admin/lib/ directory。.
What is the order of starting of Keystore Service and SSL Service?. .
To start both services, you first need to install the IAIK package; then start 。.
Keystore on all cluster nodes, first on server, then on dispatcher ones. . After. .
that start SSL service on all nodes。.
How to install a server certificate?. .
To install and enable a server-side certificate, you have to either load the 。.
certificate or generate one using the Keystore Service panel in Visual. .
Administrator。. Then go to SSL Service runtime panel and select the SSL socket 。.
for which you want to enable the certificate. . From the Certificates subtab. .
click the “Add” button and choose your certificate from the list of available 。.
ones. . Note that when adding a new certificate the old one that was enabled is. .
replaced。.
How to generate a certificate-sending request?. .
You can generate a certificate-sending request (CSR) for a key in SAP J2EE 。.
Engine keystore using the "Generate CSR" function in Keystore runtime panel of. .
SAP J2EE Engine Visual Administrator。.
How to self-sign a certificate?. .
You must specify that a certificate is self-signed when creating it。. Use the 。.
"Certificate Generation" tab of Keystore Service runtime panel in SAP J2EE. .
Engine Visual Administrator。. Specify the required properties of the 。.
certificate. . To generate a self-signed certificate, do not specify any alias in. .
the “CA Key Alias” drop-down menu。. SAP J2EE Engine does not support self-sign 。.
on already existing certificates. . For more information about how to generate. .
certificates, see Administration Manual -> Services Administration Reference -> 。.
Keystore Service -> Certificate Generation section. .
How to load a certificate? 。.
You can load an existing certificate either using Keystore Service runtime. .
panel in Visual Administrator or using the LOAD shell command from the KEYSTORE 。.
command group. . For more information about the Keystore Service shell commands,. .
see Administration Manual -> Shell Commands Reference。.For more information 。.
about the Keystore Service runtime functions, see Administration Manual ->. .
Services Administration Reference -> Keystore Service section。.
How to store a certificate / key?. .
You can store a certificate either using Keystore service runtime panel in 。.
Visual Administrator or using the STORE shell command from the KEYSTORE command. .
group。. Alternatively you can use the “Write” function in Keystore service 。.
runtime panel in Visual Administrator or the WRITE shell command from KEYSTORE. .
command group to store certificates and keys in ASCII format。. If using Visual 。.
Administrator, the default store is. . / Admin. . For more information about the. .
Keystore Service shell commands, see Administration Manual -> Shell Commands 。.
Reference. . For more information about the Keystore Service runtime functions,. .
see Administration Manual -> Services Administration Reference -> Keystore 。.
Service section. .
Plug-ins Configuration and Remote Debugging 。.
Where can I find information on how to configure JBuilder Plug-in?. .
How to configure and use the JBuilder plug-in is described in Configuring 。.
JBuilder Plug-in for Application Deployment and Debugging section in. .
Development Manual。.
Where can I find information on how to configure SAP J2EE Engine for remote. .
debugging? 。.
How to configure SAP J2EE Engine for remote debugging is described in. .
Configuration Tasks > Setting up SAP J2EE Engine for Remote Debugging section 。.
of Administration Manual. .
Can I use JBuilder plug-in with SAP J2EE Engine cluster version? 。.
No. . JBuilder plug-in is compatible with SAP J2EE Engine 6. .20 Stand-alone. .
version。. It cannot be used with the cluster version。.
Why is documentation Start Page no longer shown under http: \ \ localhost when the. .
server is started through JBuilder? 。.
When starting SAP J2EE Engine through JBuilder the HTTP port on which it. .
listens for requests is changed, as well as the default root of the HTTP 。.
server. . Thus, in the standard configuration the HTTP port is 8080, and the. .
default root is the JBuilder project directory。. To access the documentation 。.
Start Page, you have to register it as an HTTP alias. . Go to HTTP Service. .
runtime panel in Visual Administrator, enter Alias name, the name under which 。.
you would like the Start Page to be accessible, and the full path to the docs. .
directory in the “Path” field。. Then choose “Add。.” Now, you can access the 。.
documentation Start Page under http://localhost:8080/yourAliasName. .
Monitoring 。.
How to start the monitor server?. .
Execute the monitor script file on the command line。. The monitor script file is 。.
located in the. .
configuration file named properties exists and is located in the. .
the default configuration startup properties. . It takes its startup properties. .
from that configuration file even though the file is not specified when 。.
starting the Monitor Server. .
How can the monitored data be viewed or stored? 。.
There are several ways to view and / or export the monitored data:. .
- by using the SAP J2EE Engine Visual Administrator – only the current 。.
monitored data can be viewed but cannot be monitored in progress. .
- by exporting to a file system – the monitored data is stored in files。.
- By exporting to SAP's CCMS - provides options for viewing and storing the. .
monitored data。.
- By using the browser-based monitoring - displays the monitored data in. .
progress。.
For more information about how to configure each of the monitoring systems. .
above, see the Monitoring section in the Administration Manual。.
How can I change the monitor server startup properties?. .
Create a configuration file and specify it as an argument when executing the 。.
Monitor Server script file - for example: monitor configuration_file, where. .
configuration_file is the name of the configuration file。.
The Monitor Server is then started using the settings from the configuration. .
file。.
The configuration file priority is higher than the default settings. . The. .
Monitor Server uses a default property setting only if this property is not set 。.
in the configuration file. .
The configuration file must be in text format and must be located in the same 。.
directory as the Monitor Server script file (monitor.. bat) - that is, in the. .
For more information about how to create the configuration file and description. .
of its contents, see the Administration Manual in SAP J2EE Engine documentation。.
What additional libraries do I need to export data to CCMS?. .
You need Jmon API (jmon。.dll)。. It is not included in the SAP J2EE Engine 。.
distribution package and can be obtained from the SAP J2EE Engine provider. .
It is critical to specify the path to jmon。.dll in the monitor script file – for 。.
example,-Djava. . Library. . Path = "% PATH%";. .
Why my monitor server cannot connect to SAP J2EE Engine cluster? 。.
The reason is that the server, to which the connection should be established,. .
is either down or the connection settings you specified are wrong。. You must 。.
start the server and reconnect the monitor server to it by executing the. .
connect shell command on the monitor server command line。. Make sure the 。.
provider url (hostname: p4_service_port), username and password you specify at. .
connection time are correct。.
Integration. .
How is the communication between an SAP R/3 Dispatcher and SAP J2EE Engine 。.
accomplished?. .
The communication between SAP R/3 Dispatcher and SAP J2EE Engine is performed 。.
through R3Startup? Manager and R3Startup? Service on the J2EE side. . The. .
R3Startup? Service, which runs on SAP J2EE Engine dispatcher node, communicates 。.
through TCP / IP with SAP R / 3 Dispatcher and holds information about all running. .
server nodes。.
Where to find information on how to enable redirect from ICM to SAP J2EE. .
Engine? 。.
You can find information on SAP J2EE Engine integration in the Integration. .
document。. See also the following topics in SAP Web Application Server 6。.20:。.
- SAP Library-> mySAP Technogy Components-> SAP Web Application Server-> SAP J2EE. .
Engine->Integrating the SAP J2EE Application Server->Administration of the SAP 。.
Web Application Server. .
- SAP Library->mySAP Technogy Components->SAP Web Application 。.
Server-> Client / Server Technology-> Architecture of the SAP Web Application. .
Server->Parameterizing the ICM and the ICM Server Cache->Sample Profile for the 。.
ICM. .
Administration APIs? 。.
How to programatically obtain the client JAR that has been generated at. .
deployment time? 。.
You can do this by using File Service interfaces that are described in detail. .
in the “Services Guide” section of Development Manual。. In order to obtain the 。.
File Service runtime interface (FileTransfer?), You have to lookup the service. .
and then call one of its createRemoteFile() methods。. RemoteFile? class on the 。.
other hand provides methods for upload and download of files that are located. .
on different logical servers。. Its download() method can be used to retrieve the 。.
client JAR located in. .
How to perform programatic startup of a service?. .
You can do this by using Admin Service interfaces that are described in detail 。.
in the "Services Guide" section of Development Manual. . Lookup of Admin Service. .
returns RemoteAdminInterface?。. Using its getAdminServiceManager() method, you 。.
can obtain AdminServiceManager? interface. . AdminServiceManager? Interface. .
provides methods for starting and stopping of a specific service by specifying 。.
the service name and clusterId (the ID of the cluster node the service runs..
on)。. You can also use it to retrieve and change service descriptors and 。.
properties. .
How to retrieve logs for a specific service, a manager, or whole cluster node? 。.
You can do this by using Admin Service interfaces that are described in detail. .
in the “Services Guide” section of Development Manual。. Lookup of Admin Service 。.
returns RemoteAdminInterface?. . You can use its getAdminServiceManager () method. .
to obtain AdminServiceManager? interface。. AdminServiceManager? provides a 。.
getLogViewer () method that returns AdminLogViewer? interface. . From. .
AdminLogViewer? after initialisation with cluster id(s) logs for a specific 。.
service, manager or entire cluster node can be retrieved. . AdminLogViewer?. .
methods description can be found in the Admin Service part of the “Services 。.
Guide "section of Development Manual.. You may also see the Log Service APIs?..
description in the same section of Development Manual。.
How to retrieve a communication service port on a specified cluster node. .
You can do this by using Admin Service interfaces that are described in detail 。.
in the "Services Guide" section of Development Manual. . Lookup of Admin Service. .
returns RemoteAdminInterface?。. You can use its getAdminServiceManager() method 。.
to obtain AdminServiceManager? interface. . AdminServiceManager? Provides a. .
getServiceProperties(int clusterId, String serviceName) method that returns a 。.
Properties object, from which you can obtain the specific communication service. .
port with getProperty(“portPropertyName”) method。.
How to retrieve all existing users on SAP J2EE Engine?. .
You can do this by using Security Service interfaces that are described in 。.
detail in the "Services Guide" section of Development Manual. . Lookup of. .
Security Service returns RemoteSecurity? interface。. It provides a 。.
getRemoteUserManager () method that returns an interface for managing the User. .
Management module。. RemoteUserManager? has a users(boolean user) method that 。.
returns a String array with all users in the system if the boolean parameter is. .
set to true。. If the boolean parameter is set to false, a String array with all 。.
user groups in the system is returned. .
How to obtain information about a specific user? 。.
You can do this by using Security Service interfaces that are described in. .
detail in the “Services Guide” section of Development Manual。. Lookup of 。.
Security Service returns RemoteSecurity? Interface. . It provides a. .
getRemoteUserManager() method that returns an interface for managing the User 。.
Management module. . RemoteUserManager? Has a getUserInfo (String name, boolean..
user) method that returns a RemoteUserInfo? object encapsulating all properties 。.
of the specific user. . RemoteUserInfo? Provides also methods for obtaining the. .
children and parents of the specified user or group, as well as for 。.
administrative privileges checking. .
How to connect to SAP J2EE Engine from a client with httptunneling layer? 。.
You can look at the example of performing httptunneling connection to SAP J2EE. .
Engine that exists in the 。.
directory。.
In general, to establish a connection over httptunneling when creating. .
InitialContext? some additional properties should be put, denoting 。.
httptunneling port, host and transport layer queue. .
P4 Service 。.
How can I generate stubs with remote support for rmi_p4?. .
You can do this using the RMIC Tool provided with SAP J2EE Engine 6。.20。. For 。.
detailed information about the functions of this tool, see Administration. .
Manual > Administration Tools > RMIC Tool。.
Can I use standard RMIC to generate stubs. .
No。. Since P4 is a specific protocol for SAP J2EE Engine, standard tools do not 。.
support it. . Use the RMIC tool provided with SAP J2EE Engine to generate stubs. .
Is UnicastRemoteObject? supported by rmi_p4? 。.
No. . RMI_P4 supports PortableRemoteObject? To enable remote communication. .
Are the remote classes dinamically downloaded or they must be specified in the 。.
classpath of the RMI client?. .
In SAP J2EE Engine 6。.20 the remote classes are not downloaded dynamically。. You 。.
have to add the file that contains the stubs and the skeletons to the client's. .
classpath。. This will be changed in SAP J2EE Engine 6。.30。.
How to use RMIC Tool?. .
You can find information on how to use the RMIC Tool in Administration Manual > 。.
Administration Tools> RMIC Tool. .
JMS 。.
Does SAP J2EE Engine JMS implementation support persistent messages?. .
Yes。. The JMS Service allows using global transactions using the 。.
XATopicConnectionFactory? Or XAQueueConnectionFactory?. . Es, JMS Service on SAP. .
J2EE Engine supports persistent messages。.
Does SAP J2EE Engine JMS implementation support JTA XA API?. .
Yes。. The JMS Service allows using global transactions using the 。.
XATopicConnectionFactory? Or XAQueueConnectionFactory?. .
Does SAP J2EE Engine JSM implementation supports user/password verification 。.
when creating connections?. .
No, SAP J2EE Engine does not support user/password verification。. Event if such 。.
credentials are supplied, they are not taken into consideration. .
How can I administrate jms destinations on SAP J2EE Engine? 。.
Use the Console Administrator tool. . In it, type "add jms" to activate the JMS. .
Service group of commands。. Use the commands provided to create and bind Topics 。.
and Queues and to administrate the JMS Destinations. . You can also use Visual. .
Administrator to manage destinations。. Open the JMS Service tab and choose 。.
Topic, Queue or Subscription. . Using the "Add" and "Remove" buttons, you can. .
easily create or remove destinations。. For more information about managing 。.
destinations using Visual Administrator, see Administration Manual -> Services. .
Administration Reference -> JMS Service -> Visual Administrator。.
Class Loading. .
How does SAP J2EE Engine’s class loading system work? 。.
The class loading system is centralized in the ClassLoaderManager?. . It. .
implements interfaces used for registering and deregistering of loaders and 。.
references between them, as well as for accessing loaders referenced by another. .
loader。. SAP J2EE Engine classloading system consists of several different types 。.
of loaders - FileClassLoader?, ReferencedLoader?, Frame Loader,. .
CoreClassLoader?, ServiceClassLoader?, ApplicationLoader?。.
FileClassLoader is a super class for all other classloaders in SAP J2EE Engine. .
class loading system and implements the main loading functionality。.
FrameClassLoader? Is used to load the classes from Service Framework. . It has. .
just one instance and no references to other loaders。. Frame Loader is the 。.
parent of CoreClassLoader?, ServiceClassLoader? and ApplicationLoader?. .
CoreClassLoader? also has just one instance; it is used for loading managers’ 。.
classes. . As their names imply, ServiceClassLoader? Is used for loading. .
services’ classes and ApplicationLoader? is used for loading applications’ 。.
classes. . Both ServiceClassLoader? And ApplicationLoader? Are direct derivatives. .
of ReferencedLoader? and use the referencing functionality offered by it。. This 。.
way they gain access to classes loaded with a different ReferencedLoader?. .
Classes in libraries that are shared between applications are also loaded with 。.
ReferencedLoader?. .
Referenced loaders are registered and kept in ClassLoaderManager?。. Each loader 。.
is distinguished from the others by its name that obeys the following. .
convention: the loader of each service is named service:serviceName, the loader 。.
of each application or resource adapter is named by its display name and the. .
loader of each library is named library:libraryName。. Each ReferencedLoader? is 。.
wrapped in a ReferencedLoaderWrapper? that contains information about the. .
references of the specific loader and the ReferencedLoader? itself。.
Registration and deregistration of a ReferencedLoader?, As well as of. .
references from a ReferencedLoader? to another ReferencedLoader?, is done by 。.
name. . If a ReferencedLoader? Has loaded a class, the referred loader must not. .
try to load or resolve it。. Thus the following mechanism is used: first locally 。.
cached classes are checked, then the parent loader, the registered references. .
to other referenced loaders, and finally the ReferencedLoader? itself tries to 。.
load the class. .
What kind of references between loaders can be set? 。.
The following types of references between loaders can be set:-A?. .
- Reference between two service loaders。.
- Reference from an application to a service. .
- Reference from an application to a library 。.
- Reference from a library to an application. .
- Reference from a library to another library。.
- Reference from a library to a service. .
- Reference from a service to a library。.
Different types of references are specified in library. . Txt, reference. . Txt and. .
provider。.xml files。. library。.txt file, located in 。.
definitions of all additional libraries (for more info on library deployment 。.
see Deployment Manual) as well as the references (if any) between this. .
particular library and other libraries。. All application references are set in 。.
reference. . Txt, and all service references are set in provider. . Xml. . You can see. .
the “Configuration of Additional Libraries” section of Administration Manual 。.
for more information about how to set the different types of references. .
Generally it is not recommended to manually edit library。.txt, reference。.txt and 。.
especially provider. . Xml files of SAP J2EE Engine services, since tools and. .
shell commands are provided for setting and changing references and deploying 。.
libraries. .
How to set a reference from an application to a library? 。.
The library that is referenced must be deployed or registered on SAP J2EE. .
Engine server。. You can do this simultaneously with the application deployment, 。.
when you use Deploy Tool (for more information about this topic, see Deployment..
Manual)。. Another option is to copy the library archive in 。.
this library in library。.txt located in 。.
yourLibraryName yourArchiveName。.jar)。. Then a reference from the application to 。.
the library must be registered. . You can do this at deployment time when you. .
deploy the library, using the changeref shell command or manually by adding the 。.
reference in reference. . Txt located in. .
reference yourAppDisplayName library: yourLib). . The reference can be set. .
programmatically using the methods provided by Deploy Service runtime 。.
interface, described in details in Development Manual. .
How to set a reference from a library to another library? 。.
First, both libraries must be deployed either using Deploy Tool or registered. .
manually (for more information about this topic, see Administration Manual)。.
Then, by using Deploy Tool, the changeref shell command or manually editing. .
library。.txt (this is adding the entry: reference firstLibName secondLibName), 。.
you can set the reference between them. . The reference between the libraries can. .
also be set programmatically with the methods provided by Deploy Service 。.
runtime interface, described in Development Manual. . Note, that if you have a. .
large number of additional library archives, which are interdependent, it is 。.
recommended to register them as one library on SAP J2EE Engine server in order. .
to avoid complex classloader interdependencies and possible problems。.
How to set a reference from a service to another service or to a library?. .
References from a particular service to other services and libraries are listed 。.
in service's provider. . Xml file that is located in. .
edit this file manually。. Instead, you can use Deploy Tool or changeref shell 。.
command. . Another option (that is also not recommended) is manually editing. .
reference。.txt file located in 。.
from a service to a service, you can add the following line to reference。.txt:。.
reference service: serviceOneName service: serviceTwoName. .
If referencing a library, add the following line to reference。.txt:。.
reference service: serviceName library: libName. .
The reference can also be set programmatically with the methods provided by 。.
Deploy Service runtime interface, described in details in Development Manual. .
How to reference a library or a service from the default application? 。.
The display name that must be used when registering references from the default. .
application on SAP J2EE Engine server is Default。. You can use Deploy Tool, the 。.
changeref shell command or manually edit the reference. . Txt file (as described..
in “How to set a reference from an application to a library” question above) to 。.
register a reference from it to a library, service or another application on. .
SAP J2EE Engine。.
How to reference a service or a library from a Resource Adapter?. .
To reference a service, add the following line to reference。.txt:。.
reference. .
reference 。.
META-INF/ra. . Xml in the resource archive (RAR) file. .
You can also use Deploy Tool or changeref shell command to set these 。.
references. . Using the methods provided by Deploy Service runtime interface you. .
can set the references programmatically。. The Deploy Service runtime interface 。.
is described in detail in Development Manual. .
How to deregister a reference? 。.
You can use changeref shell command to remove a reference between two loaders. .
Here is an example of its usage:。.
changeref-r application: yourApplicationName library: yourLibName. .
This removes the reference between the application with name 。.
yourApplicationName and the library with name yourLibName. . The same can be. .
accomplished by deleting the corresponding line in reference。.txt file located 。.
in. .
can be removed programmatically with the methods provided by Deploy Service. .
runtime interface that is described in details in Development Manual。.
Where can I put property files needed by an application so they can be loaded?. .
Property files can be put in any JAR file that is part of the application, 。.
including the JAR files, located in WEB-INF \ lib directory of its web part. . For. .
a web application the property files can also be put in the WAR file in 。.
WEB-INF \ classes directory. .
If the application uses an additional library and a reference to it is set, 。.
property files can also be included in the JAR file of the library. . However, if. .
the property file is not bundled in a JAR file, but is just included in the 。.
root of the application EAR file, it will not be loaded, and will not be found. .
by the application classes。.
Why do I get a ClassNotFound? Exception when deploying or starting an. .
application? 。.
Probably a reference from an application to a library, or from a library to a. .
library is missing。. You can check if all required references are set using the 。.
ll shell command that lists all loaders on SAP J2EE Engine and the references. .
between them。. You can also look at reference。.txt file located in 。.
Why do I get a ZipException? when deploying a library or starting an 。.
application?. .
A possible cause for this problem might be a missing library JAR file, either 。.
because a wrong file name was specified, or because the library has been. .
registered but the JAR file with the classes does not exist at the specified 。.
location. . Another cause of the exception might be the usage of a wrong file. .
separator if library。.txt has been edited manually (which is not recommended in 。.
any way). . Double check if all required files exist and are correct. .
Why do I get a java。.lang。.UnsatisfiedLinkError after restarting an application 。.
or a pool?. .
Uhis exception might occur because the application or the pool is using an 。.
additional library or a JDBC driver that has native parts in it and that are. .
loaded just once for the Java Virtual Machine (JVM)。. A possible solution is to 。.
restart the container in which the application is running, or DBpool? Service. .
Why do I get a ZipException? when deploying a library or starting an 。.
application?. .
A possible cause for this problem might be a missing library JAR file, either 。.
because a wrong file name was specified, or because the library has been. .
registered but the JAR file with the classes does not exist at the specified 。.
location. . Another cause of the exception might be the usage of a wrong file. .
separator if library。.txt has been edited manually (which is not recommended in 。.
any way). . Double check if all required files exist and are correct. .
Why do I get a java。.lang。.UnsatisfiedLinkError after restarting an application 。.
or a pool?. .
Uhis exception might occur because the application or the pool is using an 。.
additional library or a JDBC driver that has native parts in it and that are. .
loaded just once for the Java Virtual Machine (JVM)。. A possible solution is to 。.
restart the container in which the application is running, or DBpool? Service. .
6。.30 FAQ 。.
Problem: Engine stops after running only for an hour. .
Possible cause: 。.
License invalid. .
Check: 。.
look for messages in. .
/usr/sap/C11/JC00/j2ee/cluster/server0/log/console_logs/error。.log saying that 。.
the server will go down because the license is invalid. .
Solution: Install a new license。.
See http://intranet. . Sap. .com / likey then follow the link "mySap J2EE Engine" and. .
there “installing a license Key in…。.”。. — HolgerOehm – 25 Jul 2003 。.
Topic J2EESupportFAQ. . (Edit | View | Attach | Ref-By | Printable | Diffs |. .
r1。.3 | > | r1。.2 | > | r1。.1 | More Actions } One Click Registration 。.
Revision r1. .3 - 17 Jun 2004 - 10:18 GMT - PavelZlatarev. .
Copyright ?2000-2004 by the contributing authors。. All material on this 。.
collaboration tool is the property of the contributing authors. .
Ideas, requests, problems regarding BIS? Send feedback。.
First, talk about the final, finally, finalize the difference. .
final?修饰符(关键字)如果一个类被声明为final,意味着它不能再派生出新的子类,不能作为父类被继承。因此一个类不能既被声明为 abstract的,又被声明为final的。将变量或方法声明为final,可以保证它们在使用中不被改变。被声明为final的变量必须在声明时给定初值,而在以后的引用中只能读取,不可修改。被声明为final的方法也同样只能使用,不能重载。.
finally? another finally block to provide exception handling to perform any cleanup operation. If an exception is thrown, then the matching catch clause is executed, then control will enter the finally block (if any). .
finalize?方法名。Java 技术允许使用 finalize() 方法在垃圾收集器将对象从内存中清除出去之前做必要的清理工作。这个方法是由垃圾收集器在确定这个对象没有被引用时对这个对象调用的。它是在 Object 类中定义的,因此所有的类都继承了它。子类覆盖 finalize() 方法以整理系统资源或者执行其他清理工作。finalize() 方法是在垃圾收集器删除对象之前对这个对象调用的. .
第二,Anonymous Inner Class (匿名内部类) 是否可以extends(继承)其它类,是否可以implements(实现)interface(接口)? 。.
Anonymous inner class is not within the class name. Can not extends (inheritance) other classes, but an inner class can be used as an interface, by another internal class implementation. .
第三,Static Nested Class 和 Inner Class的不同,说得越多越好(面试题有的很笼统)。.
Nested Class (usually C + +, say), Inner Class (usually JAVA statement). Java inner class and C + + nested classes The biggest difference lies in whether there is a reference point on the outside. Specifically see http://www. . Frontfree. .net / articles / services / view. . Asp? Id = 704 & page = 1. .
注: 静态内部类(Inner Class)意味着1创建一个static内部类的对象,不需要一个外部类对象,2不能从一个static内部类的一个对象访问一个外部类对象 。.
Fourth, the difference between & and & &. .
&是位运算符。&&是布尔逻辑运算符。.
op1 & op2, op1 and op2 when all is true, the return value was true, but always check the value of op1 and op2. .
op1 && op2, 当 op1 和 op2 都为真时,返回值才为真,但当op1的值为false时,op2的值就不再被查了。.
Fifth, HashMap and Hashtable difference. .
都属于Map接口的类,实现了将惟一键映射到特定的值上。.
HashMap class is not classified, or sorted. It allows one null key and multiple null values. .
Hashtable 类似于 HashMap,但是不允许 null 键和 null 值。它也比 HashMap 慢,因为它是同步的。.
Sixth, Collection and Collections of the difference. .
Collections是个java。.util下的类,它包含有各种有关集合操作的静态方法。.
Collection is java. . Util under the interface, it is the parent structure of the various collection interfaces. .
第七,什么时候用assert。.
Assertion is a Boolean expression of the statements contained in the implementation of this statement assumes that the expressions is true. If the expression evaluates to false, then the system will report a Assertionerror. It is used for debugging purposes:. .
assert(a > 0); // throws an Assertionerror if a <= 0 。.
Assertion can have two forms:. .
assert Expression1 ; 。.
assert Expression1: Expression2;. .
Expression1 应该总是产生一个布尔值。.
Expression2 can arrive at a value of arbitrary expressions. This value is used to generate more debugging information shows the String message. .
断言在默认情况下是禁用的。要在编译时启用断言,需要使用 source 1。.4 标记: 。.
javac-source 1. .4 Test. . Java. .
要在运行时启用断言,可使用 -enableassertions 或者 -ea 标记。.
To choose to disable assertions at runtime, use the-da or-disableassertions tag. .
要系统类中启用断言,可使用 -esa 或者 -dsa 标记。还可以在包的基础上启用或者禁用断言。.
Can be expected under normal circumstances would not reach the place of any position asserted. Assertions can be used to validate the parameters passed to the private methods. However, the assertion should not be used to validate the parameters passed to public methods, because regardless of whether the assertion is enabled, the public methods must check its parameters. However, both in the public method can also be used in non-public method postcondition assertion test. In addition, the assertion should not be in any way change the status of the program. .
第八,GC是什么? 为什么要有GC? (基础)。.
GC is a garbage collector. Java programmers need not worry about memory management, because the garbage collector will automatically be managed. To request a garbage collection, you can call the following methods:. .
System。.gc() 。.
Runtime. . GetRuntime (). . Gc (). .
第九,String s = new String(“xyz”);创建了几个String Object? 。.
Two objects, one is "xyx", 1 refers to "xyx" a reference to the object s. .
第十,Math。.round(11。.5)等於多少? Math。.round(-11。.5)等於多少? 。.
Math. . Round (11. .5) Return (long) 12, Math. . Round (-11. .5) Return (long) -11;. .
第十一,short s1 = 1; s1 = s1 + 1;有什么错? short s1 = 1; s1 += 1;有什么错? 。.
short s1 = 1; s1 = s1 + 1; wrong, s1 is the short type, s1 +1 is int type, can not be explicitly converted to type short. Can be modified to s1 = (short) (s1 + 1). short s1 = 1; s1 + = 1 correctly. .
第十二,sleep() 和 wait() 有什么区别? 搞线程的最爱 。.
sleep () method is to thread the way to stop some time. In the sleep interval expires, the thread does not immediately reinstated. This is because at that time, other threads may be running and not to give up schedule, unless (a) "wake up" the thread has higher priority (b) running thread for other reasons obstruction. .
wait()是线程交互时,如果线程对一个同步对象x 发出一个wait()调用,该线程会暂停执行,被调对象进入等待状态,直到被唤醒或等待时间到。.
XIII, Java has no goto?. .
Goto?java中的保留字,现在没有在java中使用。.
14th, the array has no length () this method? String has no length () this method? . .
数组没有length()这个方法,有length的属性。.
String has a length () this method. .
第十五,Overload和Override的区别。Overloaded的方法是否可以改变返回值的类型? 。.
Method override Overriding and overloading Overloading is the Java performance of the different polymorphisms. Override Overriding is between parent and child class a manifestation of polymorphism, overloading Overloading is a polymorphism in a class performance. If the child class defines a method and its parent class has the same name and the parameters, we say that the method has been rewritten (Overriding). Subclass object using this method is called sub-class definition, it is concerned, the definition of the parent class as being "shielded" the.如果在一个类中定义了多个同名的方法,它们或有不同的参数个数或有不同的参数类型,则称为方法的重载(Overloading)。Overloaded的方法是可以改变返回值的类型。.
16th, Set in the element is not repeated, then repeated with the means to distinguish whether or not it? Is == or equals ()? Them What's the difference?. .
Set里的元素是不能重复的,那么用iterator()方法来区分重复与否。equals()是判读两个Set是否相等。.
equals () and == means to determine whether it points to the same object reference value equals () in class was covered, as are two separate objects when the content and type of match, then return true. .
第十七,给我一个你最常见到的runtime exception。.
ArithmeticException, ArrayStoreException, BufferOverflowException, BufferUnderflowException, CannotRedoException, CannotUndoException, ClassCastException, CMMException, ConcurrentModificationException, DOMException, EmptyStackException, IllegalArgumentException, IllegalMonitorStateException, IllegalPathStateException, IllegalStateException,。.
ImagingOpException, IndexOutOfBoundsException, MissingResourceException, NegativeArraySizeException, NoSuchElementException, NullPointerException, ProfileDataException, ProviderException, RasterFORMatException, SecurityException, SystemException, UndeclaredThrowableException, UnmodifiableSetException, UnsupportedOperationException。.
18th, error and exception What's the difference?. .
error 表示恢复不是不可能但很困难的情况下的一种严重问题。比如说内存溢出。不可能指望程序能处理这样的情况。.
exception that a design or implementation issues. That is, it said if the program is running normally, never happened. .
第十九,List, Set, Map是否继承自Collection接口? 。.
List, Set is. .
Map不是 。.
Article, abstract class and interface What is the difference?. .
声明方法的存在而不去实现它的类被叫做抽象类(abstract class),它用于要创建一个体现某些基本行为的类,并为该类声明方法,但不能在该类中实现该类的情况。不能创建abstract 类的实例。然而可以创建一个变量,其类型是一个抽象类,并让它指向具体子类的一个实例。不能有抽象构造函数或抽象静态方法。Abstract 类的子类为它们父类中的所有抽象方法提供实现,否则它们也是抽象类为。Instead, the child class to implement the method. Know the behavior of other classes can implement these methods in the class. .
接口(interface)是抽象类的变体。在接口中,所有方法都是抽象的。多继承性可通过实现这样的接口而获得。接口中的所有方法都是抽象的,没有一个有程序体。接口只可以定义static final成员变量。接口的实现与子类相似,除了该实现类不能从接口定义中继承行为。当类实现特殊接口时,它定义(即将程序体给予)所有这种接口的方法。然后,它可以在实现了该接口的类的任何对象上调用接口的方法。Because of the abstract class, which allows the use of interface name as a reference variable type. And dynamic binding usually will come into force. Reference can be converted to the interface type, or conversion from interface type, instanceof operator can be used to determine whether a particular object of the class to achieve the interface. .
第二十一,abstract的method是否可同时是static,是否可同时是native,是否可同时是synchronized? 。.
Can not. .
第二十二,接口是否可继承接口? 抽象类是否可实现(implements)接口? 抽象类是否可继承实体类(concrete class)? 。.
Interfaces can be inherited interfaces. Abstract class can implement (implements) interface, an abstract class is inheritable entity class, but only if the entity class must have explicit constructor. .
第二十三,启动一个线程是用run()还是start()? 。.
Start a thread that calls start () method, so that the thread is represented by a virtual processor can run the state, which means that it can schedule and execute by the JVM. This does not mean that thread will run immediately. run () method can produce a sign to quit to stop a thread. .
第二十四,构造器Constructor是否可被override? 。.
Constructor constructor can not be inherited and can not rewrite Overriding, but can be overridden Overloading. .
第二十五,是否可以继承String类? 。.
String class is the final class can not inherit it. .
第二十六,当一个线程进入一个对象的一个synchronized方法后,其它线程是否可进入此对象的其它方法? 。.
No, an object of a synchronized method can only be visited by a thread. .
第二十七,try {}里有一个return语句,那么紧跟在这个try后的finally {}里的code会不会被执行,什么时候被执行,在return前还是后? 。.
Will be executed before the execution in return. .
第二十八,编程题: 用最有效率的方法算出2乘以8等於几? 。.
A C programmer background especially like to ask this question. .
2 << 3 。.
29th, the two objects the same value (x.. Equals (y) == true), but may have a different hash code, this sentence right?. .
不对,有相同的hash code。.
The 30th, when an object is passed as a parameter to a method, this method can change the object's attributes, and can return to change the result, then here in the end is passed by value or reference passed?. .
是值传递。Java 编程语言只由值传递参数。当一个对象实例作为一个参数被传递到方法中时,参数的值就是对该对象的引用。对象的内容可以在被调用的方法中改变,但对象的引用是永远不会改变的。.
31st, swtich on whether the role of the byte, it can function in the long on, whether on the role of the String?. .
switch(expr1)中,expr1是一个整数表达式。因此传递给 switch 和 case 语句的参数应该是 int、 short、 char 或者 byte。long,string 都不能作用于swtich。.
32nd, programming problem: to write out a Singleton. .
Singleton模式主要作用是保证在Java应用程序中,一个类Class只有一个实例存在。.
General Singleton pattern usually has a few forms:. .
第一种形式:定义一个类,它的构造函数为private的,它有一个static的private的该类变量,在类初始化时实例话,通过一个public的getInstance方法获取对它的引用,继而调用其中的方法。.
public class Singleton (. .
private Singleton(){} 。.
/ / Define themselves in their own internal instance, is not it strange? . .
//注意这是private 只供内部调用 。.
private static Singleton instance = new Singleton ();. .
//这里提供了一个供外部访问本class的静态方法,可以直接访问 。.
public static Singleton getInstance () (. .
return instance; 。.
). .
} 。.
The second form:. .
public class Singleton { 。.
private static Singleton instance = null;. .
public static synchronized Singleton getInstance() { 。.
/ / This method is an improvement compared with the above, do not be generated each time an object, only the first time. .
//使用时生成实例,提高了效率! 。.
if (instance == null). .
instance=new Singleton(); 。.
return instance;). .
} 。.
Other forms:. .
定义一个类,它的构造函数为private的,所有方法为static的。.
The first form is generally believed to be more safe. .
Hashtable和HashMap 。.
Dictionary class inherited from Hashtable, the HashMap is Java1. .2 Introduced an implementation of Map interface. .
HashMap允许将null作为一个entry的key或者value,而Hashtable不允许 。.
There is, HashMap Hashtable's contains method to remove, and change containsvalue and containsKey. Contains method is easy because people misunderstood. .
最大的不同是,Hashtable的方法是Synchronize的,而HashMap不是,在 。.
When multiple threads access Hashtable, do not need to synchronize to its methods, and HashMap. .
就必须为之提供外同步。.