BEA Weblogic

  Home  Applications Programs  BEA Weblogic


“BEA Weblogic Interview Questions and Answers will guide us now that BEA Weblogic is a J2EE Application Server. It is used to host webpages from simple types to secured webpages. Technically, it is where all our JSP's, Servlets, EJB's etc. Are deployed. Advanced concepts like load balancing, clustering etc. Learn more about BEA Weblogic or get preparation for the job of BEA Weblogic with the help of this BEA Weblogic Interview Questions with Answers guide”



140 BEA Weblogic Questions And Answers

1⟩ How do I call Oracle stored procedures that take no parameters?

Here is what we use that works:

CallableStatement cstmt = conn.prepareCall("Begin procName;

END;");

cstmt.execute();

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.

 241 views

2⟩ How do I learn what codesets are available in Oracle?

To find out what codesets you currently have available in Oracle, execute the following SQL query from SQLPlus at the command line:

SQL> SELECT value FROM v$nls_valid_values WHERE parameter='CHARACTERSET';

The response lists of all codesets currently installed on your system. This listing will look something like the following shortened list:

VALUE

---------------

US7ASCII

WE8DEC

WE8HP

US8PC437

WE8EBCDIC37

WE8EBCDIC500

WE8EBCDIC285

...

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';

This would produce the following response if the codeset is installed:

VALUE

-------------------

AL24UTFFSS

You can use Oracle's installation tools to install additional codesets. Contact Oracle for more information.

 254 views

3⟩ What type of object is returned by ResultSet.getObject()?

WebLogic jDriver for Oracle always returns a Java object that preserves the precision of the data retrieved. WebLogic jDriver for Oracle returns the following from the getObject() method:

* For columns of types NUMBER(n) and NUMBER(m,n): a Double is returned if the defined precision of the column can be represented by a Double; otherwise BigDecimal is returned.

* 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.

 236 views

4⟩ How do I prevent errors when running t3dbping?

When you are testing your Oracle database connections under UNIX, you can run SQL*PLUS and can successfully ping the database using utils.dbping. However, when you use the multitier utils.t3dbping utility, you receive an ORA-12154 error message.

First, make sure that your ORACLE_HOME environment variable is correctly set to point to your Oracle installation. This variable must be set in the environment where the WebLogic server is running.

In the C-shell issue the following command:

$ setenv ORACLE_HOME path

where path is the path to your Oracle installation.

In the Bourne shell, issue the following commands:

$ 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.

If you are still experiencing problems, try this:

1. Open a command shell.

2. Run the two-tier version of utils.dbping in this shell.

3. Start WebLogic in this shell from the command line:

$ java -ms32m -mx32m weblogic.server

4. Open a second command shell.

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.

 257 views

5⟩ Are there C/C++ interfaces to WLS JMS?

No, this is not supported.

* Write your own interfaces using JNI.

* Setup a Servlet that your C/C++ client calls to generate a JMS message. You should spawn multiple threads in C++ and use multiple posts to pass messages via http.

 225 views

6⟩ Why am I getting an ORA-01000 maximum open cursors exceeded error, even though I closed all ResultSet, Statement, and Connection objects?

This is an Oracle issue. According to Oracle's documentation, dynamic cursors can remain open from run to run in a session and are not closeable when a procedure closes. To work around this issue, you can increase the number of open cursors allowed in the database or you can reset the connection pool (close and reopen database connections in the connection pool).

To reset the connection pool, you can untarget and retarget the connection pool using the Administration Console. You can also use the reset() method through the JMX API or the RESET_POOL command on the WebLogic Server command line interface.

 261 views

7⟩ Why do I get an error while trying to retrieve the text for ORA-12705?

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.

 258 views

8⟩ Can I enable requests to a JDBC connection pool for a database connection to wait until a connection is available?

No, there's no way to allow a request to wait for a pool connection, and from the system point of view there should not be. Each requests that waits for a connection ties up one of the fixed number of execute threads in the server, which could otherwise be running another server task. Too many waiting requests could tie up all of the execute threads and freeze the server.

 258 views

9⟩ How do I connect to an SQL Server instance that is running on a machine with multiple instances of SQL Server 2000?

Each instance of MS SQL Server must be listening on a different port. So, you can use the port number in the properties that you pass to the getConnection() method or, in case of connection pools, you can specify the port property in the following properties:

server=machineName

port=instancePort

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.

 249 views

10⟩ What causes an OCIW32.dll error?

You may receive the following error message when using your JDBC driver for Oracle: "The ordinal 40 could not be loaded in the dynamic link library OCIW32.dll." This problem is caused by an out-of-date version of OCIW32.DLL in your system directory. Some programs install this file in the system directory in order to run. If you remove this file from the system directory you should no longer receive this error.

What transaction isolation levels does the WebLogic jDriver for Oracle support?

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)

