Thursday, March 26, 2009

Java compile error with Ant or Maven

I hope you may have got the following error on some time of your programing career. When you compile some java files using your IDE, Ant, Maven javac etc this error may pop.

class file has wrong version 49.0, should be 48.0

The reason for this is one or more classes or java libraries in your classpath are not compatible with the current version of the java compiler. To fix this need download the latest JDK and set the JAVA_HOME to the new jdk.

Or else if you have the source of the library files it self you can rebuild the libraries using the current version of the JDK.

===============

Wednesday, March 25, 2009

Unable to retrieve search results column is not indexed

When working in site studio and oracle ucm content server i got the following error when trying to select the assets drop down to insert a css or a image etc.

Unable to retrieve search results. Unable to retrieve search results. Unable to create result set for query 'SELECT IdcColl1.dID, dDocName, dDocTitle, dDocType, dRevisionID, dSecurityGroup, dDocAuthor, dDocAccount, dRevLabel, dFormat, dOriginalName, dExtension, dWebExtension, dInDate, dOutDate, dCreateDate, dPublishType, dRendition1, dRendition2, VaultFileSize, WebFileSize, URL, dFullTextFormat, dFullTextCharset, DocMeta.*FROM IdcColl1, DocMetaWHERE IdcColl1.dID=DocMeta.dID AND (((CONTAINS(dDocFullText,'test') > 0 ))) ORDER BY dInDate Desc'. ORA-20000: Oracle Text error:DRG-10599: column is not indexed

To fix this error need to Configure Site Studio Metadata and Zone Fields. To do this

1. Open the content server Administration page.

2. Click Zone Fields Configuration.

3. Move Web Sites and Exclude From Lists into Zone Text Fields column.

Then press update.

This should basically fix the issue above. Refer to the Site studio installation guide for more information.


Note:

According to the installation guide full text indexing is required by the ucm to run correctly even though you do not need full text indexing facility.

To do this execute the Database-Script [ucm-install-target]/database/oracle/admin/stellentrole.sql

Use the following command to enable the role to the user.
grant stellent_role to ;

Script for creating a user for content server is in [ucm-install-target]/database/oracle/admin/contentserveruser.sql. This script assigns required rights and roles to the content server user.

Enabling full text search

In addition to the above settings the following should be done to enable full text search.

If the database used is 10gR2 should run the following script
[ucm-install-target]/database/oracle/admin/batchsnippet.sql

Edit [ucm-install-target]/config/config.cfg and add the following:
SearchIndexerEngineName=DATABASE.FULLTEXT

Restart the content server.

Run the repository manager tool comes with the content server and rebuild the indexes.

This will basically enable full text search in content server. Please refer to the installation guild in the following location for further information.

http://download-west.oracle.com/docs/cd/E10316_01/cs/cs_doc_10/documentation/integrator/install_cserver_win_10en.pdf.

=====================

Sunday, March 8, 2009

Error while getting remote MBeanServer

When creating a connection from the JDeveloper to the Oracle Application server you might get an error similar to the following.

Error while getting remote MBeanServer for url: ormi://176395.176395-web1.server.domain:12401/default

To fix this add the fully qualified application server name (which is 176395.176395-web1.server.domain in above case) to the hosts file in the client machine that runs JDeveloper which used to access the server.

The hosts file is located in the following locations on the client machine.

Linux - /etc/sysconfig/networking/profiles/default/hosts
Windows - C:\WINDOWS\system32\drivers\etc\hosts

The hosts file should look similar to the following after adding the entry.

127.0.0.1 localhost
83.138.171.4 176395.176395-web1.server.domain

Just adding the entry and saving the hosts file is enough and no need to restart anything for this to work.
======================================================

Friday, March 6, 2009

Oracle pfile and spfile

Oracle pfile is the parameter file which is used for initilazing the oracle database. This is usualy init.ora in the ${ORACLE_HOME}/dbs/ which is /u01/app/oracle/product/11.1.0/db_1/dbs in my case.

spfile is the binary counterpart of pfile which was introduced starting from Oracle 9i. spfile is used to store dynamic changes done via ALTER SYSTEM or ALTER SESSION statements.

