Troubleshooting Java Web Applications

WHAT IS JAVA?

Java is a general-purpose, class-based, object-oriented programming language designed for having lesser implementation dependencies. It is a computing platform for application development. Java is fast, secure, and reliable, therefore. It is widely used for developing Java applications in laptops, data centers, game consoles, scientific supercomputers, cell phones, etc.

What is Java Platform?

Java Platform is a collection of programs that help programmers to develop and run Java programming applications efficiently. It includes an execution engine, a compiler, and a set of libraries in it. It is a set of computer software and specifications. James Gosling developed the Java platform at Sun Microsystems, and the Oracle Corporation later acquired it.

WHAT IS A WEB APPLICATION

A web application is application software that runs on a web server, unlike computer-based software programs that are run locally on the operating system of the device. Web applications are accessed by the user through a web browser with an active network connection.

In computer system, a web application is a client-side and server-side software application in which the client runs or request in a web browser. Common web applications include email, online retail sales, online auctions, wikis, instant messaging services and more.

Web applications are programs allowing better communication between businesses and their customers. With the increasing use of the Internet, companies change the way they work and adopt more web applications. Understanding what a web application is can help you realize its importance in our everyday life. 

What are some examples of web applications?

Examples of web applications include webmail, word processors and spreadsheets. Video and photo editing, file conversion, and file scanning are applications too. There are popular email programs like Yahoo and Gmail, and instant messaging services are web applications too.

Web applications allow team members to work together on the same document include Google Docs, Google Slides, Google Sheets and cloud storage. Online sharing of calendars is also a web application.

Web applications evolve to answer the increasing need for mobile web use. Developers create more and more mobile apps that connect to the Internet. An example of this evolution is the Dropbox app or Facebook app you can download and use on your phone or tablet. Other examples are shopping carts, online retail sales, online auctions, wikis and online banking.

Web apps are different than native apps. Native apps are applications developed for a particular platform or specific device. They require installation on that device. Some applications combine the two features. IT specialists call them hybrid applications. Hybrid apps work like web apps, but you install them on your device like a native app. Hybrid apps can also use device-specific resources to their advantage. Native applications can sometimes operate without an internet connection. Web apps and hybrid can’t.

How does a web application work?

All you need to access a web app is an internet connection. You use a web browser like Safari, Mozilla Firefox or Google Chrome to connect to your app. There are three elements the web application requires to function: a web server to handle requests from the client, an application server to execute the tasks requested and a database to store the information.

Developers code web applications in two types of languages. A web application generally uses a combination of server-side script and client-side script to function. The server-side script deals with storing and retrieving the information and requires languages like Python or java Developers program server-side to create scripts the web app will use. The client-side script requires languages like javascript,,cascading style sheets ) and HTML5. These languages rely on the browser to execute the program. They are browser-supported languages. The client-side script deals with the presentation of the information to the user.

Most web apps have short development cycles and can be created by small teams. Some of the apps require server-side processing. They are called “dynamic.” Some don’t need processing at the server-side and are static.

Here is how a web application works:

  1. The user creates a request to the web server over the Internet through the application’s user interface.
  2. The web server sends this request to the web application server.
  3. The web application server executes the requested task, then generates the results of the required data.
  4. The web application server sends those results back to the web server (requested information or processed data).
  5. The web server carries the requested information to the client (tablet, mobile device or desktop).
  6. The requested information appears on the user’s display.

Benefits of web applications

A web application has many benefits, including:

  • You don’t need to install it on the hard drive, so it doesn’t cause space limitations.
  • It requires less support and maintenance from the business and lower technical requirements from the user’s computer.
  • A web application reduces costs for both the end-user and the business.
  • Web applications are always up to date because updates are applied centrally.
  • All users can access the same version so it eliminates any compatibility issues.
  • You can access web applications anywhere with a web browser.
  • As long as the browser is compatible, web applications can run on multiple platforms regardless of the operating system or device.
  • Web applications discharge the developer of the responsibility of building a client that is compatible with a specific type of computer or a particular operating system.
  • Web applications reduce software piracy in subscription-based web applications.

Troubleshooting Java web applications

If you have a problem with a Java web application, you can use the diagnostics provided by CICS and the Liberty profile to determine the cause of the problem.

CICS provides statistics, messages, and tracing to help you diagnose problems related to running Java web applications in a Liberty JVM server. The Liberty profile technology that is used to run web applications also produces diagnostics that are available in zFS.