Setting the Isolation_level to 1 in the code that calls the RogueWave JDBCServer class works with the Oracle thin driver but fails with WebLogic jDriver for Oracle.

WebLogic jDriver for Oracle supports the following transaction isolation levels:

SET TRANSACTION ISOLATION LEVEL READ COMMITTED

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE

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.

 265 views

11⟩ 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

When you pass an instance of com.myclientcompany.server.eai.InteractionSpecImpl as an argument to your EJB, the appServer needs to de-serialize (unmarshal) the object under the EJB 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.

 257 views

12⟩ How do I set up my CLASSPATH?

Setting up your CLASSPATH correctly depends on what you are trying to do. The most common tasks are described below:

* Starting WebLogic Server. See Setting the Classpath Option in the Starting and Stopping WebLogic Servers section of the Administration Guide. In addition, your WebLogic distribution includes shell scripts that you can use to start the server. These scripts, which are located in the domain directories under the config directory of your WebLogic Server distribution, automatically set up the CLASSPATH variable in the shell before starting the server.

 237 views

13⟩ How do I increase WebLogic Server memory?

Increase the allocation of Java heap memory for WebLogic Server. (Set the minimum and the maximum to the same size.) Start WebLogic Server with the -ms32m option to increase the allocation, as in this example:

$ java ... -ms32m -mx32m ...

This allocates 32 megabytes of Java heap memory to WebLogic Server, which improves performance and allows WebLogic Server to handle more simultaneous connections. You can increase this value if necessary.

 240 views

14⟩ Java-CORBA integration RMI-IIOP or Java IDL?

It is important to understand the distinction between these two ways of integrating Java with CORBA.

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.

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.

 252 views

15⟩ What is the function of T3 in WebLogic Server?

T3 provides a framework for WebLogic Server messages that support for enhancements. These enhancements include abbreviations and features, such as object replacement, that work in the context of WebLogic Server clusters and HTTP and other product tunneling.

T3 predates Java Object Serialization and RMI, while closely tracking and leveraging these specifications. T3 is a superset of Java Object. Serialization or RMI; anything you can do in Java Object Serialization and RMI can be done over T3.

T3 is mandated between WebLogic Servers and between programmatic clients and a WebLogic Server cluster. HTTP and IIOP are optional protocols that can be used to communicate between other processes and WebLogic Server. It depends on what you want to do. For example, when you want to communicate between

* A browser and WebLogic Server-use HTTP

* An ORB and WebLogic Server-IIOP.

 254 views

16⟩ How do I call a servlet with parameters in the URL?

The usual format of a servlet parameter is a name=value pair that comes after a question-mark (?) at the end of the URL. To access these parameters, call the getParameter() method on the HttpServletRequest object, then write code to test the strings. For example, if your URL parameters are "func=topic," where your URL appears as:

http://www.myserver.com/myservlet?func=topic

then you could parse the parameter as follows, where "req" is the HttpServletRequest object:

String func = req.getParameter("func");

if (func.equalsIgnoreCase("topic")) {

. . . do some work

}

 273 views

