Monday, June 18, 2007

JDeveloper 10.1.3 Deployment to OAS 10.1.2

Well, my last post (xmlns:xsi Strikes Again) is a good example of what happens when you don't follow the documentation.

Once again, when deploying a project developed with JDeveloper 10.1.3 to Oracle Application Server 10.1.2, you must create the following J2EE 1.3-compliant configuration files:

  1. application.xml
  2. web.xml
  3. orion-application.xml
  4. data-sources.xml
  5. oc4J-connectors.xml
Full instructions for deploying from JDeveloper 10.1.3 to OAS 10.1.2 are located in section 22.11 of the Oracle Application Development Framework Developer's Guide and section 34.6.2 of the Oracle Application Development Framework Developer's Guide for Forms/4GL Developers.

Note: Inspect these files after creating them - you may still find the OAS 10.1.2-offending xmlns:xsi attribute in some of them.

Labels: , ,

Saturday, May 05, 2007

#%@$&! data-sources.xml!

After chugging along happily with my project and figuring out how to connect to an Oracle database using the jdbc thin driver from a servlet I ran into yet another JDev 10.1.3 - OAS 10.1.2 gotcha - the data-sources.xml file.

This file contains the jndi database connection info used by an OC4J to connect an application to a backend database. Although the ADF Developer's Guide for Forms/4GL Developers contains instructions for creating OAS 10.1.2 compliant deployment descriptor files, it doesn't mention that when JDev 10.1.3 actually loads data into these files it won't be OAS 10.1.2 compliant.

My project ran great with JDev's 10.1.3 embedded OC4J, but when I tried to deploy it to my OAS 10.1.2 OC4J, I got errors complaining of unrecognized tags in the data-sources.xml file. I searched the J2EE directory in OAS 10.1.2, found a sample data-sources.xml file, and copied what I hoped was the correct information from my JDev 10.1.3-created data-sources.xml file. Long story short: it worked. But what a PITA.

Labels: , ,

Wednesday, May 02, 2007

X509Certificates - Getting Closer

Found a sample Java servlet that reads client certificates. Loaded it into JDev 10.1.3, configured it for OAS 10.1.2, deployed it successfully to a new OC4J container, and connected to it successfully, but it reported that no client certificate was present. This was a head scratcher, so I reviewed the Java API for the X509Certificate class and the HTTPRequest interface, tried a couple of things, didn't get anything to work, and then somehow ended up on the Sun Developer Network, where I found this post: Obtaining an X509Certificate from a Web App. The post mentions adding the directive "Oc4jExtractSSL On" to the Apache mod_oc4j.conf file. Apparently, you have to explicitly tell the Oracle HTTP Server to pass the client certificate to the OC4J. So I tried it - but still not getting the certificate. But I think I'm getting closer - still googling and hopefully I'll have an answer by the end of the day.

Update: Found another missing piece of the puzzle in an OTN post. Enabled the SSLOptions +ExportCert +StdEnvVars directives in ssl.conf, but the servlet is still not getting the certificates. Posted a plea for help in the OTN OC4J/J2EE forum here. Hope I hear from someone soon.

Another Update: I hate the Metalink interface so much I usually leave it as my last resource, but lo and behold I found Note 256244.1 Sample code to read Client Certificate details in a Servlet/JSP. It links to Note 255965.1 Configuration steps to read Client Certificate details from a Servlet/JSP (sorry - Oracle CSI required to access). The configuration steps have added nothing new to what I've already done with mod_oc4j.conf and ssl.conf. But I thought I'd give the sample code a try. Opened a new application in JDev 10.1.3, changed to the 1.4.2 library, created a servlet, copied and pasted the code, no errors, ran it in the embedded OC4J and got the expected result: A web page stating the connection was not made via HTTPS so no certificate data available. Yippee! Created my deployment descriptors and profile, deployed it to an .EAR, copied the .EAR to the applications directory of my configured OC4J, deployed successfully and all I get is a #@!&^! 404 Page Not Found Error.


Slamming head on desk. . .

Labels: , ,

Friday, April 27, 2007

Progress - Sort Of

Found some more information on configuring JDeveloper 10.1.3 to build applications that can run on OAS 10.1.2. I had to install the JDev 10.1.3 ADF runtime library on the OAS (instructions in Section 22-12 of the Oracle® Application Development Framework Developer's Guide (10.1.3). Then I found additional steps for creating deployment files in section 34.6.2 of the Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers Guide. I was still unable to deploy from JDev, so I copied the .EAR file to the OAS, and tried deploying with Enterprise Manager. Success! But now I'm getting a "500 Internal Server Error". I believe this is yet another J2EE/JDK version issue. (JDev uses J2EE 5 and JDK 1.5, OAS 10.1.2. uses an older version). At least the application is deployed and shows a loaded status and I'm not getting 404 Page Not Found errors when I try to run it from the browser.

The 500 Internal Server Error's stack dump shows it's related to ADF - maybe I can make a simple JSP without ADF and get it to run. I only need JDev so I can build a very simple page anyways.

Update: Success! I copied a one-line example of a JSP into a new JDev web applications project, followed the steps to package it for OAS 10.1.2, deployed it from JDev, and IT WORKED.

It's Friday afternoon - I'm going sailing and them I'm going to drink some beer, and then I'm going to repeat that process Saturday and Sunday. Nice weekend all!

Labels: , , ,

Thursday, April 26, 2007

JDeveloper 10.1.3 and OAS 10.1.2.0.2: I Give In

Still can't get the sample application built on Jdev 10.1.3 to deploy to my OAS 10g 10.1.2.0.2 app server. Spent lots of time browsing the OTN forums and Metalink and it mostly boils down to JDev 10.1.3 and OAS 10.1.2.0.2 using different JDKs. One fix (an unrecognized xml tag) got me past the first error, but new errors cropped up and now I'm throwing in the towel and downloading JDev 10.1.2.

I waste more time trying to configure Oracle than I actually do getting to develop on it.

PITA.

Update: I spoke too soon. After installing JDev 10.1.2 I discovered the tutorials I need to learn from are no longer available. So it's back to 10.1.3. Tomorrow I'll post a plea for help on the OTN JDeveloper forum. There's got to be a set of steps to get applications built on JDev 10.1.3 to work on OAS 10.1.2.

Labels: , ,

Fun With JDeveloper 10.1.3

While searching for the cause of my application's deployement problem, I discovered a post on the OTN forums where it was noted that applications developed with JDeveloper 10.1.3 that are deployed on OAS 10g 10.1.2 must be compiled using the Sun JDK 1.4, not the Sun JDK 1.5. The post, written by one of Oracle's JDeveloper evangelists, helpfully gave the reference for the howto. It is located in Section 22-11 of the Oracle ADF Developers Guide, 101.3

I don't know if this is the cause of my problem, and it isn't Oracle's fault that apps developed with Sun's JDK 1.5 won't necessarily run with JDK 1.4, and I'm sure it made sense to upgrade JDev to JDK 1.5, but it would be nice if somewhere on the download page for JDev 10.1.3 there was a big notice alerting folks of OAS 10.1.2 of this issue.

Labels: , ,