Procedure

  1. If you are unable to start a Liberty JVM server, check that your set up is correct. Use the CICS messages and any errors in the dfhjvmout and dfhjvmerr files for the JVM to determine what might be causing the problem.
    1. If you receive a CWWK0221E error message in dfhjvmerr, check that you have set the right values for the host name and port number in the JVM profile and server.xml. This error message indicates that the port number or host name that are specified are incorrect. The host name might be invalid or the port number might be in use.
    2. If you receive a CWWKE0045E error message in dfhjvmout, the JVM server was unable to start because of an error in the Liberty configuration. CICS checks if the server.xml file is present when the JVM server starts up. This file is required and must exist in the correct directory. If you have automatic configuration enabled, CICS creates another server configuration. If any of the previous configuration directories exist, CICS is unable to create the configuration and the JVM server fails to start.To fix the problem, restore the server.xml from a back up or recreate server.xml by copying it from the USSHOME/wlp/templates/defaultServer directory. Alternatively, you can delete all of the Liberty directories and use the automatic configuration property in the JVM profile to recreate the directories and files when the JVM server starts up.
    3. Check that the -Dfile.encoding JVM property in the JVM profile specifies either ISO-8859-1 or UTF-8. These are the two code pages that are supported by the Liberty profile server. If you set any other value, the JVM server fails to start.
  2. The Liberty JVM server is scanning the dropins directory too frequently and causing too much I/O and CPU usage. The frequency that the Liberty JVM server scans the dropins directory for applications is configurable. The default interval that is supplied in the configuration templates is 5 seconds, but you can increase this value or disable the application scan.To fix this problem, edit the following XML in the server.xml file:<config monitorInterval="5s" updateTrigger="polled"/> <applicationMonitor updateTrigger="disabled" pollingRate="5s" dropins="dropins" dropinsEnabled="false"/>If you install your web applications in CICS bundles, do not disable polling in the <config> element, but disable the application scan.
  3. You copy a WAR file into the dropins directory but your application is not available. Check the dfhjvmout file for error messages. If you receive the CWWKZ0013E error message, you already have a web application running in the Liberty JVM server with the same name. To fix this problem, change the name of the web application and deploy to the dropins directory.
  4. You have configured security, but the web application is not requesting authentication.
    1. Although you can configure CICS security for web applications, the web application uses security only if it includes a security restraint in the WAR file. Check that a security restraint was defined by the application developer in the web.xml file in the dynamic web project.
    2. Check that the server.xml file contains the correct security configuration information. Any configuration errors are reported in dfhjvmerr and might provide some useful information. If you are using CICS security, check that the CICS security feature is specified and the cicsSecurity.xml file is included. If CICS security is switched off, ensure that you have specified a basic user registry to authenticate application users.
    3. Check that the application has a security definition in the server.xml file. If you are using CICS security, it must use the CICS authenticated role.
  5. The web application is returning an HTTP 403 error code in the web browser. If you receive a HTTP 403 authorization failure, either your user ID is revoked or you are not authorized to run the application transaction.
    1. Check the CICS message log for the error message ICH408I to see what type of authorization failure occurred. To fix the problem, make sure that the user ID has a valid password and is authorized to run the transaction.
    2. If the application is retuning an exception for the class com.ibm.ws.webcontainer.util.Base64Decode, check dfhjvmerr for error messages. If you see configuration error messages, for example CWWKS4106E or CWWKS4000E, the server is trying to access configuration files that were created in a different encoding. This type of configuration error can occur when you change the Dfile.encoding value and restart the JVM server. To fix the problem, you can either revert to the previous encoding and restart the JVM server, or delete the configuration files. The JVM server recreates the files in the correct file encoding when it starts.
  6. The web application is returning a HTTP 500 error in the web browser. If you receive a HTTP 500 error, a configuration error has occurred.
    1. Check the CICS message log for DFHSJ messages which might give you more information about the specific cause of the error.
    2. If you are using a URIMAP to run application requests on a specific transaction, make sure the URIMAP is using the correct transaction.
    3. If the URIMAP is using the correct transaction, make sure that the SCHEME and USAGE attributes are set correctly. The SCHEME must match the application request, either HTTP or HTTPS. The USAGE attribute must be set to JVMSERVER.
  7. The web application is returning a HTTP 503 error in the web browser. If you receive a HTTP 503 error, the application is not available.
    1. Check the CICS message log for DFHSJ messages for additional information.
    2. Make sure that the TRANSACTION and URIMAP resources for the application are enabled. If these resources are packaged as part of the application in a CICS bundle, you can check the status of the BUNDLE resource.
    3. The request might have been purged before it completed. The errors messages in the log describe why the request was purged.
  8. The web application is returning exceptions in the web browser; for example the application is retuning an exception for the class com.ibm.ws.webcontainer.util.Base64Decode.
    1. Check the dfhjvmerr for error messages.
    2. If you see configuration error messages, for example CWWKS4106E or CWWKS4000E, the server is trying to access configuration files that were created in a different encoding. This type of configuration error can occur when you change the Dfile.encoding value and restart the JVM server. To fix the problem, you can either revert to the previous encoding and restart the JVM server, or delete the configuration files. The JVM server recreates the files in the correct file encoding when it starts.

Drop your comment

Related Post

Leave a Reply

Your email address will not be published.