BEA WebLogic Server FAQ
BEA WebLogic Server FAQ
Server ™
Release 7.0
Document Revised: September 5, 2002
Copyright
Copyright © 2002 BEA Systems, Inc. All Rights Reserved.
Note: Some of the information in this document may be inconsistent with what you
observe in the WebLogic Server 7.0 Beta release.
! Chapter 4, “FAQs: Code Examples,” contains questions and answers about code
examples.
! Chapter 10, “FAQs: WebLogic JDBC,” contains questions and answers about
JDBC.
! Chapter 11, “FAQs: WebLogic jDriver for MSSQL Server,” contains questions
and answers about WebLogic jDriver for MSSQL Server.
! Chapter 12, “FAQs: WebLogic jDriver for Oracle,” contains questions and
answers about WebLogic jDriver for Oracle.
! Chapter 14, “FAQs: JTA,” contains questions and answers about JTA.
! Chapter 17, “FAQs: Server-Side Java (Servlets),” contains questions and answers
about servlets.
! Chapter 18, “FAQs: Security,” contains questions and answers about security.
! Chapter 22, “FAQs: XML,” contains questions and answers about XML.
Audience
This document is written for application developers who want to build e-commerce
applications using the Java 2 Platform, Enterprise Edition (J2EE) from Sun
Microsystems. It is assumed that readers know Web technologies, object-oriented
programming techniques, and the Java programming language.
Adobe Acrobat Reader is available at no charge from the Adobe Web site at
http://www.adobe.com.
Related Information
The BEA corporate Web site provides all documentation for WebLogic Server.
Contact Us!
Your feedback on BEA documentation is important to us. Send us e-mail at
docsupport@bea.com if you have questions or comments. Your comments will be
reviewed directly by the BEA professionals who create and update the documentation.
In your e-mail message, please indicate the software name and version you are using,
as well as the title and document date of your documentation. If you have any questions
about this version of BEA WebLogic Server, or if you have problems installing and
running BEA WebLogic Server, contact BEA Customer Support through BEA
WebSupport at http://www.bea.com. You can also contact Customer Support by using
the contact information provided on the Customer Support Card, which is included in
the product package.
Documentation Conventions
The following documentation conventions are used throughout this document.
Convention Usage
monospace Code samples, commands and their options, Java classes, data types,
text directories, and file names and their extensions. Monospace text also
indicates text that you enter from the keyboard.
Examples:
import java.util.Enumeration;
chmod u+w *
config/examples/applications
.java
config.xml
float
. Indicates the omission of items from a code example or from a syntax line.
.
.
1 FAQs: Administration
and Configuration
! How do I bypass the prompt for username and password when I start a server?
Q. How do I bypass the prompt for username and password when I start a server?
A. You can create and use a boot identify file, which contains your username and
password in an encrypted format.
If a server's root directory contains a valid boot identity file named
boot.properties, it uses this file by default. If you want to specify a different file
(or if you do not want to store boot identity files in a server's root directory), you can
specify a file name in the server’s startup command. If a server is unable to access its
boot identity file, it displays the standard username and password prompt in its
command shell and writes a message to the log file.
For more information, refer to Bypassing the Interactive Prompt in the WebLogic
Server Administration Guide.
where WL_HOME is the directory in which you installed WebLogic Server. For more
information, refer to Setting the Classpath in the WebLogic Server Administration
Guide.
! You manually edit the config.xml file for a domain when a domain is not
active. If you edit the configuration file while the domain is active, any changes
you make manually will likely be overwritten by the system. Furthermore, all
changes you make by hand while the domain is active are ignored by the system
at run time.
For more information on modifying the config.xml file and a reference of Mbeans
and attributes used config.xml, see the BEA WebLogic Server Configuration
Reference at http://e-docs.bea.com/wls/docs70/config_xml/index.html.
! You can access the attributes of a domain with the WebLogic Server
command-line utility. This utility is provided for people who want to create
scripts to automate domain management. See Commands for Managing a
WebLogic Domain in the Administration Guide at
http://e-docs.bea.com/wls/docs70/adminguide/cli.html.
! If you intend to edit the config.xml file directly, (not recommended) see the
BEA WebLogic Server Configuration Reference at
http://e-docs.bea.com/wls/docs70/config_xml/index.html.
2 FAQs: Applets
! Why does my applet work with Appletviewer, but not with a browser?
client libraries. If you look at the exception that is generated, you will see that your
applet fails in java.lang.System.loadLibrary, because the security manager
determined that you were attempting to load a local library and halted the applet.
You can, however, use the WebLogic JTS or Pool driver for JDBC connectivity in
applets. When you use one of these WebLogic multitier JDBC drivers, you need one
copy of WebLogic jDriver for Oracle (or any other two-tier JDBC driver) for the
connection between the WebLogic Server and the DBMS.
Q. Why does my applet work with Appletviewer, but not with a browser?
Problem: I tried to run two of the applets in the examples directory of the distribution.
I installed the WebLogic classes on my local machine (NT server) and on another
machine (a Windows 95 client). I am not using any browsers, just trying to run the
applets with Appletviewer. The applets work fine when I run Appletviewer from the
NT server, but do not work at all from the Windows 95 client.
A. There are two possible problems: Either the CODEBASE tag is not properly set in
the applet HTML file, or the class files are not properly loaded on the HTTP server.
The applet works on the NT server because you installed the WebLogic distribution on
your NT server. Even if the applet cannot successfully load the necessary classes from
the HTTP server, it does find them in your local CLASSPATH. But when you try to run
it from the Windows 95 client, the applet must load the classes over the wire from the
HTTP server, and if you haven’t installed them correctly, it will fail.
Then I set my attributes in the Administration Console to listen on port 7001, and I
started the WebLogic Server on the HTTP machine so I could use my applet with
WebLogic JDBC, like this:
<APPLET
CODEBASE=t3://myserver.com:7001/webz/ns-home/classes
CODE=applets.myapp.class>
When I changed the CODEBASE tag to point to the WebLogic Server, I started getting
ClassFormatErrors.
A. There are several problems with your setup. The most obvious have to do with your
CODEBASE:
1. The CODEBASE tag in your applet should point to your HTTP server, not to
WebLogic Server.
2. The directory path referenced in your CODEBASE tag is not an absolute directory
path on the HTTP server; it is a configured path that originates from the HTTP
Document Root. You are using the absolute path in your CODEBASE tag. If your
class “myapp” is in the “applets” package, then the correct CODEBASE for your
setup would be:
<APPLET
CODEBASE=http://myserver.com/classes
CODE=applets.myapp.class>
Remember, too, that if you installed the WebLogic distribution on the machine from
which you are running the applet, your applet will first look for the WebLogic classes
in your local CLASSPATH, which may obscure the fact that you haven’t properly
installed the classes for serving from the HTTP server. To test your HTTP
configuration properly, you need to temporarily rename the WebLogic classes in your
local CLASSPATH or try your applet from another machine.
3 FAQs: Clustering
! What happens when a failure occurs and the stub cannot connect to a WebLogic
Server instance?
Q. What happens when a failure occurs and the stub cannot connect to a WebLogic
Server instance?
A. When the failure occurs, the stub removes the failed server instance from its list.
If there are no servers left in its list, the stubb uses DNS again to find a running server
and obtain a current list of running instances. Also, the stub periodically refreshes its
list of available server instances in the cluster; this allows the stub to take advantage of
new servers as they are added to the cluster.
Second, WebLogic Server monitors socket errors to determine when server instances
become unavailable. For example, if server instance A has an open socket to server
instance B, and the socket unexpectedly closes, server A assumes that server B is
offline.
! Are the build.cmd and the build.sh scripts still being used?
2. Run the setEnv script to make sure your CLASSPATH is correctly set in the shell
or DOS window in which you are running the examples. For more information,
see Setting your development environment at
http://www.weblogic.com/docs51/techstart/environment.html.
3. Check the instructions for the examples to make sure you have changed any
user-specific variables in the code before compiling.
4. Verify that you are compiling with the -d option to direct the class files into the
proper directory, as defined in the example instructions.
If the example is an applet, check the CODE and CODEBASE, and make sure
WebLogic Server is running.
For more information, see the WebLogic Server Examples Guide located at
samples/examples/examples.html in your WebLogic server distribution.
Q. Are the build.cmd and the build.sh scripts still being used?
A. No. They have been replaced by ANT.
5 FAQs: Deployment
! Can I set the deployment order for application components? For types of
components?
Q. Can I set the deployment order for application components? For types of
components?
A. You can change the deployment order of components within a class (making this
EJB load before that EJB) using ComponentMBean DeploymentOrder attribute, but
not the deployment order of different classes (making startup classes load before
EJBs).
It looks like startup classes load after the J2EE deployment units, which load in this
order: JDBC, JMS, Connectors, EJBs, Web Applications.
If your application is an EAR and you are using the Acadia two-phase deployment
protocol, you can set the application deployment order using the ApplicationMBean
LoadOrder attribute.
To disable this feature on the command line, include the following argument:
-Dweblogic.ProductionModeEnabled=true
6 FAQs: EJB
General
! Which versions of the EJB specification are supported by the WebLogic Server?
! How big should I make the cache for a stateful session bean?
! Can a foreign key column in the database be mapped to both a cmp-field and a
cmr-field?
! Why can't I call the setXXX method for a cmr-field during ejbCreate?
! How can I avoid violating NOT NULL constraints on foreign keys that are
mapped to cmr-fields?
! Does WebLogic support auto generating primary keys for entity beans?
The reason the create() and find() methods are not polymorphic is similar to the
reason constructors are not polymorphic in Java. The derived classes generally do not
know or cannot initialize the base class properly.
! To avoid cross server calls which results in more efficiency. If EJBs are not
deployed on all servers, cross server calls are much more likely.
! Every server must have access to each EJB's classes so that it can be bound into
the local JNDI tree. If only a subset of the servers deploys the bean, the other
servers will have to load the bean's classes in their respective system classpaths
which makes it impossible to undeploy the beans.
Q. Which versions of the EJB specification are supported by the WebLogic Server?
A. The following table summarizeds EJB specification support, by WebLogic Server
version:
4.5.x 1.0
5.1 1.1
! You do not have allow-concurrent-calls set to true and you attempt to invoke a
stateful session bean that is already busy processing another request. In this case,
the second method call will not block and a LockTimedOutException will be
thrown immediately.
Q. When should I use a Stateful session bean and when should I use a servlet session?
A. The answer to this question is very application-specific and there are situations in
which either approach will work. A stateful session bean provides declaritive
transaction and security checking as well as failover to a secondary in a cluster.
Q. How big should I make the cache for a stateful session bean?
A. The cache for a stateful session bean should usually be equal to the maximum
number of concurrent clients of the bean. This is generally a much larger value than
the number of execute threads in the server, therefore, stateful session beans will use
more server resources.
Q. Can a foreign key column in the database be mapped to both a cmp-field and a
cmr-field?
A. Yes, this has been supported since WLS 6.0 SP1. Note that when the cmp-field is
a primary-key field the cmr-field is read-only. In other words, the setXXX method for
the cmr-field cannot be used. The value of the primary-key should be initialized as
usual in this case. Conversely, when the cmp-field is not a primary-key field, then the
cmp-field is read-only. The underlying column is updated via the cmr-field, and the
cmp-field just provides a read-only view of the foreign-key.
Q. Why can't I call the setXXX method for a cmr-field during ejbCreate?
A. This is disallowed by the EJB 2.0 specification because the primary-key of the
current bean isn't necessarily known during ejbCreate and it may be needed depending
on how the relationship is mapped to the underlying DBMS. Cmr-field setters should
be called during ejbPostCreate instead of ejbCreate if relationships need to be setup
during creation of a bean.
Q. How can I avoid violating NOT NULL constraints on foreign keys that are mapped
to cmr-fields?
A. In WLS 7.0, you can set delay-database-insert-until to 'commit' and assign the
cmr-field a value before the current transaction commits. You can also set
delay-database-insert-until to 'ejbPostCreate' and assign the cmr-field a value during
ejbPostCreate.
Q. Does WebLogic support auto generating primary keys for entity beans?
A. Yes, this feature was added in WLS 6.1. For more information, see the DTD
comments for the <automatic-key-generation> element. Point your browser to:
http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd.
The rollback may have happened in an earlier EJB invoke that was part of the
transaction, or the rollback may have occurred because the transaction timed out. In
either case, the transaction will be rolled back, the connection returned to the pool and
the database resources released. In order to proceed, the JTS JDBC connection must
be closed and reopened in a new transaction.
7 FAQs: Installation
! I downloaded the WebLogic Server installation file, but the installation program
will not run. What should I do?
! I love the new domain configuration wizard. Can I create my own templates?
Q. I downloaded the WebLogic Server installation file, but the installation program
will not run. What should I do?
A. The installation file may have been corrupted during the download. Run a checksum
on the installation file and check with technical support for the proper values.
Q. I love the new domain configuration wizard. Can I create my own templates?
A. Support for custom templates for the Configuration Wizard is coming soon.
Currently, it is an undocumented, unsupported feature.
8 FAQs: Java
! Working With WebLogic Server Code Examples. See the WebLogic Server
Examples Guide located at samples/examples/examples.html in your
WebLogic Server distribution.
2. Run the setEnv script to make sure your CLASSPATH is correctly set in the shell
or DOS window in which you are running the examples. For more information,
see Setting your development environment at
http://www.weblogic.com/docs51/techstart/environment.html.
4. Verify that you are compiling with the -d option to direct the class files into the
proper directory, as defined in the example instructions.
If the example is an applet, check the CODE and CODEBASE, and make sure
WebLogic Server is running.
Table 8-1
Source Description
Sun’s Java Developer Connection at This forum includes Questions and Answers on
http://developer.java.sun.com/develo a wide variety of Java topics, including error
per/ messages. Use the Search box for fast results.
For example, type "classpath error" in the
Search box.
The default native stack size is 128k, with a minimum value of 1000 bytes. The default
java stack size is 400k, with a minimum value of 1000 bytes.
! The ISV must enter into a signed agreement with its distributors on terms
substantially similar to those contained here in this redistribution policy
explanation.
! The ISV requires an end user license agreement with the product within which it
embeds WebLogic Server.
! The embedding of the JDK in ISV products does not include maintenance and
support of the JDK by the JDK Provider. BEA Systems shall be solely
! If an ISV wants to ship a JDK that is different from the JDK that BEA ships
with WebLogic Server, that ISV needs to get those bundling rights directly from
Sun or HP. For example:
Assume that BEA ships WebLogic Server 6.0 with JDK 1.3 only, that BEA ships
WebLogic Server 5.1 with JDK 1.1 only, and that an ISV wants to ship JDK 1.1
with WebLogic Server 6.0 in an integrated product offered by that ISV. Unless
BEA, for BEA business reasons, elects to make WebLogic Server 6.0 with JDK
1.1 generally available, the ISV couldn't ship JDK 1.1 with WebLogic Server 6.0
in an integrated product offered by that ISV under BEA's agreement with that
ISV or under BEA's agreement with Sun. The ISV could, however, obtain its
own binary distribution agreement for the JDK from Sun and under that
agreement bundle JDK 1.1 with its value added software solution consisting of
the ISV applications and WebLogic Server 6.0 integrated.
! Why do I get the following exception when viewing the JNDI tree?
! Is it possible to use the Oracle database rather than PointBase with the current
implementation of the WebLogic J2EE Connector Architecture?
! When deploying a resource adapter (.rar) to WebLogic Server, are its classes
placed in the WebLogic classpath?
Q. Why do I get the following exception when viewing the JNDI tree?
isSerializable(class.javax.naming.Binding)
java.io.NotSerializableException:
java.io.PrintWriter at
java.io.ObjectOutputStream.OutputObject
A. The Weblogic Server JNDI implementation requires objects to be serializable, not
referencable. A PrintWriter cannot be serialized and therefore should be declared
transient.
Q. Is it possible to use the Oracle database rather than PointBase with the current
implementation of the WebLogic J2EE Connector Architecture?
A. The sample provided contains a resource adapter that represents any database
system. By default, configurations are set to use PointBase. In particular, the
configuration properties in the weblogic-ra.xml file set a PointBase datasource.
This can be replaced with Oracle settings.
Also, the resource adapter (in particular the ManagedConnectionFactory) must be
implemented to support Oracle. The resource adapter provided in this sample makes
use of the JDBC and therefore can support any database system which the resource
adapter is configured to represent.
Q. When deploying a resource adapter (.rar) to WebLogic Server, are its classes
placed in the WebLogic classpath?
For instance, I am deploying an EJB and a resource adapter (.rar), the EJB has no
dependencies on the .rar because the EJB is writing to the common client interface
(CCI). The EJB client application has sends/marshals as parameter classes that are
defined in the .rar. For some reason the EJB's class loader hierarchy cannot find the
definition of this .rar-specific class, even though the .rar is deploying successfully.
I receive the following error on the EJB client:
java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception
is:
java.lang.ClassNotFoundException:
com.mycompany.InteractionSpecImpl
A. When you pass an instance of
com.myclientcompany.server.eai.InteractionSpecImpl as an argument to
yourEJB,the appServer needstode-serialize(unmarshal)theobject undertheEJB
context, and it needs the required class for unmarshalling, inside the
ejb-jar(raTester.jar). So if you include the interactionspecimpl class in
your ejb-jar file, then you do not need to include those classes in your server's
classpath.
! Accesses multiple resources, such as a database and the Java Messaging Service
(JMS), during a transaction
With an EJB architecture, it is common for multiple EJBs that are doing database work
to be invoked as part of a single transaction. Without XA, the only way for this to work
is if all transaction participants use the exact same database connection. WebLogic
Server uses the JTS driver and a TxDataSource (with Emulate Two-Phase Commit for
non-XA Driver selected) to do this behind the scenes without requiring you to
explicitly pass the JDBC connection from EJB to EJB. With XA (requires an XA
driver), you can use a Tx Data Source in WebLogic Server for distributed transactions
with two-phase commit so that EJBs can use a different database connections for each
part of the transaction. In either case (with or without XA), you should use a
Tx Data Source.
WebLogic Server does provide the dbping utility to test the connection between
WebLogic Server and your DBMS using a JDBC driver. See dbping in “Using the
WebLogic Java Utilities” in the Administration Guide.
! Can the Weblogic JDriver for MSSSQL Server connect to the database server
using a trusted connection on NT/WIN2K?
Q. Can the Weblogic JDriver for MSSSQL Server connect to the database server using
a trusted connection on NT/WIN2K?
A. Our driver doesn't support trusted connections.
To find the port number where each MS SQL Server instance is running, run the server
network utility (in the Microsoft SQL Server program group), select the server
instance, select TCP/IP, and click the properties button.
! How do I use Unicode codesets with the WebLogic jDriver for Oracle driver?
! Why do I get an error while trying to retrieve the text for ORA-12705?
! Why do I run out of resources during updates with Oracle’s database link?
Q. What transaction isolation levels does the WebLogic jDriver for Oracle support?
A. Your servlet application may use Oracle Thin Drivers to access a database that
includes BLOB fields. If you install and try to use WebLogic jDriver for Oracle and
the same code fails and produces an exception similar to the following:
com.roguewave.jdbtools.v2_0.LoginFailureException:
TRANSACTION_READ_UNCOMMITTED isolation level not allowed
The Stack Trace:
com.roguewave.jdbtools.v2_0.LoginFailureException:
TRANSACTION_READ_UNCOMMITTED isolation level not allowed
at
com.roguewave.jdbtools.v2_0.jdbc.JDBCServer.createConnection
(JDBCServer.java :46)
at com.roguewave.jdbtools.v2_0.ConnectionPool.getConnection_
(ConnectionPool.jav a:412)
at com.roguewave.jdbtools.v2_0.ConnectionPool.getConnection
(ConnectionPool.java :109)
WebLogic jDriver for Oracle supports the following transaction isolation levels:
According to the Oracle documentation, the Oracle DBMS only supports these two
isolation levels. Unlike other JDBC drivers, WebLogic’s drivers throw an exception if
you try to use an isolation level that is unsupported. Some drivers silently ignore
attempts to set an unsupported isolation level. WebLogic suggests testing whether the
Oracle thin driver is not just ignoring settings for unsupported isolation events.
Q. How do I use Unicode codesets with the WebLogic jDriver for Oracle driver?
A. To use Unicode codesets:
1. Install the appropriate codeset when you install Oracle. If you did not do this in the
original installation, you will need to re-run the Oracle installer and install the
proper codeset.
2. Define the NLS_LANG variable in the environment where the JDBC driver is
running. Do this by assigning the proper codeset to NLS_LANG in the shell from
where you start the WebLogic Server.
The Developers Guide has more information about internationalization support. For
general information about Unicode see the Unicode Web site at
http://www.unicode.org. For a list of Unicode language abbreviations, see the JavaSoft
Web site at
http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html.
To set up your Oracle instance to use this feature, your DBA needs to follow these
basic steps. The full procedure is described in more detail in your Oracle
documentation.
3. Create a user named OPS$userid, where userid is some operating system login
ID. This user should be granted the standard privileges (for example, CONNECT
and RESOURCE).
4. Once the userid is set up, you can connect with WebLogic jDriver for Oracle by
specifying “/” as the username property and “” as the password property. Here is
an example for testing this connection with the dbping utility:
$ java utils.dbping ORACLE "/" "" myserver
Class.forName("weblogic.jdbc.oci.Driver").newInstance();
Connection conn = myDriver.connect("jdbc:weblogic:oracle",
props);
5. Use the Administration Console to set the attribute for your connection pool. The
following code is an example of a JDBC connection pool configuration using the
WebLogic jDriver for Oracle:
<JDBCConnectionPool
Name="myPool"
Targets="myserver,server1"
DriverName="weblogic.jdbc.oci.Driver"
InitialCapacity="1"
MaxCapacity="10"
CapacityIncrement="2"
Properties="databaseName=myOracleDB"
! For columns of type NUMBER: Because there is no explicit precision, the Java
type to return is determined based on the actual value in each row, and this may
vary from row to row. An Integer is returned if the value has a zero-valued
fractional component and the value can be represented by an integer.
For example, 1.0000 will be an integer. A long is returned for a value such as
123456789123.00000. If a value has a non-zero fractional component, a Double is
returned if the precision of the value can be represented by a Double; otherwise a
BigDecimal is returned.
where procName is the name of an Oracle stored procedure. This is standard Oracle
SQL syntax that works with any Oracle DBMS. You might also use the following
syntax:
CallableStatement cstmt = conn.prepareCall("{call procName};");
cstmt.execute();
This code, which conforms to the Java Extended SQL spec, will work with any DBMS,
not just Oracle.
The preceding code does not work because the complete value needs to be specified in
a String (without using embedded quotes) and then bound to an unquoted
question-mark (?). Here is the corrected code:
String matchvalue = "smit%";
String pstmt = "select n_name from n_table where n_name LIKE ?";
PreparedStatement ps = conn.prepareStatement(pstmt);
ps.setString(1, matchvalue);
ResultSet rs = ps.executeQuery();
Q. Why do I get unexpected characters from 8-bit character sets in WebLogic jDriver
for Oracle?
A. If you are using an Oracle database with an 8-bit character set on Solaris, make
sure you set NLS_LANG to the proper value on the client. If NLS_LANG is unset, it
defaults to a 7-bit ASCII character set, and tries to map characters greater than ASCII
128 to a reasonable approximation (for example, á, à, â would
all map to a). Other characters are mapped to a question mark (?).
The response lists of all codesets currently installed on your system. This listing will
look something like the following shortened list:
If you want to constrain the value in the query to a specific codeset you are searching
for, you might use a SQL query like the following:
SQL> SELECT value FROM v$nls_valid_values
WHERE parameter='CHARACTERSET' and VALUE='AL24UTFFSS';
You can use Oracle’s installation tools to install additional codesets. Contact Oracle at
http://www.oracle.com/ for more information.
You can look up an Oracle error by using the oerr command. For example, the
description of error ORA-12536 can be found with the command:
> oerr ora 12536
You can adjust the length of the value of the bound parameter by passing an explicit
length with the scale argument to the
CallableStatement.registerOutputParameter() method.
Q. Why do I get an error while trying to retrieve the text for ORA-12705?
A. This error occurs when you have not set the ORACLE_HOME environment variable
properly — a common mistake. In order to use WebLogic jDriver for Oracle, the
Oracle client software needs to be installed and ORACLE_HOME must be set.
You may also see this error message if you try to use WebLogic jDriver for Oracle’s
internationalization capabilities with a language/codeset combination that is not
installed on your system. If you get the ORA-12705 error with the correct error text,
then either you have set NLS_LANG improperly, or you do not have the right codesets
installed on your system.
Q. Why do I run out of resources during updates with Oracle’s database link?
A. When you use Oracle’s database link to update your database, you may get error
“maximum number of temporary table locks exceeded” even if you close your result
sets and statements when you finish.
The database link is an object in the local database that allows you to access tables,
views, and such in a remote database. The database link is controlled by the Oracle
server, so the driver has no control over its use of resources. The link appears to
perform the commit (since other processes could see the records that were being
created), but it doesn’t free any resources until the connection is closed. The solution
is to remove the database link and use the JDBC driver to do your selects, inserts, and
updates.
$ ORACLE_HOME=path
$ export ORACLE_HOME
where path is the path to your Oracle installation. When you ping your database using
the two-tier utils.dbping utility, the JDBC driver loads the database client library
and establishes the connection to the database. When you use the multitier
utils.t3dbping utility, the WebLogic Server loads a two-tier driver and uses it to
establish a database connection. In both cases, the same method is used to connect to
the database. SQL*PLUS works because it doesn’t require ORACLE_HOME to find
the client libraries.
5. Run the utils.t3dbping in the second shell against the server running in the
first command shell.
If this procedure doesn’t work, please send the output from these commands to
WebLogic technical support.
Q. Why do I get error "ORA-03120" when trying to access multi-byte characters from
the CLOB/NCLOB column?
A. Accessing exceeded characters would result in ORA-03120 error when getting the
length of the clob from the CLOB/NCLOB column returns a bigger value than the
actual length from the OCI layer. Using Oracle 8.1.6.3 solves this problem.
A. According to Oracle Metalink Bug Database Doc ID: 144784.1, in the absence of
explicit data typecasting, OCI assumes that a bind variable is a CHAR data type. If the
SQL statement intends to use the bind variable as a DATE data type, but OCI thought
it was a CHAR, the SQL parser will have a conflict in data types. The fix is to explicitly
use data conversion functions to convert the bind variables in the problem queries. For
example, a select string of
String st = "select count(*) from simple_table where
TRUNC(mydate) = TRUNC(?)";
13 FAQs: JMS
The WebLogic JMS Product
Configuration
! Can I still use the default connection factories supported in WebLogic JMS 5.1?
Persistent Stores
! Which types of JDBC databases does WebLogic JMS support?
Administration
! How do I configure JDBC so that the JMS JDBC Store recovers automatically?
! Does the WebLogic JMS server find out about closed or lost connections,
crashes, and other problems and does it recover from them?
Transaction Support
! How do I close a queue so that the messages will not be reloaded at the next
server startup?
! Is it possible to have multiple queue receivers listening on the same queue, using
message selectors (typically filtering on a correlation ID) to determine which
listener actually receives the message?
! Is there a way to make a queue such that if one application has one object as
listener on that queue, no other application can listen to the messages on that
queue?
! How do I use a startup class to initialize and later reference WebLogic JMS
objects?
! Why do I get a JNDI problem when I name a Topic A.B and a second Topic
A.B.C?
! How many messages are sent across the network for processing topic messages?
Message-Driven Beans
! By using distributed destinations, WebLogic JMS can also spread or balance the
messaging load across multiple physical destinations.
! Message flow control options for instructing producers to limit their message
flow.
! Message paging options for swapping out messages from virtual memory to
persistent storage when message loads reach a specified threshold.
! Flow Control – Using the Flow Control feature, you can enable a JMS server or
destination to slow down message producers when it determines that it is
becoming overloaded. Specifically, when a JMS server/destination exceeds its
specified bytes or messages thresholds, it instructs producers to limit their
message flow.
For more information, see “Managing JMS” in the Administration Guide.
For more information, see “Using the WebLogic Messaging Bridge” in the
Administration Guide.
! Message Paging – Made available in version 6.1 Service Pack 2, this feature can
free up valuable virtual memory during peak message load periods by swapping
out messages from virtual memory to persistent storage when message loads
reach a specified threshold. From a performance perspective, this feature can
greatly benefit WebLogic Server implementations with the large message spaces
that are required by today's enterprise applications.
For more information, see “Managing JMS” in the Administration Guide.
! Message-Driven Beans – In WebLogic Server 7.0, you can deploy an MDB that
supports container-managed transactions against a foreign JMS provider. See the
white paper, “Using Foreign JMS Providers with WebLogic Server”
(jmsproviders.pdf) on
http://dev2dev.bea.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers
for an example of how to configure an MDB to use a foreign provider.
Ask BEA
Q. Can I still use the default connection factories supported in WebLogic JMS 5.1?
A. Yes. For detailed information about using 5.1 connection factories in later versions
of WebLogic JMS, see “Porting WebLogic JMS Applications” in Programming
WebLogic JMS.
for(Iterator i = o.getMBeansByType("JMSTopic").iterator();
i.hasNext(); ){
WebLogicMBean wmb = (WebLogicMBean)i.next();
System.out.println("topic name found: " + wmb.getName());
}
for(Iterator i = o.getMBeansByType("JMSQueue").iterator();
i.hasNext(); ){
WebLogicMBean wmb = (WebLogicMBean)i.next();
System.out.println("queue name found: " + wmb.getName());
}
After the template name, you can set any queue/topic attribute you want in the template
(not including a JNDI name or topic multicast settings). The template is at the outer
most level; that is, it should not be nested in your <JMSServer>.
Temporary topics do not get names and cannot be subscribed to by other connections.
When you create a temporary topic, the JMS provider returns a javax.jms.Topic.
You then need to advertise that topic to other parties (those who want to publish to the
topic), putting it in your JMSReplyTo field so that they can respond. In general, no one
else can subscribe to the topic. You advertise the topic any way you want. Topics are
Serializable (or, in our case, Externalizable), which allows you to pass them around in
RMI calls, through a file, binding it to a name in JNDI, etc. In short, create the topic at
the subscriber side and advertise so that others can publish. You can get multiple
subscribers on the same connection and get concurrent processing using multiple
sessions.
! Oracle
! Sybase
! Cloudscape
! Informix
! IBM DB2
! Times Ten
The weblogic/jms/ddl directory within the weblogic.jar file contains JMS DDL
files for these databases, which are actually text files containing the SQL commands
that create the JMS database tables.
Note: WebLogic Server only guarantees support for the JDBC drivers included in
the previous list. Support for any other JDBC driver is not guaranteed.
The .ddl files located in the weblogic/jms/ddl directory of the weblogic.jar file
may be used as templates. Use the jar utility supplied with the JDK to extract them to
the weblogic/jms/ddl directory using the following command:
jar xf weblogic.jar weblogic/jms/ddl
Note: If you omit the second parameter (weblogic/jms/ddl), the entire jar file is
extracted.
Another option is to consider using a file store instead of a JDBC store. File stores are
easier to configure and may provide significantly better performance.
6. If you are using JDBC, the JDBC tables, JMSSTATE and JMSSTORE, are
created automatically when the JMS server boots. The DDL files used to create
the tables are stored in weblogic.jar in weblogic/jms/ddl. The example
configuration below shows a JDBC store for Oracle (refer to the Certifications
page at
http://e-docs.bea.com/wls/certifications/certifications/overvie
w.html for the latest Oracle certification information). To manually create the
tables (also deleting any existing tables), run java utils.Schema as described in
the previous question.
See the question, "How do I start WLS and configure JMS?" for a description of how
to configure JMS.
Here is a sample config.xml file resulting from configuring JMS. It should look
similar to yours. If you want JMS to use a file store instead of a database, just change
JDBCStore to FileStore in the JMSServer section.
<Server Name="myserver"
ListenPort="7001" DefaultProtocol="t3"
ThreadPoolSize="8" >
</Server>
<Security Realm="defaultRealm"
GuestDisabled="false" />
<Realm Name="defaultRealm"
FileRealm="defaultFileRealm" />
<FileRealm Name="defaultFileRealm"
/>
<JMSServer Name="TestJMSServer"
TemporaryTemplate="TestTemplate1"
Targets="myserver" Store="JDBCStore">
<JMSQueue Name="TestQueue1"
JNDIName="jms.queue.TestQueue1"
Template="TestTemplate1"
/>
</JMSServer>
<JMSTemplate Name="TestTemplate1"
/>
<JMSFileStore Name="FileStore"
Directory="myfilestore"
JMSServer="TestJMSServer"
/>
<JMSJDBCStore Name="JDBCStore"
ConnectionPool="testpool2"
JMSServer="TestJMSServer"
/>
<JDBCConnectionPool Name="testpool2"
Targets="myserver"
URL="jdbc:weblogic:oracle"
DriverName="weblogic.jdbc.oci.Driver"
InitialCapacity="0"
MaxCapacity="1"
CapacityIncrement="1"
Properties="user=SCOTT;password=tiger;server=bay816"
public class t
{
public final static String DESTINATION="jms.topic.TestTopic1";
public t()
{
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
InitialContext ctx = new InitialContext(env);
destination = (Topic) ctx.lookup(DESTINATION);
connectionFactory = (TopicConnectionFactory)
ctx.lookup("javax.jms.TopicConnectionFactory");
connection = (TopicConnection)
connectionFactory.createTopicConnection();
session = (TopicSession) connection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
A. The following are some similarities and differences between file stores and JDBC
stores:
! Both have the same transaction semantics, including rolling back transactions
(e.g., received messages are put back on the queue).
! Both have the same application interface (no difference in application code).
! JDBC may make it easier to handle failure recovery since the JDBC interface
can access the database from any client machine; with the file store, the disk
must be shared or migrated.
! File store reliability is limited to reliability of disk and O/S; run it on Veritas or a
RAID 5 system. Database reliability may be higher.
! File stores will require more memory, but perhaps not significantly more; it
depends on how fragmented the file store gets, if the application works roughly
Q. How do the JMS server/destination message maximum and threshold values work?
A. The byte and message maximum values are quotas - not flow control. Message
quotas prevent a WebLogic JMS server from filling up with messages and possibly
running out of memory, causing unexpected results. When you reach your quota, JMS
prevents further sends with a ResourceAllocationException (rather than
blocking). You can set quotas on individual destinations or on a server as a whole.
The thresholds are also not flow control - though they would be better suited to that
application than the quotas. The thresholds are simply settings that when exceeded
cause a message to be logged to the console to let you know that you are falling behind.
Note: WebLogic JMS 7.0 has a flow control feature that enables a JMS server or
destination to slow down message producers when it is becoming overloaded.
Specifically, when a JMS server/destination exceeds its specified bytes or
messages thresholds, it instructs producers to limit their message flow. For
more information, see “Managing JMS” in the Administration Guide.
Q. How do I configure JDBC so that the JMS JDBC Store recovers automatically?
A. If you are using a JDBC store when the DBMS goes down and then comes back
online, JMS cannot access the store until WebLogic Server is shut down and restarted.
To work around this problem, configure the following attributes on the JDBC
connection pool associated with the JMSJDBCStore:
TestConnectionsOnReserve="true"\
TestTableName="[[[catalog.]schema.]prefix]JMSState"
WebLogic JMS 7.0 also takes advantage of the migration framework implemented in
the WebLogic Server core for clustered environments. This allows WebLogic JMS to
properly respond to migration requests and bring a JMS server online and offline in an
orderly fashion. This includes both scheduled migrations as well as migrations in
response to a WebLogic Server failure. For more information, see “Managing JMS” in
the Programming WebLogic JMS.
Note: If you use the default connection factory, you have no control over the
WebLogic Server on which the connection factory may be deployed. If you
would like to target a particular WebLogic Server, create a new connection
factory and specify the appropriate JMS server target(s).
Q. Does the WebLogic JMS server find out about closed or lost connections, crashes,
and other problems and does it recover from them?
A. Yes, provided the client closes its resources, the network connection fails, or the
JVM it’s in exits, even for multicast pub/sub. It detects losses of "peers" and recovers.
Note: If both queues happen to be on the same JMS server, then a one-phase
transaction is used.
Q. Why is my WebLogic JMS work not part of a user transaction (i.e., called within
a transaction but not rolled back appropriately)? How do I track down transaction
problems?
A. Usually this problem is caused by explicitly using a transacted session which
ignores the external, global transaction by design (a JMS specification requirement).
A transacted JMS session always has its own inner transaction. It is not affected by any
transaction context that the caller may have.
It may also be caused by using a connection factory that is configured with
"UserTransactionsEnabled" set to false.
1. You can check if the current thread is in a transaction by adding these two import
lines:
import javax.transaction.*
import weblogic.transaction.*;
and adding the following lines (i.e., just after the begin and just before every
operation).
Transaction tran = TxHelper.getTransaction();
System.out.println(tran);
System.out.println(TxHelper.status2String(tran.getStatus()));
This should give a clear idea of when new transactions are starting and when
infection is occurring.
2. Ensure that the thread sending the JMS message is infected with a transaction.
Check that the code is not using a transacted session by setting the first parameter
of createQueueSession or createTopicSession to false. Note that creating the
connection and/or session is orthogonal to the transaction. You can begin your
transaction before or after. You need only start the transaction before you send or
receive messages.
3. Check that the UserTransactionsEnabled flag is explicitly set to true for the
connection factory in the config.xml file since the default for user-configured
connection factories for this value is false. If you are using one of the
pre-configured connection factories they are set as follows:
weblogic.jms.ConnectionFactory disables user transactions so
don't use this one for the case where user transactions are
desired;
javax.jms.QueueConnectionFactory and
javax.jms.TopicConnectionFactory enable user transactions.
4. You can trace JTA operations by starting the server with this additional property:
-Dweblogic.Debug.DebugJMSXA=true
You should see trace statements like these in the log:
XA ! XA(3163720,487900) <RM-isTransactional() ret=true>
This can be used to ensure that JMS is infected with the transaction.
3. Use a connection factory with user transactions disabled. That is, check that the
UserTransactionsEnabled flag is explicitly set to false for the connection factory
in the config.xml file or use the default for a user-configured connection factory
for this value which is false. The pre-configured connection factory
weblogic.jms.ConnectionFactory disables user transactions.
A transacted JMS session always has its own inner transaction. It is not affected by any
transaction context that the caller may have. A non-transacted JMS session is more
complicated. If you use the WLS 6.x or later default factory
weblogic.jms.ConnectionFactory, the session does not participate in a user
transaction because the UserTransactionsEnabled flag is set to "False". However,
if you use the deprecated WebLogic 5.1 default
javax.jms.QueueConnectionFactory or
javax.jms.TopicConnectionFactory factories, or you define your own factory
and set the UserTransactionsEnabled flag to "True", the JMS session participates in the
outer transaction, if one exists and the JMS session is not transacted.
Q. Can I use a one-phase commit if my WebLogic JMS JDBC store is on the same
database for which I am doing other database work?
A. No. WebLogic JMS is its own resource manager. That is JMS itself implements
XAResource and handles the transactions without depending on the database (even
when the messages are stored in the database). That means whenever you are using
JMS and a database (even if it is the same database as the JMS messages are stored)
then it is 2PC.
You may find it will aid performance if you ensure the connection pool used for the
database work exists on the same server as the JMS queue—the transaction will still
be two-phase, but it will be handled with less network overhead. Another performance
boost might be achieved by using JMS file stores rather than JMS JDBC stores.
Q. How do I integrate an XAResource with WLS to get JTA transactions with another
resource manager?
A. See the white paper, “Using JTA Transactions to Envelope WLS JMS and IBM
MQSeries” (jmsjta.doc) on
http://dev2dev.bea.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers for a
discussion on integrating MQ Series.
The XAResource interface has methods like start, prepare, and commit that the
transaction manager needs to manage a JTA transaction, and these are provided by
WebLogic JMS. When you wrap a JMS send or receive with a JTA transaction
(begin/commit), the JMS work is part of that transaction (unless you are using a
transacted session).
2. Start method.
4. Send message (message isn't sent – it's buffered until transaction commit).
6. End method.
7. Transaction Commit never Reached because original message was never sent
because you can't get past blocking receive.
The solution is to either use bean-managed transactions, or to break the send and
receive into two separate methods.
You can configure the maximum number of times that a message may be requeued.
You can also specify a delay time before which the message will not be available after
being requeued. If a message reaches its maximum requeue limit, it is put on an error
destination if one is configured or silently dropped.
Each time you suspend, you need to push the transaction onto a stack or list possibly
with the message so you can process it or roll it back later. This solution is high
overhead in that there can be a large build up of outstanding transactions. Note that
transactions have timeouts and it may rollback on its own, which means you can get
the message again (in a different transaction). Note also that there are some practical
limits on the number of transactions you should leave outstanding. The default limit is
something like 10000. Eventually you want to go back to your stack/list and
commit/rollback the transactions. Note that transaction references
(javax.transaction.Transaction) are not Serializable.
To create a destination key, use the Destination Keys node in the Administration
Console. For more information, refer to the Administration Console Online Help.
Third, the priority sorting only comes into play if there are multiple messages waiting
on the queue. If the receiver is always caught up with the sender, then the messages
will be processed in the order in which they come in.
Q. How do I deal with a listener that doesn't keep up with messages being sent?
A. Here are a few guidelines:
! Consider using multiple listeners.
! Consider reducing the processing in the listener (for example, don't call
"System.out").
! Sends are in general faster than receives. Consider lowering receive overhead by
not acknowledging every message, but by deferring acknowledge until several
messages have been received using client acknowledge. With asynchronous
listeners, the last few messages may not get acknowledged without extra code
logic if they don't fall on an acknowledge "boundary" (received 9 out of 10, but
don't receive the 10th).
Keep in mind that the queue browser is a not a “live” view of the queue. It is a
snap-shot.
Q. How do I close a queue so that the messages will not be reloaded at the next server
startup?
A. JMS does not define the deletion of queues. Using WebLogic JMS, you can
administratively create and delete queues. There is no way to dynamically delete
queues at run-time.
You can acknowledge the messages or not use persistence. Further, you can use
temporary queues. They exist only for the life of the connection. You can also use
durable subscriptions. A durable subscriber’s message gets deleted if that durable
subscriber unsubscribes, but the topic continues to exist.
Make sure weblogic.jar is in the CLASSPATH of the client. Also make sure you have
the correct Java run-time jar files included (i.e., you might need rt.jar).
The topic generally performs better. However, it depends on the message mix and
queue depth. When using queues, if there are a lot of messages that don't match what
you are looking for, you are going to compare your selector against those messages
over and over again each time you go back to look for one of yours. When using a
topic, each message is compared against all consumers exactly once. There is never
any duplicate work.
Also, if you are using synchronous queuing (posting a receive call), each time you go
you have to look for a message. That is, you wait during the time the server is
comparing. When you use topics, the message has been compared up front and
essentially put in your own private queue. You don't have to look at that point. It is
FIFO from your own private queue. The server can do the comparisons while you are
processing orders as opposed to your application blocking while the server finds you
a message.
Q. Is it possible to have multiple queue receivers listening on the same queue, using
message selectors (typically filtering on a correlation ID) to determine which listener
actually receives the message?
A. Sun Microsystems’ JMS specification does not define the behavior. WebLogic
JMS 6.x or later supports this. Whenever a message lands on the queue, JMS will look
at all of the consumers for the queue in the order in which they did their receives;
whoever is the first to match the message receives the message. For asynchronous
queue consumers, you must set your listener first, and then you will be first in the
consumer list. However, each time an asynchronous queue consumer receives a
message, the consumer goes to the end of the list. Note that unlike topics, if a message
does not match a selector, it is left in the queue until someone has no selector, or a
selector that does match.
Q. Is there a way to make a queue such that if one application has one object as listener
on that queue, no other application can listen to the messages on that queue?
A. No. An alternative is to create a topic with a single durable subscription because a
durable subscription may only have one consumer associated with it. The only
drawback is that selectors would no longer work the same as they do with queues.
Changing the selector on a durable subscription "resets" the subscription as per Sun
Microsystems’ JMS specification, causing all messages currently in the subscription
to be deleted.
! Use the receiveNoWait() method which returns the next message or a null
value if no message is currently available. In this case, the call does not block.
The servlet should provide a way to return to or reschedule the request, without
calling wait().
Note: Use of this option should be minimized, as it may deadlock a busy server.
! Ensure that more threads are configured than the number of possible
simultaneous blocking receive() calls.
Messages sent to a NO_ACKNOWLEDGE session are immediately deleted from the server.
Messages received in this mode are not recovered and, as a result, messages may be
lost and/or duplicate message may be delivered if an initial attempt to deliver a
message fails.
Note: You should avoid using this mode if your application cannot handle lost or
duplicate messages. Duplicate messages may be sent if an initial attempt to
deliver a message fails.
In addition, we do not recommend that this acknowledge mode be used with persistent
messaging, as it implies a quality of service that may be too low for persistent
messaging to be useful.
! High scalability due to the reduction in the amount of resources required by the
JMS server to deliver messages to multicast subscribers.
For an example of when multicasting might be useful, consider a stock ticker. When
accessing stock quotes, timely delivery is more important than reliability. When
accessing the stock information in real-time, if all, or a portion, of the contents is not
delivered, the client can simply request the information be resent. Clients would not
want to have the information recovered in this case because by the time it is redelivered
it would be out-of-date.
Multicast messages are not guaranteed to be delivered to all members of the host
group. For messages requiring reliable delivery and recovery, you should not use
multicasting.
Note: Server session pools can also be implemented using Message Driven Beans.
Using MDBs is preferable to using server session pools; this issue is addressed
in, "How do server session pools and message driven beans compare?" For
information on using message driven beans to implement server session pools,
see Programming WebLogic Enterprise JavaBeans.
Q. How do I issue the close() method within an onMessage() method call and what
are the semantics of the close() method?
A. If you wish to issue the close() method within an onMessage() method call, the
system administrator must select the Allow Close In OnMessage check box when
configuring the connection factory. For more information, see JMS Connection
Factories in the Administration Console Online Help guide. If this check box is not
selected and you issue the close() method within an onMessage() method call, the
call will hang.
The close() method performs the following steps to execute an orderly shutdown:
! Waits until all message listeners that are currently processing messages have
completed (except for the message listener from which the close() method is
being called).
When you close a connection, all associated objects are also closed. You can continue
to use the message objects created or received via the connection, except the received
message's acknowledge() method. Closing a closed connection has no effect.
When you close a session, all associated producers and consumers are also closed.
For more information about the impact of the close() method for each object, see the
appropriate javax.jms javadoc.
Q. How do I use a startup class to initialize and later reference WebLogic JMS
objects?
A. This topic is covered in
news://newsgroups.bea.com/3ad0d7f3@newsgroups.bea.com. The sample code does
not cleanup properly at shutdown. You can use a shutdown class that does something
like the following:
JMSobject WLSobject = null;
try {
WLSobject = JMSStartUp.getJMSobject();
WLSobject.JMSCleanup();
} catch(Exception e) {}
Servlets can provide a nice solution to provide both initialization and cleanup. See the
question in this section "What is the standard way for creating threads, doing
initialization, etc. within the application server?".
When things are done non-transactionally, there can be duplicates or lost messages
(assuming your onMessage() code is attempting to forward messages):
1. If you call acknowledge after the publish() and the acknowledge fails for whatever
reason (network/server failure), then you will see the message again and will end
up publishing twice (possible duplicate semantics). You can try to keep track of
sequence numbers to detect duplicates but this is not easy.
2. If you call acknowledge before the publish(), you get at-most-once semantics.
If the publish() fails, you don't know if the failure occurred before or after the
message reached the server.
If you want exactly once, transactional semantics using onMessage, you must use
transactional MDBs. The onMessage() for a transactional MDB starts the transaction,
includes the WebLogic Server JMS message received within that transaction and the
publish() would also be in the same transaction. The following code sends a
response to each message that it receives. It creates the connection, etc. in the
ejbCreate method so that it doesn't need to create it every time onMessage is called.
The QueueSender is anonymous (null Queue) since we don't know to whom we will
have to reply. The ejbRemove method cleans up by closing the connection. This same
approach can be used to create a receiver, subscriber or publisher.
import javax.ejb.CreateException;
import javax.ejb.EJBContext;
import javax.naming.*;
import javax.naming.directory.*;
import java.util.Hashtable;
import javax.ejb.MessageDrivenBean;
import javax.ejb.MessageDrivenContext;
import javax.jms.*;
"javax.jms.QueueConnectionFactory";
public static final String WLSqname =
"jms.queue.TestQueue1";
public static final String WLSurl =
"t3://localhost:7001";
public static final String WLSJNDIfactory =
"weblogic.jndi.WLInitialContextFactory";
private MessageDrivenContext context;
private QueueSession session;
private QueueConnection connection = null;
private QueueConnectionFactory factory;
private InitialContext ctx;
private QueueSender QueueSender;
// Required - ejbActivate
public void ejbActivate() {}
// Required - ejbRemove
public void ejbRemove() {
context = null;
if (connection != null) {
try {
connection.close();
} catch(Exception e) {}
connection = null;
}
}
// Required - ejbPassivate
public void ejbPassivate() {}
factory = (QueueConnectionFactory)ctx.lookup(WLSqcf);
// Implementation of MessageListener
// Throws no exceptions
public void onMessage(Message msg) {
try {
System.out.println("MDB: " +
((TextMessage)msg).getText());
msg.clearBody();
((TextMessage)msg).setText("reply message");
queueSender.send((Queue)msg.getJMSReplyTo(), msg);
}
catch(Exception e) { // Catch any exception
e.printStackTrace();
}
}
}
This approach creates a connection per EJB/MDB instance, so you might want to
create a producer pool that is shared by the EJB instances. This is done by writing a
class that populates a static pool with producers (see the next question for a sample
producer pool). The onMessage call grabs a producer when needed. Since Sessions
must be single threaded, make sure there is only one producer per session within the
producer pool.
Note: Static classes may be garbage collected if there are no references to them, so
make sure the application server has a permanent pointer to them in some
manner. One way is to reference it permanently from within a servlet or EJB
when they are initialized at startup.
Here is an example of using the producer pool within the onMessage method.
onMessage() {
QueueSender qs = ProducerPool.get(...);
qs.send(...);
ProducerPool.put(qs);
}
You can pre-populate this pool by calling it from a startup class or a load-on-start
servlet class.
A rolled back message remains pending until the transaction actually rolls back.
Rolling it back multiple times does not cause double counting, nor does an exception
that set a transaction as rollbackOnly followed by an actual rollback.
Total implies total since server last started. The byte counts only consider the payload
of messages which includes the properties and the body but not the header.
Q. What is the standard way to create threads, do initialization, etc. within the
application server?
A. Threads should generally not be created by the user directly is because things may
not work correctly. User-created threads do not have some of the thread-local variables
pre-set by WebLogic when it creates it's own execute threads, the associated
transaction context, or the environment such as the proper class loader. The
WebLogic-specific way of doing this is with a startup class or using the WebLogic
Time Services. The portable way to do this is to define a load-on-startup servlet, doing
the initialization in the init() method and the cleanup in the destroy() method. The
servlet itself does nothing. This approach also allows for undeploy/redeploy of the
application without restarting the server, including proper cleanup/initialization each
time. It also providers more dynamic management of the dependent classes without
restarting the server.
Q. Why do I get a JNDI problem when I name a Topic A.B and a second Topic A.B.C?
A. This is a JNDI implementation issue. JNDI uses the dots to build a directory-like
structure. A given element cannot be both a node and a leaf in the tree. In this example,
B is used as a leaf off of A, but then is used as a node off of which C is a leaf.
Q. How many messages are sent across the network for processing topic messages?
A. If there are three subscribers for a message, for example, one of which with a
selector that does not match, how many messages are sent?
In WebLogic JMS 6.x or later, when all three consumers are in the same session, we
send one copy of the message across the network for all subscribers that are not
flow-controlled. Once a consumer is flow-controlled for not acknowledging enough
messages, no messages are sent until flow control is eased. So, the answer is usually
one, but may be two. The selection is done on the server side so a subscriber that
doesn't match doesn't have to discard anything.
! Use the QueueRequestor class, which does the temporary queue for you, and
wait for the reply, as in the following:
// create temporary queue for receiving answer
qrequestor = new QueueRequestor(qsession, queue);
TextMessage msg = qsession.createTextMessage();
TextMessage reply = (TextMessage) qrequestor.request(msg);
! Use a JTA transaction, then rollback the transaction so the message will go back
to the queue.
Q. Is it okay to add new sessions and subscribers to a Queue or Topic Connection once
it has been started?
A. Yes, with one caveat. You may not add new subscribers/consumers to a session if
it already has active async consumers. Sessions must only be accessed single-threaded
as per Sun Microsystems’ JMS specification spec. If you feel you need to do this,
create a new Session and add it to that one instead.
You can add receivers to a started connection. A receiver in itself is not asynchronous.
You need a listener to make it asynchronous. The first creation of a receiver is always
safe. If you then add a listener for that first receiver, you have to worry for any future
receivers in that same session. You can create new sessions and the first receiver for
that session with no worries.
Once you want to create a second receiver in a session, if the first receiver has a
MessageListener, you have to take care to make sure there are no other threads of
execution in that session. You can do this by stopping the connection or actually
creating your receiver from the onMessage routine of the first receiver.
As of WLS 6.1 SP02 or later, you can use the Message Paging feature, which can free
up valuable virtual memory during peak message load periods by swapping out
messages from virtual memory to persistent storage when message loads reach a
specified threshold. For more information, see “Managing JMS” in the Administration
Guide.
Now when the onMessage routine tries to acquire the monitor lock, it blocks waiting
for the main() method thread to give up, and the main() method thread is waiting for
the onMessage to be completed.
JMS also blocks when the close() method of a consumer is done from an onMessage
routine and the allowCloseInOnMessage attribute is set to false in the config.xml
file.
One of the main advantages of using message-driven beans in place of the standard
JMS MessageListener is that a JTA transaction can be started for you automatically
and the received message will be part of that transaction. In this case, other operations
can be infected with the same JTA transaction such as database operations. This is the
only way to infect a message from an asynchronous consumer and another JTA
operation with the same transaction.
One customer had an example where topic MDBs are needed in which there will be
multiple implementations of the MDBs listening on the same topic. In other words,
more than one MDB with a different implementation may be subscribing to the same
topic. The client has no advanced way of knowing how many different kinds of MDBs
may be listening on the same topic, but it is possible for there to be more than one
listener, therefore topics, not queues. For each kind of MDB listening on the topic, the
message is delivered exactly once (i.e., the message will be delivered exactly once to
an instance in each named MDB pool listening on the topic).
the MDB is not currently active doesn't mean it isn't deployed. The container still
maintains the subscription and gives out messages to the MDBs.
See the white paper, “Using Foreign JMS Providers with WebLogic Server”
(jmsproviders.pdf.doc) on
http://dev2dev.bea.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers for an
example of how to configure an MDB to use a foreign provider.
To roll back a transaction, you can either use the Weblogic extension TXHelper or you
can use the MDB context as in the following code examples:
UserTransaction ut =
weblogic.transaction.TXHelper.getUserTransaction();
ut.setRollbackOnly();
or
private MessageDrivenContext context;
ServerSessionPools have the limitation that the destination on which its connection
consumers are listening must be hosted by the same JVM. That is, you cannot have a
server session pool listening on a remote queue or topic and foreign (non-WebLogic
Server JMS) destinations are not supported. MDBs can be distributed and can have
foreign destinations.
MDBs currently receive one message per deployment (in Service Pack 1). If you have
an MDB with multiple instances on a single server listening on a topic, it will receive
only one copy of the a published messages regardless of the number of instances. If
you have an MDB deployed across multiple machines listening on a topic, each
deployment will receive a copy of any published message on that topic. You will get
multiple copies of the message distributed evenly across all of your MDB
deployments.
14 FAQs: JTA
! Can I use a non-XA driver in distributed transactions?
! Can I use more than one non-XA connection pool in distributed transactions?
! What XA drivers can I use in addition to the WebLogic jDriver for Oracle/XA?
! Do I need a 2PC licence when I use JMS with one JDBC non-XA driver?
Q. Can I use more than one non-XA connection pool in distributed transactions?
A. No. Even if you set EnableTwoPhaseCommit=true for both TxDataSources of
the connection pools, attempting to use two non-XA connection pools in the same
distributed transaction will result in:
"java.sql.SQLException: Connection has already been created in this tx context for
pool named <first pool's name>. Illegal attempt to create connection from another
pool: <second pool's name>"
when you attempt to get the connection from the second non-XA connection pool.
Q. What XA drivers can I use in addition to the WebLogic jDriver for Oracle/XA?
A. Theoretically, you can use any third party XA driver that is compliant with the
JDBC 2.0 standard extension specification with WLS. However, an individual
vendor's XA driver may have bugs that prevent it from working properly.
Refer to JDBC Configuration guidelines for details about how to configure them at
http://e-docs.bea.com/wls/docs70/adminguide/managetx.html.
This limitation exists because WebLogic jDriver for Oracle XA is implemented using
Oracle's OCI API and C XA switch, and there is an Oracle problem when using OCI
with XA in multi-threaded mode. Closing an OCI cursor in a thread that is different
than the thread in which it is opened may result in server crash or unexpected behavior.
As a result, the WebLogic driver implicitly closes all open result sets upon returning a
call to the caller.
! If you are using an XA driver, you can obtain the connection before or after the
distributed transaction begins.
A resource is declared active again, if you re-register the XAResource with the
WebLogic Server Transaction Manager by calling
weblogic.transaction.TransactionManager.unregisterResource followed
by registerStaticResource or registerDynamicResource, or after a timeout
period of 30 minutes. If you are using WLS JDBC connection pools, you only need to
enable the JDBC connection pool refresh feature (by specifying the "RefreshMinutes"
property of the connection pool), and, upon a successful connection pool refresh, the
corresponding XAResource will be re-registered automatically. If you are registering
your own XAResource, either via
weblogic.transaction.TransactionManager.registerStaticResource or
registerDynamicResource APIs, you will need to re-register the XAResource by
calling weblogic.transaction.TransactionManager.unregisterResource
followed by registerStaticResource or registerDynamicResource.
15 FAQs: Plug-Ins
! How does the Apache HTTP Server Plug-In work?
! How does the plug-in route the request for a sticky session?
Q. How does the plug-in route the request for a sticky session?
A. If the browser sends a cookie, we look for "JSESSIONID" (configurable by a
parameter called "CookieName") in the "Cookie: " header.
If the cookie is disabled and URL re-writing is used, the session id is encoded in the
URL. In WebLogic Server 5.1 and earlier, it was encoded in the query string:
?WebLogicSession=my_dumy_session
The log file is configurable for 6.1. For later versions of WebLogic Server, the
WLLogFile was introduced to configure the debug filename and location.
Client headers and the post data (if present) being read:
"Fri Jun 22 14:24:40 2001 Hdrs from clnt:[Accept]=[image/gif,
image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/msword,
application/vnd.ms-powerpoint, */*]"
Client headers and the post data (if any) being sent:
"Fri Jun 22 14:24:40 2001 Hdrs to WLS:[Accept]=[image/gif,
image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/msword,
application/vnd.ms-powerpoint, */*]"
Response headers being sent to WebLogic Server and indicating if the connection is
close or keep-alive is here:
"Fri Jun 22 14:24:46 2001 Hdrs to client:[Date]=[Fri, 22 Jun 2001
21:24:48 GMT] Fri Jun 22 14:24:46 2001 Hdrs to
client:[Server]=[WebLogic WebLogic Server 6.1 beta 06/21/2001
10:44:44 #122398 - internal build by jlee on client jlee.qa89] Fri
Jun 22 14:24:46 2001 canRecycle: conn=1 status=200 isKA=0 clen=2705
isCTE=0 Fri Jun 22 14:24:46 2001 closeConnection in load_utils:
deleting URL* Fri Jun 22 14:24:46 2001 INFO: Closing SSL context
Fri Jun 22 14:24:46 2001 INFO: sysSend 23 Fri Jun 22 14:24:46 2001
INFO: Error after SSLClose, socket may already have been closed by
peer Fri Jun 22 14:24:46 2001 r->status=200 returning 0"
! General list: the current server list (could be static or dynamic) besides the
primary and secondary servers associated with the current request
SSLVerifyClient require
SSLVerifyDepth 10
Q. Sometimes a reponse from WebLogic Server to the plug-in contains the Set-Cookie
header. Is this normal?
A. Yes. WebLogic Server will send the Set-Cookie header in the response if the
Cookie header is missing from the request or X-WebLogic-Force-Cookie is
detected. If the plug-in fails to connect to a bad server, the plug-in will send the header
X-WebLogic-Force-Cookie: true to the next available server to force the client to
update the corresponding cookie which contains the correct session information.
16 FAQs: Server-Related
Questions
! How does WebLogic support CORBA and client communication via IIOP?
! How can I debug the Java code that I have running in WebLogic Server?
Q. How does WebLogic support CORBA and client communication via IIOP?
A. “CORBA” support means many things to many people. It often means simply IIOP
and ORB support and does not use many CORBA services. WebLogic supports
CORBA in multiple ways. The WebLogic Server 7.0 implementation of RMI-IIOP
allows you to: connect Java RMI clients to WebLogic Server using the standardized
IIOP protocol; connect CORBA/IDL clients, including those written in C++, to
WebLogic Server; interoperate between WebLogic Server and Tuxedo clients;
connect a variety of clients to EJBs hosted on WebLogic Server. For more information,
see Using WebLogic RMI over IIOP at
http://e-docs.bea.com/wls/docs70/rmi_iiop/index.html.
RMI-IIOP is for Java programmers who want to program to the RMI interfaces but use
IIOP as the underlying transport. RMI-IIOP provides interoperability with other
CORBA objects implemented in various languages, but only if all the remote
interfaces are originally defined as Java RMI interfaces. It is of particular interest to
programmers using Enterprise JavaBeans (EJBs), because the remote object model for
EJB is RMI-based. It also allows you to use the standardized IIOP protocol and have
a lightweight (minimal weblogic classes) client.
Java IDL is for CORBA programmers who want to program in Java based on
interfaces defined in CORBA IDL. This is "business as usual" CORBA programming,
supporting Java in exactly the same way as other languages like C++ or COBOL. If
you want to integrate C++ (or any other language your orb supports into IDL) you
would use the CORBA IDL method of programming.
2. Run rmic -idl against the interface to produce IDL compatible with the RMI
interface.
3. Run a C++ stub compiler against the IDL file to produce the C++ skeleton for
your C++ server object.
Q. How can I debug the Java code that I have running in WebLogic Server?
A. You can use tools such as WebGain, JBuilder, NetBeans and JDB that rely on the
Java Platform Debugger Architecture (JPDA) to debug your Java code running in
WebLogic Server.
JPDA is integrated in the Java 2 Platform, Standard Edition (J2SE) SDK 1.3 on all
platforms and SDK 1.2.2 for Linux. There is a download available from Sun to add
JPDA support to the J2SE SDK 1.2.2 on Solaris and Microsoft Window platforms. If
you are using J2SE SDK 1.2.2 on these platforms you must first get this download.
To allow a debugger to attach to the virtual machine that WebLogic runs you have to
start WebLogic in debug mode. In order to start WebLogic in debug mode using a Sun
virtual machine follow these steps (start with step one only if using a Solaris platform):
2. Add the following parameters to the java command line (before the
"weblogic.Server" string) that launches WebLogic server:
-Xdebug
-Xnoagent
-Xrunjdwp:transport=dt_socket
server=y
address=<port_for_debugger_to_connect>
suspend=n
-Djava.compiler=NONE
Note that with the Hotspot Performance engine the -Xnoagent and
-Djava.compiler=NONE options are no longer required, but are accepted and ignored
for compatibility reasons.
prints in your standard output stream when the server starts, the number 46666 is the
port number to be supplied to your tool's remote debugger in order to attach it to
WebLogic's virutal machine.
! How can I run multiple instances of the same servlet class in the same WebLogic
Server instance?
then you could parse the parameter as follows, where “req” is the
HttpServletRequest object:
Q. How can I run multiple instances of the same servlet class in the same WebLogic
Server instance?
A. If you want to run multiple instances, your servlet will have to implement the
SingleThreadModel interface. An instance of a class that implements the
SingleThreadModel interface is guaranteed not to be invoked by multiple threads
18 FAQs: Security
! What is the difference between the Compatibility realm and myrealm? Under
what circumstances should I use each of these realms?
! What are the default groups users and everyone used for?
! I am using the 6.x security realm APIs in my application. How do I upgrade this
functionality to the security APIs in WebLogic Server 7.0?
! Can a Weblogic Server deployment have one RSA and one non-RSA certificate?
! Can I use a JNDI Initial Context to pass the security credentials of a WebLogic
Server user?
! Why can't I establish an outbound SSL connection when using the demonstration
certificates?
! Why doesn’t my Custom security provider show up (that is, it doesn’t appear as
a Configure a new Security_Provider_Type link) in the
Administration Console?
Q. What is the difference between the Compatibility realm and myrealm? Under what
circumstances should I use each of these realms?
A. If you have a 6.x config.xml file and you boot WebLogic Server 7.0, the
following realms are created:
! Compatibility realm—Allows you to use an existing 6.x security configuration
as is in the management environment provided in WebLogic Server 7.0. The
Realm Adapter providers allows access to existing stores of users, groups, and
access control lists (ACLS).
! myrealm—Is the default security realm in WebLogic Server 7.0. By default, the
WebLogic Security providers are configured in myrealm.
Q. What are the default groups users and everyone used for?
A. The users and everyone groups are convenience groups that allow you to apply
global roles and security policies. All WebLogic Server users are members of the
everyone group. Only WebLogic Servers who are not the <anonymous> user are
members of the users group.
For more information, see Managing WebLogic Security.
If you want to have a guest user in WebLogic Server 7.0, create a user with the name
guest in the Authentication provider in the default security realm and give the user the
password of guest. If your code depends on the guest user, you should consider
rewriting it to use the utility methods in weblogic.security.WLSPrincipals.
try{
callbackHandler.handle(callbacks)
textField1=((TextInputCallback)callbacks[2].getText
} catch (java.io.IOException ioe) {
throw new LoginException(ioe.toString());
}catch (UnsupportedCallbackException uce) {
throw new LoginException
(“Error:”+uce.getCallback().toString() +
“not available to garner authentication information” +
“from the user”);
}
//”textField1 is not set correctly
Q. I am using the 6.x security realm APIs in my application. How do I upgrade this
functionality to the security APIs in WebLogic Server 7.0?
Specifically, I am using the security.getRealm() method and then the
getGroup(), getGroups(), and getUser() methods on the returned realm.
A. You can use your 6.x application as is in the WebLogic Server 7.0 environment by
using Compatibility security.
The management of WebLogic Server changed in 6.0 away from direct calls on the
realm to the use of MBeans. This change was the first step in creating a unified
administration model for WebLogic Server. While the Security MBeans introduced in
6.0 mirrored the capabilities defined for the realm, they were not flexible enough to
allow security vendors to integrate their products with WebLogic Server. WebLogic
Server 7.0 provides a set of Security Service Provider Interfaces (SSPI) and Security
SPI MBeans that allow you to write custom security products for WebLogic Server.
These MBeans can also be used to replicate functionality in an existing application so
that the application can be used in the WebLogic Server 7.0 environment.
If you choose to upgrade your realm, you will need to write an implementation of the
MBeans found in the weblogic.management.security package. These MBeans
allow you to implement management methods that are specific to your 6.x realm. For
a description of using the MBeans in the weblogic.management.security
package, see Developing Security Providers for WebLogic Server.
The following are some hints that may help you upgrade applications based on security
realms to the security architecture available in WebLogic Server 7.0:
! If you are using the security realm to authenticate users, instead use the JAAS
API to authenticate users.
! Table 18-1 lists the mappings between the interfaces in the 6.x of the
weblogic.security.acl package to the interfaces in the 7.0 of the
weblogic.managment.security.authentication package.
newUser() UserEditor.createUser()
deleteUser() UserRemover.removeUser()
newGroup() GroupEditor.createGroup()
deleteGroup() GroupRemover.removeGroup()
Group.addMember() GroupEditor.addMemberToGroup
Group.removeMember() GroupEditor.removeMemberFromGroup()
Group.isMember() GroupMemberLister.listGroupMembers()
or SubjectUtils.isUserInGroup()
Group.members() GroupMemberList.listGroupMembers()
userExists() UserReader.isUser()
isGroupMember() GroupReader.groupExists(),
GroupReader.isMember()
Q. Can a Weblogic Server deployment have one RSA and one non-RSA certificate?
A. No.
3. Specify the Server Private Key Alias and Server Passphrase attributes on the SSL
protocol tab in the WebLogic Server Administration Console.
If the private key is not found, WebLogic Server looks in the file specified in the Server
Key File Name attribute on the SSL tab under the Server node.
For more information, see Managing WebLogic Security.
Note: The WebLogic Keystore provider is deprecated in WebLogic Server 7.0 SP01.
Q. Why do I get a Java security permission error when starting and running WebLogic
Server?
For example: java.security.AccessControlException:access denied
(description of error)
Q. Why do I get a certificate configuration error when I start the my Weblogic Server?
For example: Alert> <WebLogicServer> <Security> configuration problem
with certificate file
A. It is possible that you did not specify a WL_HOME relative file name in your SSL
configuration files.
For more information, see Managing WebLogic Security.
Q. Why can't I establish an outbound SSL connection when using the demonstration
certificates?
This argument disables the Hostname Verifier which compares the subject DNs and
host names. This solution is recommended in development environments only. A more
secure solution is to obtain a new digital certificate for the server making outbound
SSL connections.
A problem with the configuration of the SSL protocol will also raise the following
exception:
<java.io.IOException: Write Channel Closed, possible handshaking or
trust failure>
A. By default, WebLogic Server contains a Hostname Verifier that compares the
subject DNs of digital certificates and host names. When establishing an SSL
connection, the subject DN of the digital certificate must match the host name of the
server initiating the SSL connection. If you use the demonstration certificates the host
names will not match. To avoid this situation, use the following command-line
argument when starting WebLogic Server:
-Dweblogic.security.SSL.ignoreHostnameVerification=true
Q. Why doesn’t my Custom security provider show up (that is, it doesn’t appear as a
Configure a new Security_Provider_Type link) in the Administration Console?
A. Check to make sure the system administrator put the MBean JAR file (MJF) in the
lib/mbeantype directory.
19 FAQs: Upgrading
! What is Compatibility mode?
! What WebLogic Server version will I see when I try to download 7.0.0.1?
For more information on this deployment model and other 7.0 deployment features,
see WebLogic Server Application Deployment.
Q. What WebLogic Server version will I see when I try to download 7.0.0.1?
A. C:\bea\weblogic700\samples\server\config\examples>java weblogic.version
WebLogic Server 7.0 Thu Jun 20 11:47:11 PDT 2002 190955
WebLogic XMLX Module 7.0 Thu Jun 20 11:58:44 PDT 2002 190955
You can differentiate from WebLogic Server 7.0 GA by date and change number (i.e.
190955).
21 FAQs: Wireless-Related
Questions
! Will my solution work on different networks such as CDMA, GPRS, TDMA and
PDC-P?
A. The following is a list of factors to consider when writing applications for wireless
clients:
! Content should be personalized based on the location of the device and/or the
type of the device.
! Some devices have additional features such as Bluetooth, power keys and SMS
messaging that can be used to enhance an application.
! Often the devices can be used with voice portals using voice recognition and
text-to-speech.
! Most of the devices have smaller screens that may or may not display color or
graphical images.
! Many of the devices have a difficult data entry and selection mechanism with
numeric keypads or styli.
! A few of the devices are limited in the amount of data that can be transmitted to
them for a page.
Note that other wireless carriers and devices use protocols and markup languages other
than WAP and i-Mode. For example, the Palm VII uses web clipping over a
proprietary protocol.
Q. Will my solution work on different networks such as CDMA, GPRS, TDMA and
PDC-P?
A. Yes. WAP and i-Mode were designed to hide the network details from the
application developer. They will both work equally well on any underlying network.
Therefore, as carriers upgrade their networks, applications written for either WAP or
i-Mode will continue to work without any need for modifications. As the networks are
upgraded to higher speeds, the performance of wireless applications written in either
WML or cHTML should improve as well.
22 FAQs: XML
! Which XML parser comes with WebLogic Server 7.0?
! Can I use the getAttribute() and setAttribute() methods of Version 2.3 of the Java
Servlet API to parse XML documents?
! Can I plug in a version of Apache’s Xerces XML parser that is different to the
one that is built-in with WebLogic Server 7.0 (Xerces 1.4.4)?
! I plugged in a version of Apache Xalan that I downloaded from the Apache Web
site, and now I get errors when I try to transform documents. What is the
problem?
write SAX event handlers, which can get complicated when dealing with
complex XML documents.
Q. Can I use the getAttribute() and setAttribute() methods of Version 2.3 of the Java
Servlet API to parse XML documents?
A. Yes. Use the setAttribute() method for SAX mode parsing and the
getAttribute() method for DOM mode parsing. Using these methods in a Servlet,
however, is a WebLogic-specific feature. This means that the Servlet may not be fully
portable to other Servlet engines, so use the feature with caution.
Q. Can I plug in a version of Apache’s Xerces XML parser that is different to the one
that is built-in with WebLogic Server 7.0 (Xerces 1.4.4)?
A. Yes. The version of Xerces that you can plug in, depends on the specific service
pack of WebLogic Server 7.0 that you have installed.
If you have installed WebLogic Server 7.0.0.1 or lower on your computer, follow these
instructions:
You can plug in the following versions of Xerces:
" Xerces 1.2.2
" Xerces 1.2.3
" Xerces 1.3.0
" Xerces 1.3.1
" Xerces 1.4.0
" Xerces 2.0.0
" Xerces 2.0.1
If you have installed WebLogic Server 7.0 Service Pack 1 on your computer, follow
these instructions:
You can plug in any version of the Xerces XML parser.
To plug in a different verison of the Xerces parser, follow these steps:
Q. I plugged in a version of Apache Xalan that I downloaded from the Apache Web
site, and now I get errors when I try to transform documents. What is the problem?
A. You must ensure that the version of Apache Xalan you download from the Apache
Web site is compatible with the version of Apache Xerces you are using with
WebLogic Server. This version is either the built-in version of 1.4.4 or one of the
versions listed in the preceding question if you have plugged in your own version of
Xerces.
If the DOCTYPE declaration does not contain a Public ID, but specifies a System ID,
then the document type is the System ID. For example, in the following DOCTYPE
declaration:
<!DOCTYPE mydoc SYSTEM "http://foo.com/url/to/my/dtd">
Note: The System ID is of the DTD, not of the XML document itself. It can,
however, still be used as a way to identify the XML document.
If the XML document does not specify a DOCTYPE declaration, then the document
type can be either the root element name or the namespace URI, if it has one.