How to- Customise ORA errors in ADF UIX ?
Iam working on JDev 10.1.2. ADF UIX.
I have managed to capture JBO errors using message bundle and custo mise them but am not able to do the same in case of ORA errors. I need to customise errors like integrity constraint errors from database.
How am i too to do that?
Regards,
Vineet.
hello
di you get this issue solved, please help
we are using 10.1.3
Similar Messages
-
Re: How to Handle ORA Errors in adf
HI all.
I am using Jdev 11.1.2.3 , Database oracle 11g,
Some scenarios i am getting ORA:022XXX error popup.
How can i make this popups as user defined messages.
Withregards,
satishkumar NHi Satish,
To my mind the easiest solution would be one from developer's guide (last option Lars suggested). But it is quite limited, because there You can't override ORA messages like ORA:022XXX in general, there You must list specific DB constraints in two-dimensional array. In this solution I also missed just simple "error code -message" mapping in regular bundle file. It is not described in developer's guide, but easily implemented by just creating bundle file in the same package as extending class resides (more details in blog post Custom bundle to override default error mesasges in ADF application).
But.. If You still need to override DB messages like ORA:022XXX, not particular constraints, You should go with rth suggested solution.
Here is a code sample of "DCErrorHandlerImpl" extending class to set You on the road:
public class DataControlExceptionHandler extends DCErrorHandlerImpl {
public DataControlExceptionHandler() {
super(true);
@Override
public String getDisplayMessage(BindingContext bindingContext, Exception exception) {
if (exception instanceof SQLIntegrityConstraintViolationException) {
SQLIntegrityConstraintViolationException sqlExc = (SQLIntegrityConstraintViolationException) exception;
return "DB exception occured: "+ sqlExc.getMesage();
return exception.getLocalizedMessage();
Regards,
Danas -
How to read ora error stack?
Hi,
Db : 11.2
We got the below error in alert log.For understanding purpose,Arch session was killed or Rman session was killed? So cannot be archived. Is it right?
The session was killed Hence
ORA-16038: log 6 sequence# 26202 cannot be archived
ORA-00028: your session has been killed
ORA-00312: online log 6 thread 2: '+ARCH_IT03/it03/onlinelog/group_6.1122.794731693'
ORA-00312: online log 6 thread 2: '+DATA_IT03/it03/onlinelog/group_6.271.794731695'
How to read ora error stack? From Top to bottom or bottom to top
Br,
Raj975791 wrote:
Hi,
Db : 11.2
We got the below error in alert log.For understanding purpose,Arch session was killed or Rman session was killed? So cannot be archived. Is it right?
The session was killed Hence
ORA-16038: log 6 sequence# 26202 cannot be archived
ORA-00028: your session has been killed
ORA-00312: online log 6 thread 2: '+ARCH_IT03/it03/onlinelog/group_6.1122.794731693'
ORA-00312: online log 6 thread 2: '+DATA_IT03/it03/onlinelog/group_6.271.794731695'
How to read ora error stack? From Top to bottom or bottom to top
Br,
Raj
Yes
The messages are all related to the same issue. There really isn't any issue of 'which comes first'. -
Detecting validation errors in ADF UIX
Dear sirs...
how can i detect validation errors in an adf uix page using DataActionContext?
thanks for any helpdear sirs...
i found how it works. it is simple, bust call this.hasErrors(ctx). this would return true if an error occurs, otherwise it returns false.
best regards -
How to get ORA errors in alertlog file using shell script.
Hi,
Can anyone tell me how to get all ORA errors between two particular times in an alertlog file using shell script.
ThanksHi,
You can define the alert log as an external table, and extract messages with SQL, very cool:
http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm
If you want to write a shell script to scan the alert log, see here:
http://www.rampant-books.com/book_2007_1_shell_scripting.htm
#!/bin/ksh
# log monitoring script
# report all errors (and specific warnings) in the alert log
# which have occurred since the date
# and time in last_alerttime_$ORACLE_SID.txt
# parameters:
# 1) ORACLE_SID
# 2) optional alert exclusion file [default = alert_logmon.excl]
# exclude file format:
# error_number error_number
# error_number ...
# i.e. a string of numbers with the ORA- and any leading zeroes that appear
# e.g. (NB the examples are NOT normally excluded)
# ORA-07552 ORA-08006 ORA-12819
# ORA-01555 ORA-07553
BASEDIR=$(dirname $0)
if [ $# -lt 1 ]; then
echo "usage: $(basename) ORACLE_SID [exclude file]"
exit -1
fi
export ORACLE_SID=$1
if [ ! -z "$2" ]; then
EXCLFILE=$2
else
EXCLFILE=$BASEDIR/alert_logmon.excl
fi
LASTALERT=$BASEDIR/last_alerttime_$ORACLE_SID.txt
if [ ! -f $EXCLFILE ]; then
echo "alert exclusion ($EXCLFILE) file not found!"
exit -1
fi
# establish alert file location
export ORAENV_ASK=NO
export PATH=$PATH:/usr/local/bin
. oraenv
DPATH=`sqlplus -s "/ as sysdba" <<!EOF
set pages 0
set lines 160
set verify off
set feedback off
select replace(value,'?','$ORACLE_HOME')
from v\\\$parameter
where name = 'background_dump_dest';
!EOF
`
if [ ! -d "$DPATH" ]; then
echo "Script Error - bdump path found as $DPATH"
exit -1
fi
ALOG=${DPATH}/alert_${ORACLE_SID}.log
# now create awk file
cat > $BASEDIR/awkfile.awk<<!EOF
BEGIN {
# first get excluded error list
excldata="";
while (getline < "$EXCLFILE" > 0)
{ excldata=excldata " " \$0; }
print excldata
# get time of last error
if (getline < "$LASTALERT" < 1)
{ olddate = "00000000 00:00:00" }
else
{ olddate=\$0; }
errct = 0; errfound = 0;
{ if ( \$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
{ if (dtconv(\$3, \$2, \$5, \$4) <= olddate)
{ # get next record from file
next; # get next record from file
# here we are now processing errors
OLDLINE=\$0; # store date, possibly of error, or else to be discarded
while (getline > 0)
{ if (\$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
{ if (errfound > 0)
{ printf ("%s<BR>",OLDLINE); }
OLDLINE = \$0; # no error, clear and start again
errfound = 0;
# save the date for next run
olddate = dtconv(\$3, \$2, \$5, \$4);
continue;
OLDLINE = sprintf("%s<BR>%s",OLDLINE,\$0);
if ( \$0 ~ /ORA-/ || /[Ff]uzzy/ )
{ # extract the error
errloc=index(\$0,"ORA-")
if (errloc > 0)
{ oraerr=substr(\$0,errloc);
if (index(oraerr,":") < 1)
{ oraloc2=index(oraerr," ") }
else
{ oraloc2=index(oraerr,":") }
oraloc2=oraloc2-1;
oraerr=substr(oraerr,1,oraloc2);
if (index(excldata,oraerr) < 1)
{ errfound = errfound +1; }
else # treat fuzzy as errors
{ errfound = errfound +1; }
END {
if (errfound > 0)
{ printf ("%s<BR>",OLDLINE); }
print olddate > "$LASTALERT";
function dtconv (dd, mon, yyyy, tim, sortdate) {
mth=index("JanFebMarAprMayJunJulAugSepOctNovDec",mon);
if (mth < 1)
{ return "00000000 00:00:00" };
# now get month number - make to complete multiple of three and divide
mth=(mth+2)/3;
sortdate=sprintf("%04d%02d%02d %s",yyyy,mth,dd,tim);
return sortdate;
!EOF
ERRMESS=$(nawk -f $BASEDIR/awkfile.awk $ALOG)
ERRCT=$(echo $ERRMESS|awk 'BEGIN {RS="<BR>"} END {print NR}')
rm $LASTALERT
if [ $ERRCT -gt 1 ]; then
echo "$ERRCT Errors Found \n"
echo "$ERRMESS"|nawk 'BEGIN {FS="<BR>"}{for (i=1;NF>=i;i++) {print $i}}'
exit 2
fi -
How to get ORA Errors on SQLPlus in english
Hi,
I am running 10gR2 on american Windows.
Even I have set NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
still getting oracle errros on SQLPlus in german :-(
What do I else need to change?
ThanksHi,
Are you sure that the NLS_LANG variable was correctly set up ?
C:\>sqlplus system/manager
SQL*Plus: Release 10.2.0.1.0 - Production on Dom Jun 10 21:43:40 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Conectado a:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> select * from mytable;
select * from mytable
ERRO na linha 1:
ORA-00942: a tabela ou view não existe
SQL> select * from nls_session_parameters;
PARAMETER VALUE
NLS_LANGUAGE BRAZILIAN PORTUGUESE
NLS_TERRITORY BRAZIL
NLS_CURRENCY R$
NLS_ISO_CURRENCY BRAZIL
NLS_NUMERIC_CHARACTERS ,.
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD/MM/RR
NLS_DATE_LANGUAGE BRAZILIAN PORTUGUESE
NLS_SORT WEST_EUROPEAN
NLS_TIME_FORMAT HH24:MI:SSXFF
NLS_TIMESTAMP_FORMAT DD/MM/RR HH24:MI:SSXFF
NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR
NLS_TIMESTAMP_TZ_FORMAT DD/MM/RR HH24:MI:SSXFF TZR
NLS_DUAL_CURRENCY Cr$
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
17 linhas selecionadas.
SQL> exit
Desconectado de Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
C:\>set NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
C:\>sqlplus system/manager
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Jun 10 21:44:12 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> select * from mytable;
select * from mytable
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from nls_session_parameters;
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
17 rows selected.
SQL> alter session set nls_language=german;
Session wurde geõndert.
SQL> select * from my table;
select * from my table
FEHLER in Zeile 1:
ORA-00933: SQL-Befehl wurde nicht korrekt beendet
SQL> select * from mytable;
select * from mytable
FEHLER in Zeile 1:
ORA-00942: Tabelle oder View nicht vorhandenCheers -
How tos - Multi Struts Config for ADF UIX (JDev10.1.2)
Has anyone tried the OTN How-tos for Multi Struts Config?
http://www.oracle.com/technology/products/jdev/howtos/10g/StrutsMultiConfigs/struts_multiconfig_howto.html
Well I tried doing it and am facing a lot of problems.
1. When I try to create a page in the child, it creates a duplicate page and hence two UIModels are created.
2. Also there is an extra directory created in the common public_html folder as child1/child1.
Could some one work that link out. I have failed to figure out what's going wrong.
My problem doesn't end there. The link tells us that we can create multi struts app, but how do we link the pages created in these applications together?
Regards,
VineetGoran,
a smarter way would be to use Virtual Private
Databases if the database is Oracle. This way you
don't have to bother within your application to do
this. We do have a VPD example in teh howtos for
JDeveloper 9i.Tnx for the suggestion, but I needed a solution within ADF.
If you want to do this on teh middle tier, use a bind
variable in the BC query and populate this through an
exposed method on the AM. I found even simpler solution... I let user choose an employee and fix this employee's id with a setCurrentRowWithKeyValue operation (drag-n-drop to a Data Action). Afterwards all the screens based on child view objects in the Data Control Palette hierarchy display only data from a fixed employee. -
How to create new row in Adf uix table
hi,
I am using Jdev 10.1.2 , Can any body tell me how to insert new row in table ?
ThanxHi,
try creating a createInsert action.
Regards,
Koen Verhulst -
How to forward ORA- errors to e-mail?
Sorry everybody, if it's a dummy question, but I'm not able to find a place in the Grid where i can enable the subj.
It there any place or build-in scripts that I can use?
I have 10.2.0.3 Grid on RHEL4 64bit.
Thanks a lot for any hint.
M.What kind of errors are these?
I believe if you have set you notification methods and schedules, it should send you the emails automatically. -
Trapping ora- errors in alert.log
hello everyone,
A classical question that I think every DBA has encountered.
We have about 40 oracle database servers, some with 9i, others with 10g, still others with both. Some on Linux, others on Solaris.
My question is, how to trap ora- errors in the alert.log of these database and having them being sent as an email.
It's not an easy question to answer, I know. But I'd like to get ideas from your experiences in implementing the same thing in your environments.
Many thnx.
HiruyaHi,
this let you look for errors :
utl_file.get_line(vInHandle, vNewLine);
IF vNewLine like ('%ORA-%') then
Then this let you to mail the errors :
utl_smtp.mail
Here is my complete script :
SET SERVEROUT ON
DECLARE
c utl_smtp.connection;
vInHandle utl_file.file_type;
vNewLine VARCHAR2(250);
vMessage VARCHAR2(250);
I pls_integer := 0;
LC$Fic_in Varchar2(128) := 'db1ALRT.LOG'; -- a adapter sur votre configuration
LC$Dir_in Varchar(30) := 'C:\oracle\admin\db1\bdump';
PROCEDURE send_header(name VARCHAR2, header VARCHAR2) AS
BEGIN
utl_smtp.write_data(c,name ||':'|| header || UTL_TCP.CRLF);
END;
BEGIN
vInHandle := utl_file.fopen(LC$Dir_in, LC$Fic_in, 'R');
LOOP
BEGIN
utl_file.get_line(vInHandle, vNewLine);
IF vNewLine like ('%ORA-%') then
vMessage:=vMessage||chr(10)||vNewLine;
END IF;
EXCEPTION
WHEN OTHERS THEN
EXIT;
END;
END LOOP;
utl_file.fclose(vInHandle);
-----------------------SEND A MAIL---------------------------
c := utl_smtp.open_connection(‘smtpserver’,25);
utl_smtp.helo(c, ‘something.com');
utl_smtp.mail(c, [email protected]');
utl_smtp.rcpt(c, ‘[email protected]');
utl_smtp.open_data(c);
send_header('From', '"someone" <[email protected]>');
send_header('To', '"Recipient" < [email protected] >');
send_header('Subject', 'DB1 ERREUR ALERT LOG');
utl_smtp.write_data(c, UTL_TCP.CRLF ||vMessage);
utl_smtp.close_data(c);
utl_smtp.quit(c);
EXCEPTION
WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
BEGIN
utl_smtp.quit(c);
EXCEPTION
WHEN utl_smtp.transient_error
OR utl_smtp.permanent_error THEN
NULL;
END;
raise_application_error(-20000, SQLERRM);
END fopen;
/ -
Display requestScope attributes within ADF UIX page
In jsp I can do the following to display all attributes available in the current requestScope by
< c:forEach var='parameter' items='${requestScope}'>
< ul>
< li>< b>< c:out value='${parameter.key} : ${parameter.value}'/></b>:</li>
< /ul>
< /c:forEach>How to do the same in ADF UIX (without using servletInclude)?Please provide an example
This works
<styledText text="parameterMap ${uix.bajaContext.servletRequest.parameterMap}"/>But this does not work.
<stackLayout>
<contents childData="${uix.bajaContext.servletRequest.parameterMap}">
<styledText text="text: ${uix.current.key}"/>
</contents>
</stackLayout>How to use ${uix.bajaContext.servletRequest.attributeNames} for instance since this returns a java.util.Enumeration type? -
JDev10.1.2-ADF UIX Customization of errors
Iam a forms developer who has been exploring Jdev.
Have to a certain extent managed to create the browse pages and edit pages.
My problem is how do i customise the errors thrown by JDev?
Like in forms i can capture and customise the errors in On-Error trigger is there any similar way i can do the same in UIX?
Regards,
VineetFor UIX lov page, there are two event: "lovSelect" and "lovUpdate".
The Lov Page handles the "lovSelect" event, and main page handles "lovUpdate" event.
You can add attribute value bindings you need pass to main page,
and In main page, add "lovUpdate" event handler. Example as below:
<event name="lovUpdate" source="LOVInput1">
<compound>
<set property="inputValue" value="${data.lovUIModel.SelectAttribute1.inputValue}" target="${bindings.LOVIniput1}"/>
<set property="inputValue" value="${data.lovUIModel.SelectAttribute2.inputValue}" target="${bindings.LOVIniput2}"/>
<set property="inputValue" value="${data.lovUIModel.SelectAttribute3.inputValue}" target="${bindings.LOVIniput3}"/>
</compound>
</event>
Through this method, the main page can get multi values from lov page.
But We have to handle the clear lov input action manuly.
Hope this can help you. -
ADF UIX Tab Switching and 404 Error
I have an ADF UIX page that has a couple of tabs. When switching from one to the other, some of the links to data pages give me 404 error whereas they work if I run each page seperately. How do you maintain state when switching on tabbed pages?
Thanks!
RayWe need more detailed information to help with your scenario.
Is there any difference between the URL seen in the browser address location when you run individual tab pages versus clicking on the links?
Kind Regards. -
How to be notified for all ORA- Errors recorded in the alert.log file
based on Note:405396.1, I Changed the Matches Warning from the default value ORA-0*(600?|7445|4[0-9][0-9][0-9])[^0-9] to ORA-* in order to receive an warning alert for all ORA- errors.
but I just recieved the alert like the following:
Metric=Generic Alert Log Error
Time/Line Number=Mon Feb 25 23:52:21 2008/21234
Timestamp=Feb 26, 2008 12:06:03 AM EST
Severity=Warning
Message=ORA-error stack (1654, 1654, 1654) logged in /opt/oracle/admin/PRD/bdump/alert_PRD.log.
Notification Rule Name=Alert Log Error
Notification Rule Owner=SYSMAN
as you can see, the message only indicate the ORA-1654, nothing else.
How to set in 10g grid control to get the details alert that in the alert log like:
"ORA-1654: unable to extend index ADM.RC_BP_STATUS by 1024 in tablespace PSINDEX"
I can't believe Oracle 10g Grid control only provide the ORA- number without detailsGo to your database target.
On the home tab, on the left hand side under Diagnostic Summary, you'll see a clickable date link next to where it says 'Alert Log'. Click on that.
next click on Generic Alert Log Error Monitoring Configuration (its at the bottom)
In the alert thresholds put:
ORA-0*(600?|7445|4[0-9][0-9][0-9])[^0-9]
I believe that will pick anything up but experiment, its only perl.
If you want to test this use the DBMS_System.ksdwrt package but I would advise you only do so on a test database. If you've never heard of it, google it. Its a way of writing to your alert log.
Make sure you have your emails sent to long format as well. -
How to resolve ORA-00001 Error in SQL Insert?
Hi all, I need your appreciated help.
I make a plsql procedure that is inserting a row according cursor value, I'm having oracle error ORA-00001: unique constraint (constraint_name) violated.
You may see this message if a duplicate entry exists at a different level: in RDBMS MySQL I have the syntax IGNORE to resolve this duplication error... and in Oracle ?
Thanks for your time and hints.
Miguelitouser6317803 wrote:
How to resolve ORA-00001 Error in SQL Insert?ORA-00001 means table has unique/primary key/index and you are trying to insert a row with key value that already exists in the table. I'll assume table COUNTRIES has primary key on COUNTRY_ID. Then change SQL to:
SQL = "INSERT INTO COUNTRIES(COUNTRY_ID,COUNTRY_NAME,REGION_ID) SELECT 'BZ','BLZ',3 FROM DUAL WHERE NOT EXISTS(SELECT 1 FROM COUNTRIES WHERE COUNTRY_ID = 'BZ')"There is a good chance table COUNTRIES also has unique key/index on COUNTRY_NAME. If so use:
SQL = "INSERT INTO COUNTRIES(COUNTRY_ID,COUNTRY_NAME,REGION_ID) SELECT 'BZ','BLZ',3 FROM DUAL WHERE NOT EXISTS(SELECT 1 FROM COUNTRIES WHERE COUNTRY_ID = 'BZ' OR COUNTRY_NAME = 'BLZ')"SY.
Maybe you are looking for
-
Function Module to calculate pallets
Hi, I need a Function Module to calculate pallets for free of charge articles while creating a sales order. can someone name any FM for this purpose. Thanks in advance
-
Basic Binary File Does not Read Unless Placed into Exact Format it originated?
Ok, check this out. This just does not make any sense to me. First, you'll need to run it and create the two files. You're going to get an error at the close. Now...here's what doesn't make any sense to me. If you enable the disabled diagram and
-
DELETE FROM ACCOUNT_ASCTN WHERE LIST_ID = 3999 AND ACCOUNT_ID IN ( SELECT ACCOUNT_ID FROM ACCOUNT_ASCTN WHERE LIST_STATUS_CODE ='A' AND LIST_ID =3999 MINUS (SELECT ACCOUNT_ID FROM WORKLIST_ACNT )); as sometimes it takes around 40 minutes for a partic
-
how to stop the action of a jbutton while executing the process i had a problem the button action was performed and continuing the process i want to disable the button when the process is executing plz help me
-
Why doesn't iTunes see my iPod 80gb Video since I upgraded to OSX 10.4?
I upgraded to Tiger from Leopard a couple of weeks ago and haven't been able to sync my iPod since. I've rebooted both the iPod and my Mac, Re-installed iTunes, replaced the ipod.plist and DRM key, and done everything on the Apple Help: http://docs.i