Skip Headers

Oracle® Application Development Framework Development Guidelines Manual 10g Release 2 (10.1.2) Part No. B14362-02 |
| Library | Product | Contents

Previous | Next |

# A Troubleshooting JDeveloper Runtime Issues

This appendix describes common problems that you might encounter when attempting to run applications developed using JDeveloper and explains how to solve them. It contains the following topics:

- Problems and Solutions

- Need More Help?

## A.1 Problems and Solutions

This section describes common problems and solutions. It contains the following topics:

- JSP Page Fails with HTTP 404-Page Not Found Error

- JSP Page Compilation Returns Errors

- Browser Locates JSP File But Fails to Render with Content

- Unable to Run a Large JSP Without Error

- JDeveloper Unable to Establish Connection to Embedded OC4J Server

- Unable to Specify Connection Driver Class to Use with a Web Application in JDeveloper

- Unable to Establish Connection Upon EJB Lookup

### A.1.1 JSP Page Fails with HTTP 404-Page Not Found Error

You have successfully deployed the ADF web application with JSP files in the WAR file, but the browser displays the error `HTTP 404-Page Not Found` when you attempt to run the application.

Problem

The URL of the web page does not match the context root configured for the application server. The context root of the application may differ because JDeveloper has picked up a default that you will have to override. If you deployed the WAR file using Enterprise Manager, then the context root specified by Enterprise Manager is the one picked up by Oracle Application Server.

Solution

Check that the URL for the web page follows this format:

    http://<host>:<http port for iAS>/context-root/<sub-directory structure within public_html>/<the page>.jsp

The context root for the application is available in the `http-web-site.xml` or `default-web-site.xml` file located in `<mypath>``/j2ee/home/config` on the Oracle Application Server installation.