On startup database first looks the spfile and if not found checks for pfile.

Creating spfile
spfile can be created as privilaged user by following command
SQL> create spfile from pfile;
The file is created in ${ORACLE_HOME}/dbs/ and named spfile{ORACLE_SID}.ora. The command will over write if a old file exist in the path and if its in use following error will throw.
ORA-32002: cannot create SPFILE already being used by the instance

Starting up with different spfile.
On startup the system checks the parameter file in following order.
spfile${ORACLE_SID}.ora file in ${ORACLE_HOME}/dbs/
spfile.ora in ${ORACLE_HOME}/dbs/
init${ORACLESID}.ora in ${ORACLE_HOME}/dbs/

To specify the parameter file on startup use the following command
SQL> startup pfile='/db2/ORACLE/SID/spfile/init.ora';

SCOPE and ALTER SYSTEM statements

Changes done by ALTER SYSTEM and ALTER SESSION statements are normally persistent in spfile. However this behaviour can be changed.

Specifying SCOPE=MEMORY and the changes are valid until the next restart and the spfile will not affected. To do this use the following commands.

SQL> SHOW PARAMETER timed_statistics
SQL> ALTER SYSTEM SET timed_statistics=TRUE scope=memory;
SQL> SHOW PARAMETER timed_statistics

Specifying SCOPE=SPFILE and the changes will not affect the current running instance but will be visible after a database restart. For this use the following command.

SQL> ALTER SYSTEM SET timed_statistics=TRUE scope=spfile;

Specifying SCOPE=BOTH will affect both the running instance and the spfile hence will be persistent. Following is the command to do this.

SQL> ALTER SYSTEM SET timed_statistics=TRUE scope=both;

To check this parameter in both contexts memory and spfile use the following commands

SQL> SELECT name,value FROM v$parameter WHERE name='timed_statistics';
SQL> SELECT name,value FROM v$spparameter WHERE name='timed_statistics';

Check what paramter file (spfile or pfile) used in the database.

SQL> SELECT name,value FROM v$parameter WHERE name = 'spfile';

Export the spfile to pfile

SQL> create pfile from spfile;

OR can specify the file names as

SQL> create pfile='/db2/ORACLE/SID/spfile/init.ora' from spfile='/db2/ORACLE/SID/spfile/spfileorcl.ora'

===================

Thursday, March 5, 2009

Oracle instance currently running

To retrieve the Oracle instance name, execute the following SQL statement:
select sys_context('USERENV','DB_NAME') as Instancefrom dual;

Following commands can be used to check the TNS Listener status

