Sunday, August 17, 2008

Error creating new OC4J instance: Invalid protocol or port range.

This is an attempt to install the SOA Suite, using Oracle AS 10.1.3.4 on HP-UX using the Enterprise Deployment Guide; the complete error message is:

Error creating new OC4J instance: create oc4j instance fails: Invalid protocol or port range. There is no OHS installed on the Oracle Home. So new OC4J instance can not use ajp protocol. Please use the -protocol and -httpPort option on the command to create OC4J.

As an alternative, I tried from the command prompt, running the createinstance command from $ORACLE_HOME/bin. To no relief.
Of course, google came up empty, as did metalink; however, I found a workaround that seems to work (This is install is not quite ready, yet):

cd $ORACLE_HOME/bin
./createinstance -instanceName oc4j_soa -groupName soa_group -httpPort 8435 -protocol http
./createinstance -instanceName oc4j_esbdt -groupName esbdt_group -httpPort 8435 -protocol http
Then, edit opmn.xml (in $ORACLE_HOME/opmn/conf/) and change

<port id="default-web-site" range="8435" protocol="http"/>
into:
<port id="default-web-site" range="12501-12600" protocol="ajp"/>

Do this for both instances just created (oc4j_soa and oc4j_esbdt).
And just as a side note: create these in lower case, as there's a patch (PERL script, actually), that checks for a lower case oc4j_soa!

Next, opmnctl reload and start, and we're in business. The EDG (linked in the title) states that an AJP port should be picked, but defining a range makes the Application Server choosing the next free port.

Friday, August 08, 2008

Cannot deploy because already deployed?

Oracle Application Server playing bezerk? You undeployed an application, but ran into a memory error (or another).

An error occured while undeploying the application. The evaluate phase failed. The Adapter used in the evaluate may have thrown an exception.
Resolution:
Please call Oracle support.
Base Exception:
java.lang.OutOfMemoryError
null. java.lang.OutOfMemoryError

No trace of your application, but a deployment fails with:

Deployment failed
Base Exception: J2EE application: [application_name] has already been deployed. Redeploy needs to be used to override previous deployed application.


The solution is to check whether or not all traces have indeed been removed (obviously not):

$ORACLE_HOME/dcm/bin/dcmctl listapplications -co [container]

will still show your application. If it does, remove it with the following command:

$ORACLE_HOME/dcm/bin/dcmctl undeployapplication -a [appl] -co [container] -force -d -v

You should now be able to deploy again.

The Reverse
You see your application in Enterprise Manager Console, but cannot undeploy, due to a failed deployment. Reverse situation from above:

- check $ORACLE_HOME/j2ee/[container_name]/application-deployments
- check $ORACLE_HOME/j2ee/[container_name]/applications
for directories and ear files named after your application.
- check $ORACLE_HOME/j2ee/[container_name]/config/server.xml for entries regarding your application, and remove this line.
- check $ORACLE_HOME/j2ee/[container_name]/config/default-web-site.xml for entries regarding your application, and remove this line.

Perform an opmnctl reload, and restart OEM (emctl stop iasconsole); you should now be able to deploy again.