For example, with a context root like `/war1`, the `mod_oc4j.conf` file in the Oracle Application Server installation has the following entry:

    Oc4jMount /war1 home
    Oc4jMount /war1/* home

In other words, the URL you see should have only one context root, followed by any subdirectories.

To modify the context root for your WAR file in JDeveloper:

1. In the navigator, double-click webapp x.deploy and select General in the WAR Deployment Profile Properties dialog.

2. Select Specify J2EE Web Context Root and enter the value in the field.

3. Redeploy the WAR file to the Oracle Application Server installation.

### A.1.2 JSP Page Compilation Returns Errors

When you attempt to compile a JSP that contains a JSTL tag, the compilation fails with the following errors:

`Error(1): "http://java.sun.com/jstl/core" is not a registered TLD namespace`.

`Error(1): Unable to load tag handler class: http://java.sun.com/jstl/core`

Problem

Your project is missing the `standard.jar` file in the `WEB-INF/lib` directory. This may be due to manually inserting a JSTL tag onto a JSP page instead of using the Component Palette, even if you manually included the JSTL library.

Solution

Add the `standard.jar` file to your project's `lib` directory.

To add the file:

1. Open the `<JDEV_HOME>/jakarta-taglibs/jstl-1.0/lib/` directory.

2. Copy the `standard.jar` file.

3. Paste the `standard.jar` file into your project's `.../public_html/WEB-INF/lib/` directory.

4. Compile your JSP page.

### A.1.3 Browser Locates JSP File But Fails to Render with Content

You have successfully deployed the ADF web application with JSP files and the `Struts-Config.xml` file, yet when you attempt to run the application, the page appears empty. Additionally, the URL of the web page is correct and the browser displays no HTTP errors.

Problem

Your web application relies on the Struts controller to forward to a page from a Struts action. Your application implements the Struts action class in order to prepare the data for the page before rendering. You have attempted to run the web page without first executing the appropriate Struts action class.

Solution 1

Do not run the Struts-based web application by supplying the URL of the JSP page. You must run the application by invoking the Struts action. Typically this is accomplished by displaying a web page that contains a link with the name `<action name>``.do`. The extension `.do` redirects the link to the Struts controller, which executes the corresponding action from the `Struts-Config.xml` file. The browser displays the web page mapped to the action in the `Struts-Config.xml` file.

Solution 2

When you want to run your web application within JDeveloper, do not run the JSP directly. While JDeveloper does allow you to choose Run on any JSP file in your Strut-based web application, you must invoke the web page from the `Struts-Config.xml` file. Right-click Struts-Config.xml in the navigator and choose Run corresponding to the desired action. The action you choose will allow the Struts controller to execute a corresponding, mapped JSP file.

### A.1.4 Unable to Run a Large JSP Without Error

When attempting to run a large JSP page, you receive the following error:

`java.lan.VerifyError: "Illegal target of jump or branch`"

Problem

The Sun JDK has a 64k size limitation on the service method of a generated page implementation class. While the size of your JSP page may be less than 64k, the corresponding class file may be larger as its service method contains the generated code from the source JSP page. Therefore, static HTML, static includes, and tag libraries can cause the class file to be large.

Solution

Consider doing the following:

- Split the JSP page into smaller pages. Then use the dynamic include command `(jsp:include)` to insert one JSP page into the other. Its contents will then be displayed at runtime.

- If the JSP page contains static includes, put the static HTML into a separate file. Then use the dynamic include command (`jsp:include`) to insert the file's output at runtime.

- Place any static HTML into a Java resource file. If using the Oracle JSP container, the container does this for you when you enable the JSP `external_resource` configuration parameter. This places all static content of the page into a resource file during translation. For more information about using this parameter, refer to Oracle9i Support for JavaServer Pages Reference, which is part of the Oracle 9i Database documentation set. For pre-translation, the `-extres` option of the `ojspc` command line tool also offers this functionality.

- Move Java code in large scriptlets to JavaBeans.

### A.1.5 JDeveloper Unable to Establish Connection to Embedded OC4J Server

You have created a web application, but the application fails to run when JDeveloper attempts to establish a connection to the embedded OC4J server. The error message you get originates from your proxy server.

Problem

By default, JDeveloper uses the proxy settings from the default browser on the same machine. However, if `localhost` and `127.0.0.1` do not appear in the list of proxy exceptions, and you have not specified these exceptions within JDeveloper, when you attempt to connect to an application server residing on the same machine as JDeveloper, the connection intended for your local machine may actually be opened on the proxy server instead.

For example, if `localhost` is not excluded from the proxy list, a request in your browser like `http://localhost/MyApp/index.html` will be sent to the proxy server, and the server will resolve `localhost` to itself, rather than to your machine. In this case, the error message you see is actually returned by the proxy server rather than by any server running on your local machine.

Solution

If you are connecting to an IP address behind a proxy server, and your machine is also behind the same proxy server, then make sure that JDeveloper's web proxy preferences exclude the IP address you are trying to connect to.

To verify and modify the proxy preferences in JDeveloper:

1. From the Tools menu, choose Preferences and select Proxy Server from the dialog.

2. Be sure that Use HTTP Proxy Server is selected and specify the proxy port and proxy host.

To verify that your proxy settings are being picked up, start JDeveloper and observe the command that the console window displays to start the embedded OC4J server. The command will contain the proxy settings.

### A.1.6 Unable to Specify Connection Driver Class to Use with a Web Application in JDeveloper

You have created a web application and you want to specify custom driver classes (such as `oracle.jdbc.pool.OracleConnectionPooldata source` or `oracle.jdbc.pool.OracleConnectionCacheImpl`) for your data sources, but the default connection details specified by the IDE connections are used instead. You want to be able to specify the class and location parameters in a customized manner that does not rely on IDE connection definitions.

Problem

The `data-sources.xml` file located in your project may be used to run and debug the application in the case of embedded OC4J or to initiate deployment to standalone Oracle Application Server installation. In JDeveloper, the `data-sources.xml` file is overwritten with connections defined in the Connection Manager wizard. The action of overwriting the `data-sources.xml` file always deletes any user-defined data sources; it also defines as data sources all database connections defined in the Connection Manager, whether the application requires them or not.

Note that this problem does not exist at the level of the global application when you want to define custom entries that will apply server-wide. You may edit the global application `data-sources.xml` file located in the OC4J directory `<ORACLE_HOME>/j2ee/config/`. Unlike the project-level `data-sources.xml` file, JDeveloper will not overwrite this file.

Solution for JDeveloper 9.0.4.x and Earlier

Edit the class drivers in the `data-sources.xml` file to specify the custom entries, and set the file to read-only from the Windows Explorer. This will prevent JDeveloper from overwriting the file again. The file has two locations depending upon what you want to control:

- The project-level `data-sources.xml` file is located in `<JDEV_HOME>/mywork/``<project>``/src/META-INF/`. Modify this file when you are ready to deploy the application with your data source definitions.

- The embedded OC4J server–level `data-sources.xml` file is located in `<JDEV_HOME>/system` `XXX``/oc4j-config/`. Modify this file when you want to run the application in JDeveloper using your custom data source definitions.

To add user-defined data sources, specify a `name` attribute in the `<data-source>` element. For example:

    <data-source name="myConnection" ... />

In 9.0.3.x, JDeveloper recognizes `name` attribute values starting with `jdev-connection`: and maps them to connections defined in the Connection Manager.

In 9.0.4, the prefix used by JDeveloper changed to `jdev-connection-`, but JDev 9.0.4 will also recognize `jdev-connection:`, so both prefixes map to Connection Manager connections.

Based on the `name` attribute, three possible behaviors exist:

- If `name` starts with a recognized prefix, then JDeveloper will automatically update the `<data-source>` element with any changes from the Connection Manager.

- If `name` does not start with a recognized prefix, then JDeveloper will not touch the `<data-source>` element. This is the recommended solution when you want to define your own data source connection information.

- If `name` is not specified at all, then JDeveloper will remove the `<data-source>` element.

JDeveloper packages an `orion-application.xml` file, which in turn points to the `data-sources.xml` file in your project.

To ensure that your `data-sources.xml` file is deployed with your project, you must configure the deployment profile for Standard J2EE:

1. In the navigator, double-click Xxx.deploy to display the Deployment Profile Properties dialog.

2. In the dialog, select Platform and set Target Connection to the value <None>.

The OC4J-specific files will no longer be deployed as a part of the archives.

Solution for JDeveloper 9.0.5.x and Later

Starting in JDeveloper 9.0.5.x, you can use the JDeveloper IDE to specify the values for data sources and options for synchronizing these data sources with IDE connection definitions. The `data-sources.xml` file that the IDE will update for you has two locations depending upon what you want to control:

- The project-level `data-sources.xml` file is located in `<JDEV_HOME>``/mywork/``<project>``/src/META-INF/`. Update this file when you are ready to deploy the application with your data source definitions.

  1. In the navigator, right-click data-sources.xml and choose Properties.

  2. In the Data Sources Properties dialog, select Data Sources.

  3. Deselect the option Auto-update data-sources.xml when running or deploying to OC4J.

     This will prevent JDeveloper from overwriting the file again. Alternatively, you can deselect specific options to create, update, or delete definitions in the `data-sources.xml` file based on the IDE connection.

  4. To specify the desired connection driver class, select the desired connection from the Data Sources list on the left.

  5. In the Connection tab, specify the desired classname.

- The embedded OC4J server–level `data-sources.xml` file is located in `<JDEV_HOME>``/system` `XXX``/oc4j-config/`. Update this file when you want to run the application in JDeveloper using your custom data source definitions.

  1. From the Tools menu, choose Embedded OC4J Server Preferences.

  2. In the dialog, select Current Workspaces and Data Sources.

     You must deselect each option to create, update, or delete definitions in the `data-sources.xml` file based on the IDE connection. This will prevent JDeveloper from overwriting the file again.

  3. To specify the desired connection driver class, select the desired connection from the Data Sources list on the left.

  4. In the Connection tab, specify the desired classname.

     JDeveloper packages an `orion-application.xml` file, which in turn points to the `data-sources.xml` file in your project.

To ensure that your `data-sources.xml` file is deployed with your project, you must configure the deployment profile for Standard J2EE:

1. In the navigator, double-click Xxx.deploy to display the Deployment Profile Properties dialog.

2. In the dialog, select Platform and set Target Connection to the value <None>.

The OC4J-specific files will no longer be deployed as a part of the archives.

### A.1.7 Unable to Establish Connection Upon EJB Lookup

You have created a J2EE application that relies on EJB lookup on Oracle Application Server, but the connection fails when you:

- Try to connect to the server using the Create Application Server Connection wizard

- Try to deploy the WAR file to the server using the connection

- Try to run the application and the client attempts to access a component on the server

The error might be `Connection refused: connect` or it might be `java.net.ConnectException: Connection refused: connect Io exception: Connection refused: connect (DESCRIPTION=(TMP=) (VSNNUM=135286784)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))`.

Problem 1

If the problem is not a SQL exception, and the message `Connection refused: connect` is displayed, then it is possible that the OC4J server is listening on a different RMI port. Otherwise, the OC4J container is either not up or it is not listening on the host specified.

Not being able to establish a connection is a common problem on the standalone Oracle Application Server installation because RMI ports are not supplied as defaults but are picked up from a specified range that you configure.

Solution for Embedded OC4J Server in JDeveloper

To obtain and verify the port that JDeveloper is using when you run or deploy your application, view the message log window. One of the first messages to appear should look like this:

`[Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]`

Alternatively, you can check the `rmi.xml` file to ensure that the OC4J server is listening on the same RMI port. You can also check for errors in the `rmi.log` file in `<JDEV_HOME>``/system` `XXX``/oc4j-config/log/`.

To modify the port in JDeveloper versions 9.0.2 through 9.0.4:

1. From the Tools menu, choose Preferences.

2. In the dialog, select Embedded OC4J to make your changes.

To modify the port in JDeveloper 9.0.5.x:

1. From the Tools menu, choose Preferences.

2. In the dialog, select Embedded OC4J Server Preferences.

3. In the dialog, select Global and Startup to make your changes.

The new server port settings will be updated in the `rmi.xml` file located in `<JDEV_HOME>``/system` `XXX``/oc4j-config/`.

Solution for Standalone OC4J on Oracle Application Server

Check the `rmi.xml` file to ensure that the OC4J server is listening on the same RMI port. You can also check for errors in the `rmi.log` file in `<OC4J_HOME>``/j2ee/home/log/`. Edit the server port in the `rmi.xml` file located in `<OC4J_HOME>``/j2ee/home/config/`.

Alternatively, access Enterprise Manager's web site for administering the Oracle Application Server installation (type http://host:port — defaults to 1810). Click the Ports link in the first page for the OC4J instance. Then use the page to check and configure the RMI ports for each of the OC4J instances.

## A.2 Need More Help?

You can find more solutions on Oracle MetaLink, `http://metalink.oracle.com`. If you do not find a solution for your problem, log a service request.

See Also: Oracle JDeveloper Release Notes Oracle Application Server Release Notes Both are available on the Oracle Technology Network: `http://www.oracle.com/technology/documentation/index.html` The JDeveloper Product site on the Oracle Technology Network at `http://www.oracle.com/technology/products/jdev/index.html`