tnsping oracl (Where oracl is the instance name under concern

lsnrctl services

lsnrctl status

Wednesday, March 4, 2009

Apache library Permission denied in Linux when configuring oracle UCM and SELinux

I encountered the following issue while trying to configure Apache web server in Linux (Fedora) to run the oracle UCM content management system.

<IfModule !IdcApacheAuth>
LoadModule IdcApacheAuth "/oracle/ucm/server/shared/os/linux/lib/IdcApache22Auth.so"
</IfModule>

IdcUserDB "idc" "/oracle/ucm/server/data/users/userdb.txt" Alias "/idc" "/oracle/ucm/server/weblayout/"

<Location "/idc">
IdcSecurity "idc"
Allow from allDirectoryIndex portal.htm
</Location>


Following Permission denied exception thrown when i restarted the server after adding the above configuration.

httpd: Syntax error on line 1001 of /etc/httpd/conf/httpd.conf: Cannot load /oracle/ucm/server/shared/os/linux/lib/IdcApache22Auth.so into server: /oracle/ucm/server/shared/os/linux/lib/IdcApache22Auth.so: cannot open shared object file: Permission denied


This is really not an issue. Actually an advanced security feature in linux called SELinux is blocking the library file from loading. SELinux (Security Enhanced Linux) is a proxy controlling the request to all aspects of the system including filesystem, processes, users, network connections, etc.

Method 1 - Disable SELinux

One way of fixing this issue is turning the mode of SELinux to off or warning only.
In command shell type
shell system-config-selinux
to bring the graphical administraion window of SELinux and set the following parameters

System default enforcing mode - Disabled or Permisive
current enforcing mode - Permisive

Also you can manualy configure it by editing configuration file
/etc/selinux/config
set the variable SELINUX=disabled and reboot the system.

Alternatively can use the following commands to temparoryly disable SELinux until next reboot.
setenforce 1
echo 0 > /selinux/enforce

Specify in /etc/grub.conf on the "kernel" command line: enforcing=0 which will also
work on reboot and permenent.


Method 2 - Configure the SELinux security paramters

Login as root and copy the file IdcApache22Auth.so to /usr/lib which has permissions for running the file. Should use the copy command instead of move command to set the directory permissions in file.

cp /oracle/ucm/server/shared/os/linux/lib/IdcApache22Auth.so /usr/lib

Then change the httpd.conf file parameter from
/oracle/ucm/server/shared/os/linux/lib/IdcApache22Auth.so
to
/usr/lib/IdcApache22Auth.so

Check current security setting using following commands
ls -Z /oracle will show the current settings
ps -eZ to see security contexts of processes

Make the /oracle directory accessible by invoking the following command

chcon -R -h -t httpd_sys_content_t /oracle

-R: Recursive. Files and directories in current directory and all subdirectories.
-h: Affect symbolic links.
-t: Specify type of security context.

Make the httpd connect to ucm by setting the following httpd option. Execute the following command

setsebool -P httpd_can_network_connect=1

retart httpd by issueing follwing command as root

service httpd restart

Now the above issue should be fixed.

=============================

Monday, March 2, 2009

Terrorist Attack on Sri Lankan Cricket Team

Me and my friend Nivanka thought of turning the site black to condemn the brutal terrorist attack on our Cricket team as they approached the Gaddaphi Cricket Stadium in Pakistan to continue the third day of the Test match.

BBC-Link
http://news.bbc.co.uk/2/hi/south_asia/7920260.stm

CCN-Link
http://edition.cnn.com/2009/WORLD/asiapcf/03/02/pakistan.srilanka.attack/index.html?eref=edition

As Sri Lankans we have suffered a lot because of the terrorist activities carried by the LTTE (the local terrorist group) for almost 30 years. Because of the never ending effort of our brave solders now the LTTE is conformed to a very little area of 50 square kilometers and they are continuing to pounding the asses of them.

Terrorism is a virus demolishing the beauty of the world. So the whole world should put hands together on the effort of eliminating it altogether.

Once our President Mahinda Rajapaksha said we cannot categorise Terrorism to Good Terrorists and Bad Terrorists. The above incidence is another one which proves this idea.

Hope all the leaders in the whole world unite in overcoming this issue very soon.


=================================================================


I have rolled back the blackout effect of my blog today (05th March 2009). Hope peace will prevail on earth and incidences like this will not happen in future in anywhere of the world.

=================================================================

Sunday, March 1, 2009

Increase sessions and processes of Oracle DB

If you use the oracle XE starter database and try to setup a bulky application like the oracle ucm content management system you will get the following error.

Unable to initialize the application. Error: Unable to initialize the system provider 'SystemDatabase'. Unable to create database connection for the database 'SystemDatabase' with connection string 'jdbc:oracle:thin:@localhost:1521:XE'. Please make sure that the connection string, user and password are correct. Listener refused the connection with the following error:ORA-12519, TNS:no appropriate service handler found

The default parameters of the starter database are not set to handle havy loads. To increase the parameters use the following commands.

Log into sqlplus by

sqlplus sys/password as sysdba (Replace password with administrator password).

Database Sessions

Increase the number of sessions to allow more users to access the database.
SQL> show parameters sessions
SQL> alter system set sessions=250 scope=spfile;

Database Processes

Increase the number of database processes which will allow more connections to the database.

SQL> show parameters processes
SQL> alter system set processes=200 scope=spfile;

Finally restart the database for the parameters to take effect.

This should fix the above error.

Subscribe