How to configure Tomcat to serve image files from custom folder or NFS Share.

You can use to Tomcat to serve images, PDF, xls, docx from the custom directory. In our case, we used centralized NFS share to serve images to our custom Apex Applications.

Here is the how

Add a <context> to the tomcat/conf/server.xml file.

Windows example:
<Context docBase=”c:\Documents and Settings\The User\images” path=”/images” />

Linux example:
<Context docBase=”/var/project/images” path=”/images” />

Example of Server.xml (trimmed):

<Server port=”8025″ shutdown=”SHUTDOWN”>

<Service name=”Catalina”>

<Engine name=”Catalina” defaultHost=”localhost”>

<Host appBase=”webapps”
autoDeploy=”false” name=”localhost” unpackWARs=”true”
xmlNamespaceAware=”false” xmlValidation=”false”>

<Host name=”localhost” appBase=”webapps”
unpackWARs=”true” autoDeploy=”true”>

<!–Custom Images Directory–>
<Context docBase=”/nfsshare/custom/images” path=”/images” />

</Host>
</Engine>
</Service>
</Server>

Now, you should be able to pull files (e.g. /nfsshare/custom/images/TestImage.jpg) as http://localhost:8080/custom/images/TestImage.jpg

test

Advertisement

adautocfg.sh and adcfglonce.pl dbconfig – fails with ORA-01157 Lock Datafile

When executed Auto config  and Clone Config after RMAN Duplicate, following error occured.

ERROR: InDbCtxFile.uploadCtx() : Exception : Error executng BEGIN fnd_gsm_util.append_ctx_fragment(:1,:2,:3); END;: 1; Oracle error -1157: ORA-01157: cannot identify/lock data file 515 – see DBWR trace file
ORA-01110: data file 515: ‘+USUAT_DATA’ has been detected in FND_GSM_UTIL.APPEND_CTX_FRAGMENT.oracle.apps.ad.autoconfig.oam.InDbCtxFileException: Error executng BEGIN fnd_gsm_util.append_ctx_fragment(:1,:2,:3); END;: 1; Oracle error -1157: ORA-01157: cannot identify/lock data file 515 – see DBWR trace file
ORA-01110: data file 515: ‘+USUAT_DATA’ has been detected in FND_GSM_UTIL.APPEND_CTX_FRAGMENT.

 

[orajzuat@usuatsrvdbd1bin]$ export PATH=/usr/bin:$PATH
[orajzuat@usuatsrvdbd1bin]$ perl adcfgclone.pl dbconfig /us9001/oracle/11.2.0/appsutil/bpijzuat_usuatsrvdbd1.xml

Beginning dbconfig Apply – Fri Jan 29 14:53:12 2016
…….
  |     30% completed       ERROR: InDbCtxFile.uploadCtx() : Exception : Error executng BEGIN fnd_gsm_util.append_ctx_fragment(:1,:2,:3); END;: 1; Oracle error -1157: ORA-01157: cannot identify/lock data file 515 – see DBWR trace file
ORA-01110: data file 515: ‘+USUAT_DATA’ has been detected in FND_GSM_UTIL.APPEND_CTX_FRAGMENT.
oracle.apps.ad.autoconfig.oam.InDbCtxFileException: Error executng BEGIN fnd_gsm_util.append_ctx_fragment(:1,:2,:3); END;: 1; Oracle error -1157: ORA-01157: cannot identify/lock data file 515 – see DBWR trace file
ORA-01110: data file 515: ‘+USUAT_DATA’ has been detected in FND_GSM_UTIL.APPEND_CTX_FRAGMENT.
        at oracle.apps.ad.autoconfig.oam.InDbCtxFile.uploadCtx(InDbCtxFile.java:249)
        at oracle.apps.ad.autoconfig.oam.CtxSynchronizer.uploadToDb(CtxSynchronizer.java:328)
        at oracle.apps.ad.tools.configuration.FileSysDBCtxMerge.updateDBCtx(FileSysDBCtxMerge.java:721)
        at oracle.apps.ad.tools.configuration.FileSysDBCtxMerge.updateDBFiles(FileSysDBCtxMerge.java:226)
        at oracle.apps.ad.context.CtxValueMgt.processCtxFile(CtxValueMgt.java:1690)
        at oracle.apps.ad.clone.ApplyDatabase.runCVM(ApplyDatabase.java:3058)
        at oracle.apps.ad.clone.ApplyDatabase.runCVMAndAutoConfig(ApplyDatabase.java:3003)
        at oracle.apps.ad.clone.ApplyDatabase.doConf(ApplyDatabase.java:649)
        at oracle.apps.ad.clone.ApplyDatabase.doApply(ApplyDatabase.java:473)
        at oracle.apps.ad.clone.ApplyDatabase.<init>(ApplyDatabase.java:366)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
        at oracle.apps.ad.clone.util.CloneProcessor.run(CloneProcessor.java:67)
        at java.lang.Thread.run(Thread.java:637)
  –     30% completed
Completed Apply…
Fri Jan 29 14:54:23 2016
Starting database listener for bpijzuat:
Running:
/us9001/oracle/11.2.0/appsutil/scripts/bpijzuat_usuatsrvdbd1/addlnctl.sh start bpijzuat
Logfile: /us9001/oracle/11.2.0/appsutil/log/bpijzuat_usuatsrvdbd1/addlnctl.txt
You are running addlnctl.sh version 120.1.12010000.4
Starting listener process bpijzuat …
Listener bpijzuat has already been started.
addlnctl.sh: exiting with status 0
addlnctl.sh: check the logfile /us9001/oracle/11.2.0/appsutil/log/bpijzuat_usuatsrvdbd1/addlnctl.txt for more information …
[orajzuat@usuatsrvdbd1bin]$

Cause: This error occurs when there is missing or corrupted TEMP tablespace tempfile

Solution:  Drop and Re-create Tempfile.

Current Temp Tablespace:

select file#,name,ts# from v$tempfile;

FILE# NAME  TS#
1     +USUAT_TMP/usuat/tempfile/temp3.257.902419859   292
2     +USUAT_TMP/usuat/tempfile/temp4.256.902419677   393

select name from v$tablespace where ts# in (292,393)

NAME
Temp1
Temp2

We can see the same error when trying to select the size of the tempfile

select file_name,bytes/1024/1024/1024 from dba_temp_files where tablespace_name=’TEMP1′;

select file_name,bytes/1024/1024/1024 from dba_temp_files where tablespace_name=’TEMP2′;

–ORA-01157: cannot identify/lock data file 513 – see DBWR trace file
–ORA-01110: data file 513: ‘+USUAT_DATA’

 Note: Same error as the adconfig

Create temporary tablespace TEMP3 tempfile ‘+USUAT_TMP’ size 20G;

ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp3;

drop tablespace TEMP1;

drop tablespace TEMP2;

Now run adautocfg.sh….SUCCESS….