Oracle Weblogic Server tutorial
You, Will, Learn in Weblogic Tutorial
1. Question: Why is There No Polymorphic-Type Response From a Create() or Find() Method?
Answer: The EJB Specification prohibits this behavior and the WebLogic.appc compiler checks for this behavior and prohibits any polymorphic type of response from a create() or find() method.
The reason they 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.
2. Question: Can I Generate Deployment Descriptor Files Automatically?
Answer: Yes, WebLogic Builder automatically generates deployment descriptor files for your J2EE applications.
3. Question: Why Do I Get an Error If I Attempt to Start the MedRec Server on a System That Uses a Proxy to connect to the Internet?
Answer: The MedRec Server uses the Struts framework and its attempts to access jakarta.apache.org on startup result in error messages. The server starts up successfully, but with error messages. Adding the following options to MedRec Server’s start script resolves the issue:
-Dhttps.proxyHost=Your Proxy Host
4. Question: Why Do I Have Trouble Targeting a PointBase Connection Pool to a Remote Server?
Answer: Open the commEnv.cmd or .sh file in WL_HOME\common\bin and edit the POINTBASE_CLASSPATH entry by removing the bolded section of the entry shown below:
5. Question: What Should I Do If My Cluster “hangs” or “freezes”?
Answer: If your WebLogic Server cluster “freezes,” you will need to collect certain diagnostic information, including thread dumps and Java garbage collection metrics, before contacting BEA Technical Support.
6. Question: What’s Causing ClassFormatErrors With My Applet?
Answer: There are several problems with your setup.
The most obvious has to do with your CODEBASE:
The CODEBASE tag in your applet should point to your HTTP server, not to WebLogic Server.
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.
In addition, if you are getting a ClassFormatError, it signals a problem with your HTTP server configuration. It could be that you haven’t loaded the WebLogic or applet classes in the correct directory on the HTTP server, or you are specifying the CODEBASE or the CODE incorrectly in your APPLET tag.
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.
7. Question: Why Does My Applet Work With Appletviewer, But Not With a Browser?
Answer: 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.
8. Question: Can I Use a “native” Two-Tier Driver For a Browser Applet?
Answer: No. Within an unsigned applet, you cannot load native libraries over the wire, access the local file system, or connect to any host except the host from which you loaded the applet. The applet security manager enforces these restrictions on applets as protection against applets being able to do unsavory things to unsuspecting users.
If you are trying to use the driver for Oracle from an applet, then you are violating the first restriction. Your applet will fail when it attempts to load the native (non-Java layer) library that allows drivers for Oracle to make calls into the non-Java Oracle 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 driver for Oracle (or any other two-tier JDBC driver) for the connection between the WebLogic Server and the DBMS.
9. Question: How Do You Set the Classpath?
Answer: 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 Administration Console Online Help. 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.
Compiling Application Classes or Using WebLogic Server Utilities. See Setting the Classpath for Compiling in the Developing WebLogic Server Components section of Developing WebLogic Server Applications.
Working With WebLogic Server Code Examples. See the WebLogic Server Examples Guide located at samples/server/examples/src/examples/examples.html in your WebLogic Server distribution.
10. Question: What is the Difference Between T3 and HTTP Protocol?
Answer: WebLogic uses the T3 protocols for internal and external connections to the servers. The T3 protocol often is used in WebLogic’s implementation of RMI. Proprietary of WebLogic Server.
Http protocols are used primarily for HTTP communication between the browser and the webserver. Standard follows the W3C (World Wide Web Consortium).
Note: All of these protocols are, by default, multiplexed over the same connection to the server’s address and port. So you can access a web page hosted by the server using a URL such as https://host:port/page.jsp. An external client can set up an initial JNDI context to a server using the URL t3://host: port/. All that has changed is the protocol over which the client must communicate with the server.
11. Question: How Do You Do Performance Tuning of WLS?
Answer: It can be categorized into 4 parts. (How Do You Do Performance Tuning of WLS)
1. Application Tuning
JSP precompilation, EJB pool size cache…
2. OS Tuning
Setting TCP ip parameter.
3. Core Server Tuning.
tune work manager, tune chuck size and chunk pool size, using performance packs, connection backlog buffering.
4. JVM Tuning
tuning the GC strategy, monitoring garbage collection..
12. Question: How to Troubleshoot and Overcome Such Issues?
- Gather memory data by enabling GC verbose.
- If its due to Http Session, timing out https session after certain intervals might help.
- Look into the code for (Company) JDBC connection handling.
- Optimizing the heap size according to the load.
13. Question: What Can Be the Reasons for Server Hang?
Answer: Memory leak, database query taking a long time to return, Deadlock.
14. Question: How Do You Troubleshoot Server Hang?
We can use java WebLogic.Admin PING to check if we get a normal response. (E learning)
We need to take multiple threads dumps with kill -3 PID on Unix and CTLR Break on Windows.
Analyze the thread dump to find the root cause.
15. Question: How Do You Troubleshoot a Crash?
1. JVM crash generates a hs_err_pid file. We need to look into the stack trace of the hs_err_pid file.
2. If the thread is from a native io, we need to disable native io.
3. if the stack trace is from the driver, we need to get in touch with the drive team.
4. Quite possibly its a problem with the driver.
Changing the type of driver can be a workaround.
5. If the thread shows it coming from an optimized code, we can turn off optimization.
6. If the stack is from native calls of application, its a bug with the application and it has to b modified.
16. Question: How Can the Issue Associated With High CPU Usage Be Solved?
Answer: In windows platform, the issue of CPU high usage can easily be solved by making use of pslist and also with the process explorer to observe the function performed by the thread or the process.
17. Question: When Can High Usage of CPU Occur?
Answer: This is the condition that usually occurs when a single thread or process makes use of a larger portion of the CPU in an unexpected manner.
18. Question: How Can the OUT OF MEMORY Be Solved?
Answer: There is a possibility for collecting the memory data after enabling GC – verbose. If the condition has aroused because of the HTTP session, then it will be automatically solved when the session gets time out. You should also verify the code associated with the handling of JDBC connectivity. You should also optimize the size of the heap by considering the load.
19. Question: What Causes the Condition OUT OF MEMORY?
Answer: There are various reasons that can lead to this condition and they are
- The insufficient size of the heap compared to the extra load.
- Placing of the objects takes Longer period of time like that of HTTP sessions.
- The occurrence of memory leak inside the application code.
- The prevention of the occurrence of full GC because of JVM bug.
20. Question: Explain the Reasons For Server Hang?
Answer: The major reasons that lead to the server hang are a memory leak, deadlock, and a long time for returning.
21. Question: How Can You Solve the Issue of Server Crash?
Answer: A crash associated with JVM is capable of generating a hs_err_pid file. You need to refer to this file for finding out the root cause of such a crash. In the case of native IO being the origin of thread, you need to disable it. If the origin of the problem is from the driver, need to contact the driver team.
22. Question: What are the Causes For Server Crash?
Answer: The major reasons for the occurrence of server crash are the native IO, JVM, supported configuration, JDBC driver issues, and SSL native libraries.
23. Question: How Can You Differentiate Server Crash and Server Hang?
Answer: With a server crash, there is no existence for the Java process and if it is a server hang, then the Java process stops responding.
24. Question: How Clients Handle the DNS – Requests to the Failed Servers?
Answer: Bandwidth gets wasted in the case of continues DNS requests to that of the unavailable machine at the time of server failure. This problem usually occurs during the time of startup associated with the application that of the client-side. The unavailable servers are removed by searching DNS entries provided by the WebLogic Server. This removal prevents clients from accessing failed servers. A third-party load – balancers are made used for avoiding unnecessary DNS requests. Some of the third party load – balancers are BigIP, resonate, local director and Alteon. The main function of these third-party loads – balancers is to mask multiple addresses of DNS into a single one.
25. Question: How Can Default JVM Be Changed to Other?
Answer: For changing the JVM can be done by following the steps below.
- You should first set the JAVA_HOME in the start script of the server.
- Change the config.xml of the domain for using the JRockit javac.exe
- Remove any kind of switches specific to Sun JVM from start scripts of the server.
26. Question: How Do I Use Resource References With Foreign JMS Providers?
Answer: To enable resource references to reference remote JMS providers, they must be used in conjunction with a foreign JMS definition. This is because resource references do not provide a place to specify a URL or initial context factory.
27. Question: What are the Differences Between Work Manager and Execute Queue?
Answer: Execute Queues are available till WLS 8.1 and Work-managers are available from WLS 9.2
and the main difference between these two is Workmanagers are self tuned, which means it will shrink and increase whenever it requires rather than fixed to the maximum number of threads thereby causing some issues on high load.
Understanding the Differences Between Work Managers and Execute Queues:
The easiest way to conceptually visualize the difference between the execute queues of previous releases with work managers is to correlate execute queues (or rather, execute-queue managers) with work managers and decouple the one-to-one relationship between executing queues and thread-pools. For releases prior to WebLogic Server 9.0, incoming requests are put into a default execute queue or a user-defined execute queue. Each execute queue has an associated execute queue manager that controls an exclusive, dedicated thread-pool with a fixed number of threads in it. Requests are added to the queue on a first-come-first-served basis. The execute-queue manager then picks the first request from the queue and an available thread from the associated thread-pool and dispatches the request to be executed by that thread.
For releases of WebLogic Server 9.0 and higher, there is a single priority-based execute queue in the server. Incoming requests are assigned an internal priority based on the configuration of work managers you create to manage the work performed by your applications. The server increases or decreases threads available for the execute queue depending on the demand from the various work-managers. The position of a request in the execute queue is determined by its internal priority:
The higher the priority, the closer it is placed to the head of the execute queue.
The closer to the head of the queue, the more quickly the request will be dispatched a thread to use.
Work managers provide you the ability to better control thread utilization (server performance) than execute-queues, primarily due to the many ways that you can specify scheduling guidelines for the priority-based thread pool. These scheduling guidelines can be set either as numeric values or as the capacity of a server-managed resource, like a JDBC connection pool.
28. Question: How to Test the Port is Existing or Not in Unix?
Answer: It is important you verify which ports are listening on the server’s network interfaces. You need to pay attention to open ports to detect an intrusion. Apart from an intrusion, for troubleshooting purposes, it may be necessary to check if a port is already in use by a different application on your servers. For example, you may install Apache and Nginx servers on the same system. So it is necessary to know if Apache or Nginx is using TCP port # 80/443. This quick tutorial provides steps to use the netstat, Nmap and lsof command to check the ports in use and view the application that is utilizing the port.
1. Open a terminal application i.e. shell prompt.
2. Run any one of the following commands:
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpa | grep LISTEN
sudo nmap -Stu -O IP-address-Here
29. Question: How to Get Thread Dump and What the Purpose of Stuck Thread?
Answer: A Java thread dump is a snapshot of what every thread in the JVM is doing at a particular point in time. Each thread in the JVM is listed with its name and id, it’s the current state and the Java call stack showing what monitor it has locked or is waiting on. This is especially useful if your Java application sometimes seems to hang when running under load, as an analysis of the dump will show where the threads are stuck, either by deadlock or other thread contention.
Unix: On most flavors of Unix kill -3 will generate a thread dump. To get the java process pid use ps -ef | grep java. The dump is directed to stdout so redirecting to a file is necessary. Since 1.6 the Sun/Oracle JDK and OpenJDK has the jstack utility to do the same thing, run it from the command line and redirect to a file.
Windows: If the application was started from a command window you can select the window and use CTRL+Breakbut the output will likely overflow the window. Jstack is available if you’re using the Sun/Oracle JDK and OpenJDK. Otherwise, use PsExec.exe to execute SendSignal.exe. Also, if Tomcat is started as a service it is necessary to use SendSignal.
30. Question: What are the Different States of Server Lifecycle?
Answer: When you launch an instance in the Cloud, a server will progress through various states. Each cloud defines and describes server states in different ways. To be consistent, RightScale has defined our own class of server states that’s generic across all clouds. (What are the Different States of Server Lifecycle)
The time that is required to complete the launch/terminate process varies across clouds. When launching instances, RightScale can only control the actual configuration process, but not the instantiation times for each cloud. Typically, we’ve observed launch times on EC2 to be around 5-10 minutes.
A server is said to be in the shutdown state when it is not running. When a server is in the shutdown state, the only thing you can do is start it.
A server is said to be in the starting state when it has been started from the command line or by a Node Manager. When in this state, the server contacts the Administration Server, retrieves its configuration information, starts all services, deploys all applications, and finally executes any startup classes.
A server is capable of moving into the standby state if an administration port has been configured. Otherwise, the server will move directly from the starting state to the running state. When a server is in the standby state, all services are initialized and all application gets deployed. With the exception of the administration port, however, all ports are closed. Therefore, the server is said to be on hot standby and ready to go.
When a server is in the running state, it is fully operational and participating as a regular member of a WebLogic domain.
A server is moved into the suspending state during a graceful shutdown. This allows the server to complete any processing it may be working on to enable a clean shutdown without loss of any important state information. This state will be skipped during a forced shutdown.
A server will be moved into the shutting down state after it receives a shutdown command. If the server is in the running or standby state when the shutdown command is received, it shuts down gracefully, terminating all services and executing any configured shutdown classes.
A server is moved into the failed state when the health monitoring service determines that a critical service is not functioning properly during its life cycle. Once a server is put into the failed state, it can only be shut down. If you have enabled health monitoring, the Node Manager can automatically shut down and restart the server if it fails.
A server is said to be in the unknown state if it cannot be contacted.
31. Question: How to Find Network Outages in Environment?
Answer: In today’s technological age, it’s more evident than ever that profit is tied to network infrastructure. Financial institutions, for example, rely on having a sound infrastructure that keeps up with real-time market activity. If that infrastructure fails during a trade or transaction, the company could potentially lose millions of dollars. While some larger institutions may be able to lose a deal or two and still function, the smaller businesses simply cannot afford to take the potentially devastating risk that comes from unexpected network outages.
Proactively monitoring your network is the best way to prevent network outages and unplanned downtime. But before you can prevent these devastating outages, you need to understand what causes them.
32. Question: How to Monitor the Incoming Traffic For Webserver?
Answer: IIS 7 includes two major advances in diagnosing and troubleshooting sites and applications. The first new feature is real-time state information about application pools, worker processes, sites, application domains, and running requests. The second new advantage is the detailed trace events that track a request throughout the complete request-and-response process. To enable the collection of these trace events, IIS 7 can be configured to automatically capture full trace logs, in XML format, for any particular request based on elapsed time or error response codes. Health and Diagnostics include the following features:
- Failed Request Tracing Rules
- Worker Processes
Failed Request Tracing Rules
Failed request tracing rules let you capture an XML-formatted log of a problem when it occurs so that you do not necessarily have to reproduce the problem before you start troubleshooting.
For more information about how to configure failed request tracing rules, see Configuring Tracing for Failed Requests in IIS 7.
In addition to the Windows Server® 2008 system and security logs, you should configure IIS to log site visits. When users access your server that is running IIS 7, IIS logs the information. The logs provide valuable information that you can use to identify any unauthorized attempts to compromise your Web server.
For more information about how to configure logging, see Configuring Logging in IIS 7.
The worker processes feature lets you monitor sites, application pools, server worker processes, application domains, and requests.
For more information about worker processes, see Monitoring Worker Processes and Currently Executing Requests in IIS 7.
33. Question: What Happens If We Delete the Log Files When the Server is Running & When the Server is Not Running?
Answer: Better option is to NULLify the content of the log after archiving the logs. Nothing happens when we delete a WebLogic server log files, When the server is RUNNING, new logs will be generated w.r.t Server instance and application logs depends on log4j.properties.
New loggging will be written if the file exists. It will always do appending to the log file. If the file is removed then no appending happens. So that you don’t know what is happening to the Server instance. The other case, When NOT RUNNING not new log generated.
34. Question: What Technologies are Included in J2EE?
Answer: EJB technology is the core of J2EE. It enables developers to write reusable and portable server-side business logic for the J2EE platform.
35. Question: How to Check Port Number?
Answer: Computers and applications connect to remote hosts using IP addresses and port numbers. Every computer connected to a network has an IP address, and data is transmitted from one computer to another through channels, or ports, which are assigned certain numbers. A computer’s IP address is analogous to your main office telephone number, while the port represents your extension. Some applications require communication on specific ports, so you may need to verify that a certain port is open on your computer. You can do this by first determining your IP address and then running the “netstat” command-line utility to discover all open ports on the computer.
36. Question: Explain How to Create Pooling in Tomcat?
Answer: The following are the steps to create Pooling in tomcat:
Download 3 jar files
Add an entry in server.xml of the tomcat factory
org.apache.commons.dbcp.BasicDataSourceFactory driverClassName oracle.jdbc. OracleDriver URL JDBC:oracle:thin:@localhost:1521:orcl username visit password vst2wrd maxActive 20 maxIdle 10 maxWait -1
37. Question: Why Can’t I Use Keytool to Import a Digital Certificate Into the Identity Keystore?
Answer: When using the keytool utility to create a Certificate Signing Request (CSR), a self-signed digital certificate is placed in the identity Keystore. On occasion, a problem will occur when using the keytool commands to replace the self-signed digital certificate in the Keystore with a signed digital certificate received from a trusted CA. Use the keytool utility to import the trusted CA certificate into the Keystore before importing the signed digital certificate into the Keystore. The steps are as follows:
(Why Can’t I Use Keytool to Import a Digital Certificate Into the Identity Keystore)
1. Obtain a trusted CA certificate.
2. Use the der2pem utility to convert the trusted CA certificate to a PEM file.
3. Use the keytool utility to create an identity Keystore. For example:
keytool -genkey -alias subject key -key pass key password -Keystore nameofkeystore -storepass keystorepassphrase
4. Use keytool certreq command to create a CSR and submit the CSR to a certificate authority. For example:
keytool -certreq -alias subject key -keypass key password Keystore nameofkeystore -storepass keystorepassphrase -file my certificate.cer.
5. Use the key to Ol import command to import the PEM file for the trusted CA into the Keystore.
6. Use the key to Ol import command with the -trustcacerts option to import the signed digital certificate from the certificate authority into the Keystore.
38. Question: How Can I Speed Up Connection Responses?
Answer: Connection delays are often caused by DNS problems. WebLogic performs a reverse lookup on the hostname from which a new connection is made. If the DNS reverse lookup is not working properly because the connection is coming from a proxy server, it could be responsible for the delay. You might want to work with your system administrator to determine whether DNS and the third-party networking software are working properly. Try writing a simple server program that performs a reverse lookup on any connection made to it. If that lookup is delayed, then you know that the proxy server is the source of the problem.
39. Question: What Should I Do If My Server “hangs” or “freezes”?
Answer: If your WebLogic Server “freezes,” you will need to collect certain diagnostic information, including thread dumps and Java garbage collection metrics, before contacting BEA Technical Support.
40. Question: What is Expected in the wlproxy.log?
Answer: Every request looks like the following:
New Request: [GET / HTTP/1.1]
PathTrim, DefaultFileName, and PathPrepend will be performed in order. The final request will be logged as the following: “Fri Jun 22 14:24:40 2001 The request string is ‘/index.jsp’”
(What is Expected in the wlproxy.log)
Looking for session information and determining the primary:
“Fri Jun 22 14:24:40 2001 Initializing lastIndex=0 for a list of length=1 Fri Jun 22 14:24:40 2001 create a new server node: id=’qa89:443′ server_name=’mint.beasys.com’, port=’18080′”
Init SSL if SecureProxy is set to ON:
“Fri Jun 22 14:24:40 2001 INFO: SSL is configured Fri Jun 22 14:24:40 2001 INFO: Initializing SSL library Fri Jun 22 14:24:40 2001 Loaded 1 trusted CA’s Fri Jun 22 14:24:40 2001 INFO: Successfully initialized SSL Fri Jun 22 14:24:40 2001 INFO: SSL configured successfully”
Initial connection being made:
“Fri Jun 22 14:24:40 2001 general list: trying connect to ‘172.17.9.180’/443 Fri Jun 22 14:24:40 2001 Connected to 172.17.9.180:443”
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 obtained from WebLogic Server:
“Fri Jun 22 14:24:46 2001 Hdrs from WLS:[Set-Cookie]=[JSESSIONID=OzI19WqYmFnRviHEu5gKLvot42ABeD8NPWnF0jW6cawSGcrp2mru!4038528127411848936!-1408169548!80!443; path=/] Fri Jun 22 14:24:46 2001 parsed all headers OK”
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″
41. Question: How Does the Apache HTTP Server Plug-In Work?
Answer: The Apache HTTP Server Plug-In allows requests to be proxied from an Apache HTTP Server to WebLogic Server. The plug-in enhances an Apache installation by allowing WebLogic Server to handle requests that require the dynamic functionality of WebLogic Server.
The plug-in is intended for use in an environment where an Apache Server serves static pages, and another part of the document tree (dynamic pages best generated by HTTP Servlets or JavaServer Pages) is delegated to WebLogic Server, which may be operating in a different process, possibly on a different host. To the end-user—the browser—the HTTP requests delegated to WebLogic Server still appear to be coming from the same source.
HTTP-tunneling, a technique that allows HTTP requests and responses access through a company’s firewall, can also operate through the plug-in, providing non-browser clients access to WebLogic Server services.
The Apache HTTP Server Plug-In operates as an Apache module within an Apache HTTP Server. An Apache module is loaded by Apache Server at startup, and then certain HTTP requests are delegated to it. Apache modules are similar to HTTP servlets, except that an Apache module is written in code native to the platform.
42. Question: Can I Use the Oracle Thin Driver as an XA Driver in Distributed Transactions?
Answer: Oracle 8.1.7 thin driver has threading problems, so BEA developed the following workaround: We use a dedicated XA connection for the duration of prepare, commit, and rollback operation. This is different from the default XA connection management model in that any XAResource object is used to commit any number of transactions in parallel. This limits the number of concurrent commits to the max capacity of the XA connection pool.
Note that this workaround is an Oracle-specific workaround and will not affect the usage of other XA drivers.
43. Question: How Do XA and Non-XA Drivers Differ in Distributed Transactions?
Answer: The differences between XA and non-XA JDBC drivers are:
Atomicity Guarantee. An XA driver implements the XAResource interface and can participate fully in the 2PC protocol driven by the WLS Transaction Manager. This guarantees the atomicity of updates across multiple participating resources.
However, a non-XA driver does not implement the XAResource interface and cannot fully participate in the 2PC protocol. When using a non-XA driver in a distributed transaction, WLS implements the XAResource wrapper on behalf of the non-XA driver. If the data source property enableTwoPhaseCommit is set to true, then the WLS XAResource wrapper returns XA_OK when the Transaction Manager invokes the prepare() method. When the Transaction Manager invokes commit() or rollback() during the second phase, the WLS XAResource wrapper delegates the commit() or rollback() call to the non-XA JDBC connection. Any failure during commit() or rollback() results in heuristic exceptions. Application data may be left in an inconsistent state as a result of the heuristic failure.
Redirecting Connections. A non-XA driver can be configured to perform updates in the same distributed transaction from more than one process, as explained in Can I use a non-XA driver in distributed transactions?. WLS internally redirects the JDBC calls made from different processes to the same physical JDBC connection in one process. However, when you use a XA driver, no such redirection will be done. Each process will use its own local XA database connection, and the database ensures that all the distributed updates made in the same distributed transaction from different processes will be committed atomically.
Connection Management. Whether you are using the non-XA driver or XA driver in distributed transactions, WLS implements JDBC wrappers that intercept all the JDBC calls and obtains a physical JDBC connection from the connection pool on demand.
- When you use a non-XA driver in distributed transactions, in order to ensure that updates made from different processes are committed atomically, WLS associates the same physical JDBC connection with the distributed transaction until it is committed or rolled back. As a result, the number of active distributed transactions using the non-XA connection pool is limited by the maximum capacity of the JDBC connection pool.
- When you use an XA driver, the connection management is more scalable. WLS does not hold on to the same physical XA connection until the transaction is committed or rolled back. In fact, in most cases, the XA connection as only held for the duration of a method invocation. WLS JDBC wrappers intercept all JDBC calls and enlist the XAResource associated with the XA connection on demand. When the method invocation returns to the caller, or when it makes another call to another server, WLS delists the XAResource associated with the XA connection.
- WLS also returns the XA connection to the connection pool on delisting if there are no open result sets. Also, during commit processing, any XAResource object can be used to commit any number of distributed transactions in parallel. As a result, neither the number of active distributed transactions using the XA connection pool nor the number of concurrent commit/rollbacks is limited by the maximum capacity of the connection pool. Only the number of concurrent database access connections is limited by the maximum capacity of the connection pool.
44. Question: Can the Messaging Bridge Use Distributed Destinations as Source and Target Destinations?
Answer: Yes, the messaging bridge can send to and receive from distributed destinations. Bea recommends the following configurations:
- If the source is a distributed destination, the bridge is pinned to one of the members when it connects to the destination. It stays connected only to that member until it reconnects. This means that the bridge will not receive messages from the other members of the distributed destination. Therefore, the best practice is to configure one bridge for each member of distributed destinations using the member’s JNDI name.
- If the target is a distributed destination, the best practice is to send to the distributed destination using the distributed destination’s JNDIName and disable server affinity. This allows the distributed destination to load balance incoming messages.
45. Question: Is There Another Way to Monitor the Messaging Bridge Without Using the Administration Console?
Answer: Yes, there is a run-time MBean (MessagingBridgeRuntimeMBean) for each bridge instance. WebLogic Server run-time MBeans provide a snapshot of information about domain resources. When a particular resource in the domain (such as a messaging bridge) is instantiated, an MBean instance is created which collects information about that resource.
The MessagingBridgeRuntimeMBean has a getState() method that currently returns a String (“Active” or “Inactive”) and a getDescription() method, which returns a String with more detailed information. The name of a bridge runtime MBean consists of the WebLogic Server instance name and the bridge name. If a bridge named my bridge, runs on WebLogic Server instance named my server, the bridge runtime MBean will be named myserver.bridge.mybridge.
For more information about using run-time Mbean management commands, see “WebLogic Server Command-Line Interface Reference” in the Administration Guide. For more information about programming MBean monitoring notifications, see “Using WebLogic Server MBean Notifications and Monitors” in Programming WebLogic JMX Services.
46. Question: What are Pending Messages in the Console?
Answer: Pending means, the message could have been:
- sent in a transaction but not committed.
- received and not acknowledged.
- received and not committed.
- subject to a redelivery delay (as of WebLogic JMS 6.
- subject to delivery time (as of WebLogic JMS 6.1 or later).
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 rollback only followed by an actual rollback.
Current implies messages that are not pending.
Total implies total since the server last started. The byte counts only consider the payload of messages which includes the properties and the body but not the header.
47. Question: When Should I Use Multicast Subscribers?
Answer: Multicasting enables the delivery of messages to a select group of hosts that subsequently forwards the messages to multicast subscribers. The benefits of multicasting include:
- Near real-time delivery of messages to the host group.
- High scalability due to the reduction in the number of resources required by the JMS server to deliver messages to multicast subscribers.
Note: Multicasting is only supported for the Pub/sub messaging model.
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.
48. Question: How Do I Manage a Queue to View and Delete Specific Messages?
Answer: Write a program that uses a QueueBrowser. Then delete specific messages by using a QueueReceiver with a selector with the message identifier, as shown in the following example:
String selector = “JMSMessageID = ‘” + message.getMessageID() + “‘”;
Keep in mind that the queue browser is not a “live” view of the queue. It is a snap-shot.
49. Question: How Do I Get a Thread Dump to Help Track Down a Problem?
Answer: Ways to get a thread dump:
- Try running this from the command line (after running the setEnv script in WL_HOME\server\bin):
java Weblogic.Admin -URL t3://localhost:7001 THREAD_DUMP
- On Windows, from the console window, enter Ctrl+Break.
(Is WL JMS XAResource Compliant)
- On UNIX, signal the server using kill -3.
50. Question: How Does an Application Know if an Application Server Goes Down?
Answer: There are two exception listeners that you can register. Sun Microsystems’ JMS specification defines Connection.setExceptionListener that tells you if there is a problem with the connection. That means that all consumers under that connection are also in trouble. The reason you will get the connection exception is that the WebLogic server you connect to on the other side is dead or not responding or someone killed your connection via the MBean interface.
However, for WebLogic Server JMS, you may have multiple sessions in a connection, with the sessions going to multiple backend servers. WebLogic Server has an extension for this called WLSession.setExceptionListener that tells you if there is a problem with a session.
What is Oracle WebLogic Server Course?
Oracle weblogic server training, the leading Eclipse-based IDE for developing Oracle WebLogic Server applications, Oracle JDeveloper, the strategic IDE for Oracle Fusion Middleware application development; Oracle NetBeans, the open source IDE supporting the latest Java EE APIs. Oracle Application Development Framework – an MVC-based runtime framework for building applications with Oracle JDeveloper or Oracle Enterprise Pack for Eclipse that run on Oracle WebLogic Server. Oracle weblogic server 12c administration training including license rights to Oracle Containers for Java (OC4J) and related component technologies such as Oracle Forms and Reports. Oracle WebLogic online training licenses can be extended with additional licenses for the Oracle Coherence Grid Edition Option, and Oracle Enterprise Manager Management Packs – Oracle WebLogic Server Management Pack Enterprise Edition and the Cloud Management Pack for Oracle Fusion Middleware. For detailed licensing information on Oracle WebLogic Suite, refer to the Oracle weblogic server training. Note that some of the individual product components licensed and included in Oracle WebLogic Suite 12.1.2 are physically packaged and delivered in separate installation programs to align with typical usage.
Oracle WebLogic Server Course Overview
For example, the key Java application infrastructure technologies are Oracle WebLogic Server (including Oracle TopLink). Oracle Coherence is packaged in the same installation program and is installed on the JDK installation that you have created on your systems. Web Tier technologies are packaged separately and typically installed on separate systems. For detailed installation instructions on Oracle WebLogic Suite product components refer to the Oracle weblogic server 12c administration training. In this deployment topology, there are clients, including browser clients, native mobile clients, or Oracle WebLogic Server Java clients accessing applications deployed on Oracle WebLogic admin online training server. Typically these clients connect to Oracle WebLogic Server managed servers and clusters through web server proxies hosted on a separate set of web server systems, denoted as the Web Tier above. Oracle weblogic server 12c administration training runs in the web servers forward client requests to Oracle WebLogic Server applications running in the WebLogic tier of the topology above. These applications typically access and update data stored in a database, usually an Oracle Database, but other third-party databases are supported as well.
Job Opportunities on Oracle WebLogic Server
Application data being used for application processing is stored in memory in the WebLogic tier in the form of Java objects. In order to achieve better performance and scalability of data-intensive applications, it is often beneficial to move in-memory application data from Oracle WebLogic Server, into a separate Oracle Coherence data grid tier, to provide distributed caching, event, analytics and compute processing services to Online Oracle WebLogic Server Training applications. Both Oracle WebLogic Server and Oracle Coherence have unique capabilities to integrate effectively with the database tier, especially with Oracle Database and Oracle Database Real Application Clusters. This high-level summary omits the more detailed capabilities of the infrastructure, including the security and load balancing functionality provided by the Web Tier, the development, management, performance and reliability features in the WebLogic Tier, and the massive scaling with built-in reliability and failover offered in the Coherence Tier. These capabilities are described in more detail throughout this Oracle weblogic server 12c administration training. In summary, we believe that Oracle WebLogic Suite provides the industry’s leading application infrastructure implementation across the web server, application server and data grid tiers.
In Oracle weblogic server training we have taken these capabilities to the next level. Oracle WebLogic Suite 12.1.2 simplifies the implementation of cloud application infrastructures that span the web server, application server and data grid tiers by delivering a modern development platform for productive application development including significant updates to Maven integration, new WebSocket protocol support, and TopLink Data Services for simplifying development of applications that provide RESTful interfaces to enterprise data. By native cloud management capabilities that enable efficient management of cloud infrastructures using consistent, proven tooling across the web server, application server and data grid tiers. Standardization on Oracle weblogic server 12c administration training and OPatch technologies provides a unified installation and patching framework for cloud provisioning. Extensions to the WebLogic Management Framework enable the consistent use of proven WebLogic management capabilities for managing the web server and data grid tiers. And we continue to make enhancements to the WebLogic Management Framework through enhancements such as Elastic JMS. By A mission-critical cloud platform that meets the most demanding requirements for cloud application reliability, availability, scalability and performance across the web server, application server and data grid tiers.
Dynamic Clusters, Oracle Database 12c integration, and Exalogic optimizations are examples of new features we have added to enhance service levels provided to applications. The next sections of this Oracle weblogic server training describe the capabilities of Oracle WebLogic Suite 12.1.2 in each of these areas, highlighting where applicable the new features added in Oracle WebLogic Suite 12.1.2. The Oracle weblogic server training first describes the modern development platform capabilities of Oracle WebLogic Suite, focusing on development of Oracle WebLogic Server applications. The next section of the Oracle weblogic administration training describes the native cloud management capabilities of Oracle WebLogic Suite, again focusing on Oracle WebLogic Server management capabilities, but also describing how these capabilities can be applied to manage the Web Tier and Coherence layers of the typical Oracle WebLogic Suite deployment architecture. The Oracle weblogic server 12c administration training describes the service levels that are provided by the Oracle WebLogic Suite mission-critical cloud platform, and how those service levels are delivered. Oracle has made significant improvements in Oracle WebLogic Suite to provide a modern development platform that simplifies development of applications, including cloud applications, and that makes Oracle weblogic server 12c administration training more productive.