Thursday, February 26, 2015

JDeveloper Cannot Establish Connection or Local Host Not Known When Connecting to Application Server

I updated to OS X Yosemite recently. After which, I experienced some issues with JDeveloper when trying to create a connection to an Application Server. I observed the following exceptions:

Testing JSR-160 Runtime ... failed.
Cannot establish connection.
Testing JSR-160 DomainRuntime ... skipped.
Testing JSR-88 ... skipped.
Testing JSR-88-LOCAL ... skipped.
Testing JNDI ... skipped.
Testing JSR-160 Edit ... skipped.
Testing HTTP ... success.
Testing Server MBeans Model ... skipped.
Testing HTTP Authentication ... success.

and

Testing JSR-160 Runtime ... failed.
Local host not known?!
Testing JSR-160 DomainRuntime ... skipped.
Testing JSR-88 ... skipped.
Testing JSR-88-LOCAL ... skipped.
Testing JNDI ... skipped.
Testing JSR-160 Edit ... skipped.
Testing HTTP ... success.
Testing Server MBeans Model ... skipped.
Testing HTTP Authentication ... success.

I went into OS X System Preferences and set my Computer Name to something other than MacBook Pro. I also clicked the Edit button there and set my Local Hostname: to the same value.

Also, check your /etc/hosts file for the proper alias, e.g. hostname.local

I had no more issue with JDeveloper connecting to an Application Server.

Tuesday, February 10, 2015

RCU-6016:The specified prefix already exists

I was running RCU via command line as part of a silent installation, and the script threw an exception while doing it's thing. I reran RCU via command line to drop the repository; however, it too threw an exception. So, I connected to the DB and removed the schemas manually. When RCU was executed again to create the schemas, another exception was thrown:

RCU-6016:The specified prefix already exists.
RCU-6091:Component name/schema prefix validation failed.

I reconnected to the database and manually created the schemas that RCU creates automatically. I was then able to successfully run RCU to drop and recreate the schemas.

As a side note, some RCU components create additional schemas that are not advertised. Case in point, the IAU component creates the following schemas:

${prefix}_IAU
${prefix}_IAU_APPEND
${prefix}_IAU_VIEWER



Friday, February 6, 2015

Linux sed Replace with Environment Variable Containing Path

I had a use case to construct a bash script to search a configuration file and replace a string with a path. This path was stored as an environment variable.

PATH=/some/path
export PATH

My original sed command looked like this:

sed -i "s/findThis/$PATH/g" someFile.cfg

Execution of the script kept throwing the following exception:

sed: -e expression #1, char 33: unknown option to `s'

After some trial and error, I discovered that the issue was related to the file separators (/) in the value of PATH. Instead of using a '/' as the separator for sed, use a pipe '|'.

sed -i "s|findThis|$PATH|g" someFile.cfg