17⟩ Which of the statements below is true for a web application using session management?

a.) The session object is invalidated, when the session times out.

b.) The session object is invalidated, when sessionInvalidate() method of HttpSession is invoked.

a. Both of the above statements are true.

b. Only statement a.) is true.

c. Only statement b.) is true.

d. None of the above statements is true.

B is the correct choice. The session object will become invalid in either of the following scenarios:

a.) When the session times out.

b.) When invalidate() method of the HttpSession interface is invoked.

Please note that invalidate() and not sessionInvalidate() is the method of HttpSession interface. Thus choice B is correct.

 272 views

18⟩ Why ca not I boot WebLogic Server when using the LDAP Security Realm?

When using an alternative security realm or a custom security realm in WebLogic Server, you must configure and enable the Caching realm.

When the LDAP server in Microsoft Site Server is installed and the root of the LDAP directory is created, a number of organizational units are created by default. Under Groups there is a default organization unit called NTGroups with a default group called Administrators which is empty. By default, WebLogic Server also provides a Group called Administrators that contains a member System which is the User under which WebLogic Server is started. If you use the defaults in Microsoft Site Server and start creating your own Groups under the default organizational units, WebLogic Server will not start. You need to create your own organizational unit in the LDAP directory and create your Groups under that organizational unit.

If you have two Groups in the LDAP directory with the same name, WebLogic Server cannot properly authenticate the Users in the Groups. The LDAP security realm uses the Group's DN (distinguished name) to locate Groups in the LDAP directory. If you create more than one group with the same name, WebLogic Server only authenticates the Users in the first Group it locates. You must use unique Group names when using the LDAP security realm.

The LDAP realm V2 does not provide the following functionality provided in the LDAP realm V1:

* Listing all Users

* Listing the members of a Group

* The AuthProtocol and User Authentication mechanisms for authenticating the LDAP server.

The LDAP security realm needs to know where the Users and Groups are stored in the LDAP directory used with the security realm. This is done by specifying the distinguished names (DNs) of the LDAP directories containing the Users and Groups.

In LDAP, a DN starts with the leaf node and goes to the root node. The following figure shows a branch of a LDAP directory.

root

|

|

o=acme.com

|

|

ou=Groups

The DN for this branch would be specified as ou=Groups, o=acme.com.

In LDAP realm V1, you specify DNs via the GroupDN and UserDN attributes on the LDAPRealm MBean or through the Administration Console. However, you must reverse the DNs so the example DN would be specified as:

groupDN="o=acme.com, ou=Groups"

In LDAP realm V2, you specify DNs by adding user.dn and group.dn properties to the Configuration attribute of the CustomRealm MBean or through the Administration Console. Unlike LDAP realm V1, you do not have to reverse the DN. For example, the user.dn and group.dn properties for a LDAP realm V2 are specified as follows:

ConfigurationData="..., group.dn=ou=Groups, o=acme.com,..."

In short, the LDAP realm V1 requires reverse DNs and the LDAP realm V2 requires normal DNs.

A common error customers make when switching between LDAP realm V1 and LDAP realm V2 is copying over the reverse DNs thus causing the LDAP realm to stop working. Check your DN specifications when migrating from LDAP realm V1 to LDAP realm V2.

 255 views

19⟩ How do I restrict access to servlets and JSPs?

The Java Servlet API Specification v2.2 allows you to declaratively restrict access to specific Servlets and JSPs using the Web Application Deployment descriptor. Section 13.3.2 of the specification has an example deployment descriptor that uses declarative security. For more information, see Programming WebLogic HTTP Servlets.

 244 views

20⟩ Which XML parser comes with WebLogic Server 6.1?

We bundle a parser, based on Apache's Xerces 1.3.1 parser, in WebLogic Server 6.1. In addition, we include a WebLogic proprietary high-performance non-validating parser that you can use for small to medium sized XML documents. The WebLogic XML Registry allows you to configure the parser you want to use for specific document types.

 252 views