Control exceptions or errors in procedure
Hy , I have a proceducre like this:
CREATE OR REPLACE PROCEDURE "MY_PROCEDURE"( )
AS
BEGIN
INSERT INTO tableBackupTable1 SELECT table1.* FROM table1;
INSERT INTO tableBackupTable2 SELECT table1.* FROM table2;
*/*Disable FK*/*
for i in (select constraint_name, table_name from user_constraints where constraint_type ='R' and status = 'ENABLED')
LOOP
execute immediate 'alter table '||i.table_name||' disable constraint '||i.constraint_name||'';
end loop;
delete * from table1;
delete * from table2;
*/*Enable FK*/*
for i in (select constraint_name, table_name from user_constraints where constraint_type ='R' and status = 'ENABLED')
LOOP
execute immediate 'alter table '||i.table_name||' enable constraint '||i.constraint_name||'';
end loop;
END;
1. If I want to control the errors or exceptions for this procedure from my java code where Im calling this procedure from:
I dont have to declare a block "EXCEPTION......" in the procedure, right?
2. If I want to rollback if an error or exception happens, should I do something in the procedure or in my java code?
3. If I dont want to return anything in my procedure, should I use a sys_refcursor like out parameter?
4. Should I use commit, where?
5. Should I surround the loops for enable or disable fk with begin and end because If I dont surround it and an error ocurrs while enablling FK or disabling them ?
6. All my accesses to the database from my java code are transactional, so if I call this procedure from my java code and this call is transactional and the procedure is itself transactional, is there a problem with this?
Thanks
Edited by: user13162080 on 29-dic-2010 6:40
Edited by: user13162080 on 29-dic-2010 6:46
Edited by: user13162080 on 29-dic-2010 6:56
Hi,
I dont want to handle it in the procedure itself because I am controlling all exceptions or errors in the database from java to make rollback or whatever
Can you help me in the others questions? In my opinion this is not the right way to handle database exception. Database exception should be handled in database itself not in java. Oracle will rollback the transaction autometically if any statement fails(exception) and you will not have to put extra efforts(java code) to control the exception. If you wish you can explain your business requirement we may suggest something easier/better.
2. If I want to rollback if an error or exception happens, should I do something in the procedure or in my java code?It should be driven by your business requirement.
3. If I dont want to return anything in my procedure, should I use a sys_refcursor like out parameter?It depends what kind of value you want to return. For a single value sys_refcursor is not the right tool. Refer this link http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/static.htm#i7106
4. Should I use commit, where?
It should also driven by your business need. COMMIT will make the changes permanent into the database so whenever you want to commit you can. All the DDLs (CREATE, DROP table etc) are having implicit (auto) COMMIT.
5. Should I surround the loops for enable or disable fk with begin and end because If I dont surround it and an error ocurrs while enablling FK or disabling them ?
I would suggest to have a look on http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/toc.htm
6. All my accesses to the database from my java code are transactional, so if I call this procedure from my java code and this call is transactional and the procedure is itself transactional, is there a problem with this?
What do you mean by transactional? do you mean for each row?
Thanks and Regards,
Avinash
Edited by: Avinash Tripathi on Dec 29, 2010 7:04 PM
Similar Messages
-
Access control exception only on Linux/Debian not on Windows!?
We have a rmi server application with a webstart rmi swing client that we have been running successfully on Windows. The client is downloaded and running without any problems on Windows platforms (W2003, Win2K, WinXP). The client webstart jar is signed and all permissions is set in the jnlp file.
As soon as we setup a server on linux/debian sarge we get these access control exceptions when the server tries to send events back to the client. It complains on
file permssions not being set on the server jar file and the strange thing is that the path separator is backslash on linux?
I've tried the following:
1) java.policy. Added All permssions to the server jar file and/or bin the folder.
2) Running without any security manager, i.e., System.setSecurityManager(null)
3) Explicitly setting the policy on the server. Policy.setPolicy(...)
4) Explicitly setting a policy on the client. URL policyUrl = Thread.currentThread().getContextClassLoader().getResource("server.policy");
5) Building the server and client on debian
I'm at my wits end... I've searched these forums and it seems that this is might be a common problem but I've not found a solution yet.
Our system works 100% on Windows without any problems, it's only on linux/debian that we get these access control problems.
2005-sep-19 09:39:19 se.xxx.xxx.admin.AdminManager change
ERROR: java.security.AccessControlException: access denied (java.io.FilePermission \\usr\local\XXX\bin\server.jar read)
java.security.AccessControlContext.checkPermission(Unknown Source)
java.security.AccessController.checkPermission(Unknown Source)
java.lang.SecurityManager.checkPermission(Unknown Source)
java.lang.SecurityManager.checkRead(Unknown Source)
java.io.File.exists(Unknown Source)
sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
sun.net.www.protocol.file.Handler.openConnection(Unknown Source)
java.net.URL.openConnection(Unknown Source)
sun.rmi.server.LoaderHandler.addPermissionsForURLs(Unknown Source)
sun.rmi.server.LoaderHandler.access$300(Unknown Source)
sun.rmi.server.LoaderHandler$Loader.<init>(Unknown Source)
sun.rmi.server.LoaderHandler$Loader.<init>(Unknown Source)
sun.rmi.server.LoaderHandler$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
sun.rmi.server.LoaderHandler.lookupLoader(Unknown Source)
sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
java.io.ObjectInputStream.readClassDesc(Unknown Source)
java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
java.io.ObjectInputStream.readObject0(Unknown Source)
java.io.ObjectInputStream.readObject(Unknown Source)
sun.rmi.server.UnicastRef.unmarshalValue(Unknown Source)
sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
sun.rmi.transport.Transport$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
sun.rmi.transport.Transport.serviceCall(Unknown Source)
sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
sun.rmi.server.UnicastRef.invoke(Unknown Source)
se.xxx.xxx.client.XXXApplication_Stub.notify(Unknown Source)
)I have two suggestions. The first is that you didn't indicate the permissions of the file and the directories above it along with the user you're running the program as. In Unix it is easier to get an access issue as you're probably not running as root. In a traditional Windows environment everything runs with admin permission allowing access to anything. While the error comes from the security manager it has nothing to do with traditional J2SE security - it may be an O/S level thing.
But the second suggestion touches on the other question you have - why is this showing up as backslashes? Is there perhaps an issue with the JNLP file? Is there any code that should be using System.getProperty( "file.separator") and is instead just using the backslash? -
Can't launch itunes due to the following error; The procedure entry point AVCFPlayerAppliesMediaSelectionCriteriaKey could not be located in the dynamic link library AVFoundationCF.dll.
Hey bcolden,
I would try uninstalling and reinstalling following the directions in here:
Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
http://support.apple.com/kb/HT1923
This section in particular contains important information in the uninstall process:
Use the Control Panel to uninstall iTunes and related software components in the following order and then restart your computer:
iTunes
Apple Software Update
Apple Mobile Device Support
Bonjour
Apple Application Support (iTunes 9 or later)
Important: Uninstalling these components in a different order, or only uninstalling some of these components may have unintended affects.
Let us know if following that article and uninstalling those components in that order helped the situation.
Welcome to Apple Support Communities!
Best,
Delgadoh -
SEVERE: An exception or error occurred in the container during the request
hi
I am using tomcat 4.0 as for my serlvets. I get below exception when processing a request. Please let me know under what conditions do we get such exception
Aug 31, 2005 12:20:28 PM org.apache.coyote.tomcat5.CoyoteAdapter service
SEVERE: An exception or error occurred in the container during the request processing
java.lang.NullPointerExceptionnull at java.io.Writer.write(Writer.java:126)null at java.io.PrintWriter.newLine(PrintWriter.java:254)null at java.io.PrintWriter.println(PrintWriter.java:405)null at java.io.PrintWriter.println(PrintWriter.java:516)null at org.apache.catalina.logger.LoggerBase.log(LoggerBase.java:266)null at org.apache.catalina.core.StandardWrapperValve.log(StandardWrapperValve.java:376)null at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)null at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)null at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)null at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)null at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)null at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)null at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)null at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)null at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)null at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)null at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)null at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)null at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)null at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)null at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)null at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)null at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)null at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)null at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)null at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)null at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)null at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)null at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)null at java.lang.Thread.run(Thread.java:534)null
Thanks
RajeshSrikanth,
Problem is that the exception is not form any PrintWriter object i had instantiated in my servlet code. Infact, the exception comes from a class of tomcat when it is trying to log some information. The basic thing is I am contacting a Geographical positioning server from servlet. The contact is fine and I get requested information back from server. But, once the control comes back to server, I get that exception. If I dont contact the geo server, I dont get any exception.
Thanks for your immediate reply.
Rajesh -
Hi Experts,
I am getting the following exception when i am running the my web service through portal....
Successfully i am able to add the methods from that web service to my application through internet and i am able to debug and deploy to portal and at the runtime i am getting this Permission Control Exception....
Can any one help me in this regard....
I am giving my stack trace so that u ppl can easily understand the error....
#1.5#000FFE1B0448004C0000029500001E34000439D940C2D46D#1189505164107#com.sap.portal.portal#sap.com/irj#com.sap.portal.portal#Guest#2####9b27e1b0604e11dcb752000ffe1b0448#SAPEngine_Application_Thread[impl:3]_11##0#0#Error#1#/System/Server#Java###Exception ID:03:36_11/09/07_0004_3423050
[EXCEPTION]
#1#com.sapportals.portal.prt.runtime.PortalRuntimeException: Access is denied: com.sap.portal.runtime.admin.logviewer.default - user: Guest
at com.sapportals.portal.prt.deployment.DeploymentManager.checkPermissions(DeploymentManager.java:2009)
at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.refresh(PortalComponentContextItem.java:247)
at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.getContext(PortalComponentContextItem.java:312)
at com.sapportals.portal.prt.component.PortalComponentRequest.getComponentContext(PortalComponentRequest.java:385)
at com.sapportals.portal.prt.connection.PortalRequest.getRootContext(PortalRequest.java:435)
at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:607)
at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:545)
at java.security.AccessController.doPrivileged(Native Method)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: com.sapportals.portal.pcd.gl.PermissionControlException: Access denied (Object: com.sap.portal.system/security/sap.com/NetWeaver.Portal/high_safety/com.sap.portal.runtime.admin.logviewer/components/default)
at com.sapportals.portal.pcd.gl.PcdFilterContext.filterLookup(PcdFilterContext.java:416)
at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1095)
at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1101)
at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1101)
at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1101)
at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1101)
at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1101)
at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1101)
at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1101)
at com.sapportals.portal.pcd.gl.PcdProxyContext.proxyLookupLink(PcdProxyContext.java:1197)
at com.sapportals.portal.pcd.gl.PcdProxyContext.proxyLookup(PcdProxyContext.java:1144)
at com.sapportals.portal.pcd.gl.PcdProxyContext.lookup(PcdProxyContext.java:918)
at com.sapportals.portal.pcd.gl.PcdGlContext.lookup(PcdGlContext.java:68)
at com.sapportals.portal.pcd.gl.PcdURLContext.lookup(PcdURLContext.java:238)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.sapportals.portal.prt.deployment.DeploymentManager.checkPermissions(DeploymentManager.java:2004)
Thanks in Advance....
Best wishesss,,,,
RaghuHi,
This error says com.sapportals.portal.prt.runtime.PortalRuntimeException: Access is denied: com.sap.portal.runtime.admin.logviewer.default - user: Guest
This means your user with which you are doing this does not have enough permissions, try the same using Admin user. Does your webservice needs authentication? if yes then check the credentials as well.
Regards,
Ameya -
"user defined exception" in a stored procedure and APEX
I would like to use user defined exception in a stored procedure or trigger in a APEX application.
Does anybody know how to do it ? or know where can I find a good reference ?
Thanks,raise_application_error(-20001, 'error message');
Scott -
Hi Expert,
While running the Order Import i am getting the error please help us :
Order Import Concurrent Program
Concurrent Program Parameters
Validate Only: N
Order Source:
Order Ref:
Sold To Org Id:
Sold To Org:
Change Sequence:
Performance Parameter: Y
Trim Blanks: N
Operation:
Number of Instances: 0
Debug Level: 0
Request Id: 4471
Org Id: 2453
Failed to perform Action Request BOOK_ORDER
Failed to perform Action Request BOOK_ORDER
No. of orders found: 1
No. of orders imported: 0
No. of orders failed: 1
Source/Order/Seq/Line Message
10/1046001534//2 ATP Process resulted in no data
10/1046001534//2 User-Defined Exception in Package OE_SCHEDULE_UTIL Procedure Load_Results_from_tbl
10/1046001534//2 User-Defined Exception in Package OE_SCHEDULE_UTIL Procedure Load_Results_from_rec
End of Order Import Concurrent Program
Regards,
SurajAnd also check
Order Import error : User-Defined Exception in Package OE_SCHEDULE_UTIL Procedure Action_Undemand,User-Defined Exception in Package OE_SCHEDULE_UTIL Procedure Action_Reschedule [ID 737031.1] -
Hi all, my test.jsp got the "Exception ex" error; however, I don't see any Exception ex in my test.jsp code plus "'}' expected" error. Can any one tell me what's wrong in test.jsp and how to fix it.
Thanks a ton
[05/May/2003:17:23:15] info ( 1276): Internal Info: loading servlet /regionalnews.jsp
[05/May/2003:17:23:16] info ( 1276): JSP: JSP1x compiler threw exception
org.apache.jasper.JasperException: Unable to compile class for JSPC:\iPlanet\Servers\https-sjw1bnguyen01.NA.RTA\config\..\ClassCache\_jsps\_regionalnews_jsp.java:626: 'catch' without 'try'.
} catch (Exception ex) {
^
C:\iPlanet\Servers\https-sjw1bnguyen01.NA.RTA\config\..\ClassCache\_jsps\_regionalnews_jsp.java:637: '}' expected.
^
C:\iPlanet\Servers\https-sjw1bnguyen01.NA.RTA\config\..\ClassCache\_jsps\_regionalnews_jsp.java:638: 'try' without 'catch' or 'finally'.
^
3 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java, Compiled Code)
at com.iplanet.server.http.servlet.NSServletEntity.load(NSServletEntity.java:252)
at com.iplanet.server.http.servlet.NSServletEntity.update(NSServletEntity.java:173)
at com.iplanet.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:427)
[05/May/2003:17:23:16] warning ( 1276): Internal error: Failed to get GenericServlet. (uri=/regionalnews.jsp,SCRIPT_NAME=/regionalnews.jsp)
Here is my test.jsp file: ********************
<%@ page import = "java.sql.*,oracle.jdbc.driver.*,java.util.Date, java.text.*" %>
<%
String dbUrl = "jdbc:oracle:thin:@sjw1bnguyen01:1521:mydb";
String dbUser = "scott";
String dbPass = "tiger";
//Do the login through database
String queryArtcCatNav = "SELECT DISTINCT CAT_ID FROM ssp01_artc" +
" WHERE RGN_ID " + "= " + "\'" + request.getParameter("RgnId") + "\'" +
" ORDER BY CAT_ID ASC";
String queryArtcYrNav = "SELECT DISTINCT (to_char(ARTC_PUB_DTM, 'YYYY')) as ARTC_PUB_DTM" +
" FROM ssp01_artc" +
" WHERE RGN_ID = " + "\'" + request.getParameter("RgnId") + "\'" +
" ORDER BY ARTC_PUB_DTM DESC";
String queryLatestYr = "SELECT MAX(to_char(ARTC_PUB_DTM, 'YYYY'))FROM ssp01_artc)";
String queryCurYrArtc = "SELECT CAT_ID, RGN_ID, ARTC_FLNM_TRKG_ID, ARTC_HDR_TXT, ARTC_PUB_DTM" +
" FROM ssp01_artc" +
" WHERE to_char(ARTC_PUB_DTM, 'YYYY')" +
" IN (SELECT MAX(to_char(ARTC_PUB_DTM, 'YYYY'))FROM ssp01_artc)" +
" AND RGN_ID = " + "\'" + request.getParameter("RgnId") + "\'" +
" GROUP BY CAT_ID, ARTC_FLNM_TRKG_ID, ARTC_HDR_TXT, ARTC_PUB_DTM" +
" ORDER BY CAT_ID, ARTC_PUB_DTM DESC";
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection con = DriverManager.getConnection(dbUrl, dbUser,dbPass);
Statement st = con.createStatement();
ResultSet rsArtcCatNav = st.executeQuery(queryArtcCatNav);
ResultSet rsArtcYrNav = st.executeQuery(queryArtcYrNav);
ResultSet rsCurYrArtc = st.executeQuery(queryCurYrArtc);
ResultSet rsLatestYr = st.executeQuery(queryLatestYr);
%>
<html>
<head>
<title>Test Page</title>
<table border="0" width="515" cellspacing="0" cellpadding="0">
<tr>
<td>
<h4 align="center"><font color="#000000" face="Verdana, arial"> <br>
<%
if(request.getParameter("RgnId").equals("na")) {
%>
</font><font face="verdana, arial">Semiconductor Press Room
- North America</font></h4>
<% }
else if(request.getParameter("RgnId").equals("eu")) { %>
</font><font face="verdana, arial">Semiconductor Press Room
- Europe</font></h4>
<% } %>
<hr width="515">
<!--- Display corporate news article header --->
<p align="center"><font face="verdana, arial"><b>Corporate News</b></font></a></p>
<!--- Set message flag variable to control the display for warning message --->
<% boolean blnMsgFlg = false; %>
<ul>
<% while(rsCurYrArtc.next()) { %>
<li>
<%
if(rsCurYrArtc.getString("RGN_ID").equals("na") && rsCurYrArtc.getString("CAT_ID").equals("crp")) {
%>
<% blnMsgFlg = true; %>
<li>
<!--- If the region is North America then show the hyperlink with MM/DD/YYYY format
If the region is Europ then show the hyperlink with MM/YYYY format --->
<%
SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss.S");
String dateString = rsCurYrArtc.getString("ARTC_PUB_DTM");
ParsePosition pos = new ParsePosition(0);
Date currentTime_2 = formatter.parse(dateString, pos);
formatter = new SimpleDateFormat ("MMM d, yyyy");
dateString = formatter.format(currentTime_2); %>
<!-- Call html file -->
<p align="left"><font size="2" face="verdana, arial"><a href="/press/releases/<%= rsCurYrArtc.getString(ARTC_FLNM_TRKG_ID") %">.htm">
<%= dateString %></a> - <%= rsCurYrArtc.getString("ARTC_HDR_TXT") %></p></FONT>
<% } //Region=eu
else if(rsCurYrArtc.getString("RGN_ID").equals("eu") && rsCurYrArtc.getString("CAT_ID").equals("crp")) { %>
<% blnMsgFlg = true; %>
<%
SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss.S");
String dateString = rsCurYrArtc.getString("ARTC_PUB_DTM");
ParsePosition pos = new ParsePosition(0);
Date currentTime_2 = formatter.parse(dateString, pos);
formatter = new SimpleDateFormat ("MMM, yyyy");
dateString = formatter.format(currentTime_2); %>
<!-- Call html file -->
<p align="left"><font size="2" face="verdana, arial"><A href="/press/releases/<%= rsCurYrArtc.getString("ARTC_FLNM_TRKG_ID") %>.htm">
<%= dateString %></a> - <%= rsCurYrArtc.getString("ARTC_HDR_TXT") %></p></FONT>
</li>
<% } %>
</ul>
<!--- Dispaly the warning message if there is no article --->
<% if(blnMsgFlg) { %>
<p align="center"><font face="verdana, arial" size="2"><b>
No news release for this category.</b></font></a></p>
<% } %>
<hr width="515">
<!--- Display product news article header --->
<p align="center"><font face="verdana, arial"><b>Product News</b></font></a></p>
<!--- Set variable category id counter to control the display of category description under Product News title --->
<% int intCatIdCtr = 0; %>
<!--- Set message flag variable to control the display for warning message --->
<% boolean blnMsgFlg = false; %>
<% while(rsCurYrArtc.next()) { %>
<%
if(rsCurYrArtc.getString("RGN_ID").equals("na") && rsCurYrArtc.getString("CAT_ID") != "crp") {
%>
<% blnMsgFlg = true; %>
<%
if(rsCurYrArtc.getString("CAT_ID") != intCatIdCtr) {
%>
<p align="center"><font face="verdana, arial" size="2"><b><%= rsCurYrArtc.getString("CAT_ID") %></b></font></a></p>
<% intCatIdCtr = rsCurYrArtc.getString("CAT_ID") %>
<% } %>
<ul>
<li>
<!--- If the region is North America then show the hyperlink with MM/DD/YYYY format
If the region is Europ then show the hyperlink with MM/YYYY format --->
<%
SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss.S");
String dateString = rsCurYrArtc.getString("ARTC_PUB_DTM");
ParsePosition pos = new ParsePosition(0);
Date currentTime_2 = formatter.parse(dateString, pos);
formatter = new SimpleDateFormat ("MMM d, yyyy");
dateString = formatter.format(currentTime_2); %>
<!-- Call html file -->
<p align="left"><font size="2" face="verdana, arial"><A href="/press/releases/<%= rsCurYrArtc.getString("ARTC_FLNM_TRKG_ID") %>.htm">
<%= dateString %></a> - <%= rsCurYrArtc.getString("ARTC_HDR_TXT") %></p></FONT>
<% }
else if(rsCurYrArtc.getString("RGN_ID").equals("eu") && rsCurYrArtc.getString("CAT_ID") != "crp") { %>
<% blnMsgFlg = true ;%>
<%
SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss.S");
String dateString = rsCurYrArtc.getString("ARTC_PUB_DTM");
ParsePosition pos = new ParsePosition(0);
Date currentTime_2 = formatter.parse(dateString, pos);
formatter = new SimpleDateFormat ("MMM, yyyy");
dateString = formatter.format(currentTime_2); %>
<!-- Call html file -->
<p align="left"><font size="2" face="verdana, arial"><A href="/press/releases/<%= rsCurYrArtc.getString("ARTC_FLNM_TRKG_ID") %>.htm">
<%= dateString %></a> - <%= rsCurYrArtc.getString("ARTC_HDR_TXT") %></p></FONT>
</li>
<% } %>
</ul>
<!--- Display the warning message if there is no article --->
<% if(blnMsgFlg) { %>
<p align="center"><font face="verdana, arial" size="2"><b>
No news release is available in the selected category for the selected
year request.getParameter("PubYr"). Please try another year or category</b></font></a></p>
<% } %>
</td>
</tr>
</table>
<% try {
rsArtcCatNav.close();
rsArtcYrNav.close();
rsCurYrArtc.close();
rsLatestYr.close();
st.close();
con.close();
catch
(Exception e) {} %>
</body>
</html></a>hi there,
again, it's pretty hard to see from your code but the exception you get is synthax related. you probably forgot to close one of the if's. if you format your code nicely these would be easier to catch.
ie. i use following format:
if(something)
for(condition)
do something.
notice how easy it is to see where you open and close {}'s.
have a nice day.
cem. -
Exception handling in calling procedure
Hi,
i have a package where currently am making calls to private procedures from public procedure.
and the senario is:-
create package body p_tst
is
ex_failed exception;
-- this is private proc
procedure p_private
is
begin
raise ex_failed;
exception
when ex_failed
then
raise;
end p_private;
procedure p_public
is
begin
-- nomaking call to private
-- procedure
p_private;
-- here i need to catch
-- the raised exception
-- passed from the called
-- procedure
when ex_failed
end p_public;
end;
basically i want to catch the exception being passed from called procedure to calling procedure, and raise the same exception in calling procdure.
is it possible to catch the same exception in the calling procedure?Yes, you can catch the same exception in the calling procedure, exceptions are propagated to the caller if they are not handled in the called procedure.
Is this what you are trying to do?
CREATE OR REPLACE PACKAGE p_tst
AS
PROCEDURE p_public;
ex_failed EXCEPTION;
END;
CREATE OR REPLACE PACKAGE BODY p_tst
IS
PROCEDURE p_private
IS
BEGIN
RAISE ex_failed;
END p_private;
PROCEDURE p_public
IS
BEGIN
p_private;
EXCEPTION
WHEN ex_failed
THEN
DBMS_OUTPUT.put_line ('error');
END p_public;
END;
SQL> set serveroutput on;
SQL> exec p_tst.p_public;
error
PL/SQL procedure successfully completed. -
Exception block in a procedure
I have this exception block in my procedure, it use to work nicely (write log in UNIX, but since we upgrade to 10G is not working anymore.
I ask my DBA, he said that I do have the right previlages to this
Directory /home/connman/student';
v_out_path VARCHAR2 (40) := '/home/connman/student';
What is wrong? I will appreciate any help on this..
PROCEDURE studlife_tbl_ins_rep_room_ind (
p_studlife_repeat_err_code OUT VARCHAR2,
p_ora_err_code OUT NUMBER,
p_ora_err_msg OUT VARCHAR2
IS
v_out_path VARCHAR2 (40) := '/home/connman/student';
v_out_file VARCHAR2 (40)
:= 'cc_student_life_pkg'
|| '_'
|| TO_CHAR (SYSDATE, 'YYYYMMDDHH');
v_file_handle UTL_FILE.file_type;
v_pidm NUMBER;
v_count NUMBER;
e_insert_zero EXCEPTION;
CODE (GO HERE)
p_studlife_repeat_err_code := '0';
UTL_FILE.put_line (v_file_handle, 'Successful Completion.');
SELECT COUNT (repeat_pidm)
INTO v_count
FROM SZSLIFE_REPEAT_ROOM;
--- WHERE szslife_rm_asg_term_code_eff = p_stulife_term_code;
IF v_count = 0
THEN
RAISE e_insert_zero;
ELSE
UTL_FILE.put_line (v_file_handle,'Number of Records Inserted' || v_count);
END IF;
EXCEPTION
WHEN e_insert_zero
THEN
ROLLBACK;
p_studlife_repeat_err_code :=
'CC_ERROR_MSG: Insert Procedure. ZERO Rows Returned in INSERT statement for term '
|| '.';
p_ora_err_msg := SUBSTR (SQLERRM, 1, 2000);
p_ora_err_code := SQLCODE;
UTL_FILE.put_line (v_file_handle,
p_studlife_repeat_err_code
|| 'sqlerrm: '
|| p_ora_err_msg
|| ' / sqlcode: '
|| SQLCODE
WHEN OTHERS
THEN
ROLLBACK;
p_studlife_repeat_err_code :=
'CC_ERROR_MSG: Error on INSERT statement for term '
|| p_studlife_repeat_err_code
|| '.';
p_ora_err_msg := SUBSTR (SQLERRM, 1, 2000);
p_ora_err_code := SQLCODE;
END studlife_tbl_ins_rep_room_ind;I don't think my DBA knows what is going on, I did read and here is the entire precedure, as I said use to work in Oracle 9.2. since we upgrade to 10G it is
not working, I am not getting an error, It is not wring anything to the directory
'/home/connman/student'; my dba said that I have the right priveliges to that directory...
PROCEDURE studlife_tbl_ins_rep_room_ind (
p_studlife_repeat_err_code OUT VARCHAR2,
p_ora_err_code OUT NUMBER,
p_ora_err_msg OUT VARCHAR2
IS
v_out_path VARCHAR2 (40) := '/home/connman/student';
v_out_file VARCHAR2 (40)
:= 'cc_student_life_pkg'
|| '_'
|| TO_CHAR (SYSDATE, 'YYYYMMDDHH');
v_file_handle UTL_FILE.file_type;
v_pidm NUMBER;
v_count NUMBER;
e_insert_zero EXCEPTION;
BEGIN
UTL_FILE.fclose_all;
v_file_handle := UTL_FILE.fopen(v_out_path, v_out_file, 'a');
UTL_FILE.put_line (v_file_handle,
CHR (10) || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH:MI:SS')
UTL_FILE.put_line (v_file_handle, 'studlife_tbl_ins_rep_room_ind .');
INSERT INTO SZSLIFE_REPEAT_ROOM
repeat_pidm ,
repeat_term_code ,
repaat_bldg_code ,
repeat_desc ,
repeat_room_number ,
repeat_indicator
SELECT
DISTINCT
temp_pidm,
temp_term_code,
temp_bldg_code ,
temp_desc ,
temp_room_number ,
DECODE (lag(temp_room_number)
over (PARTITION BY temp_bldg_code, temp_room_number ORDER BY temp_term_code) , NULL,'N', temp_room_number,'Y',NULL)
FROM
SZSLIFE_TEMP_TBL
---WHERE temp_pidm = 1862
ORDER BY
temp_term_code;
COMMIT;
p_studlife_repeat_err_code := '0';
UTL_FILE.put_line (v_file_handle, 'Successful Completion.');
SELECT COUNT (repeat_pidm)
INTO v_count
FROM SZSLIFE_REPEAT_ROOM;
--- WHERE szslife_rm_asg_term_code_eff = p_stulife_term_code;
IF v_count = 0
THEN
RAISE e_insert_zero;
ELSE
UTL_FILE.put_line (v_file_handle,'Number of Records Inserted' || v_count);
END IF;
EXCEPTION
WHEN e_insert_zero
THEN
ROLLBACK;
p_studlife_repeat_err_code :=
'CC_ERROR_MSG: Insert Procedure. ZERO Rows Returned in INSERT statement for term '
|| '.';
p_ora_err_msg := SUBSTR (SQLERRM, 1, 2000);
p_ora_err_code := SQLCODE;
UTL_FILE.put_line (v_file_handle,
p_studlife_repeat_err_code
|| 'sqlerrm: '
|| p_ora_err_msg
|| ' / sqlcode: '
|| SQLCODE
WHEN OTHERS
THEN
ROLLBACK;
p_studlife_repeat_err_code :=
'CC_ERROR_MSG: Error on INSERT statement for term '
|| p_studlife_repeat_err_code
|| '.';
p_ora_err_msg := SUBSTR (SQLERRM, 1, 2000);
p_ora_err_code := SQLCODE;
END studlife_tbl_ins_rep_room_ind; -
I can't get iTunes to install/start on my HP laptop. When I start/install the current version, I get the following error "The procedure entry point "JSStringGetUTF8String could not be located in the dynamic link library WebKit.dll". Why isn't this dll included in the distribution? What do I do to get iTunes to install on my 64-bit AMD HP laptop.
Taken at face value, you're having trouble with an Apple Application Support program file there. (Apple Application Support is where single copies of program files used by multiple different Apple programs are kept.)
Let's try something relatively simple first. Restart the PC. Now head into your Uninstall a program control panel, select "Apple Application Support" and then click "Repair".
Does iTunes launch properly now?
If no joy after that, try the more rigorous uninstall/reinstall procedure from the following post:
Re: I recently updated to vista service pack 2 and I updated to itunes -
Hi,
I'm running a procedure, i would like that if any error occures there will be a message that an error cccured, don't want to specifiy the error.
tried:
procedure...
EXCEPTION
htp.p('an error occured');
end;doesn't seem to work.
thx
EstherIt looks like
EXCEPTION WHEN OTHERS THEN
htp.p('something');
END; -
I noticed that weblogic web services layer sends a http error 500 back when exceptions are thrown form an EJB.
Anyone know how to control the http error so it is 200 instead of 500.
Thanks,
-TonyRamesh
The 500 error I guess is due to a miss correlation, sending wrong data to the server making it crash.
You can record JavaScript files by editing the proxy filter:
View -> OpenScript Preferences -> Record -> HTTP module (or Sieble) -> Change to URL Filters tab; you can add edit remove filters from there.
Regards
Alex -
Where can I find information about exceptions and errors?
I'm new to Java and sometimes run into errors that I don't understand. Is there a list of common errors somewhere that I could look at to at least get a general idea of what's causing my problem?
for instance:
I'm writing a little program where the user inputs a number and depending on their input a message is displayed. I'm using java.awt.*, java.awt.event.*, & javax.swing.* for my events, buttons, and other goodies. My program compiles & I can execute my main but when I click on the button that grabs the input I get the following errors.
java.lang.NullPointerException
at Horoscope$ButtonHandler.actionPerformed(Horoscope.java:44)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
I'm not asking for anyone to solve this for me. It's critical that I learn how to troubleshoot and figure out a solution. I was just wondering if there was a site or link on the web that generally discusses what these (and other) errors mean. Or if anybody could tell me what they mean?The Java API documentation is the first place to look. Each exception or error is a class. For instance, information on java.lang.NullPointerException is in the API for the java.lang package, toward the bottom.
For more than that, just search the internet for the name of the exception/error. -
Hello consultant:
We are trying configurated SSO usind SPNEGO module
We have a portal 7.0 ehp1 and Active Directory Microsoft versión 2003 native
we have followed the steps described in note Sap 1457499"Note 1457499 - SPNego add-on"
When we have logged with user Active Directory and we try access to portal we obtain following error:
Authorization check user error
We have Deploy the Web diagtool from SAP Note 1045019 on the J2EE server, run it and perform the
following steps:
1. Select "Component" = "security" and "Activity" = "all"
2. Click the "Go" button, followed by the "Add All" button
3. Select "Component" = "All" and in the "Search pattern" field write "com.sap.security.spnego"
4. Click the "Go" button, followed by the "Add All" button
5. Start the tool
Then we have reproduce the problem and stop the tool. The generated zip file will contain following error:
15:45:20:078 Error J2EE_GST_PRD SAPEngine_Application_Thread[impl:3]_15 ~p.security.spnego.krb5.crypto.DesCrypto Checksum error! checksum: 0xc46bfed8d0dbc54221ee75405c8cd5ac; calculated checksum: 0x6ead7e801608b729a6957597327f2ba5
15:45:20:078 Error J2EE_GST_PRD SAPEngine_Application_Thread[impl:3]_15 ~m.sap.security.spnego.SPNEGOLoginModule Could not validate SPNEGO token.
java.lang.Exception: Checksum error.
at com.sap.security.spnego.krb5.crypto.DesCrypto.decrypt(DesCrypto.java:43)
at com.sap.security.spnego.krb5.KrbEncryptedData.decrypt(KrbEncryptedData.java:81)
at com.sap.security.spnego.krb5.KrbApReq.decrypt(KrbApReq.java:67)
at com.sap.security.spnego.SPNEGOLoginModule.parseAndValidateSPNEGOToken(SPNEGOLoginModule.java:234)
at com.sap.security.spnego.SPNEGOLoginModule.processAuthorizationHeader(SPNEGOLoginModule.java:385)
at com.sap.security.spnego.SPNEGOLoginModule.login(SPNEGOLoginModule.java:102)
at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:185)
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
at java.security.AccessController.doPrivileged(AccessController.java:246)
at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:181)
at com.sap.engine.system.SystemLoginModule.login(SystemLoginModule.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:61)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:699)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:151)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:634)
at java.security.AccessController.doPrivileged(AccessController.java:246)
at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:631)
at javax.security.auth.login.LoginContext.login(LoginContext.java:557)
at com.sap.security.core.logon.imp.SAPJ2EEAuthenticator.logon(SAPJ2EEAuthenticator.java:912)
at com.sapportals.portal.prt.service.authenticationservice.AuthenticationService.login(AuthenticationService.java:367)
at com.sapportals.portal.prt.connection.UMHandler.handleUM(UMHandler.java:126)
at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:181)
at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:541)
at java.security.AccessController.doPrivileged(AccessController.java:246)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:430)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:321)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:377)
at com.sap.portal.navigation.Gateway.service(Gateway.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(AccessController.java:219)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
Could you help us?
Many thanks for your collaboration<< Do not post the same question across a number of forums >>
Maybe you are looking for
-
I'm not able to connect from 9.2 client to 8.1.7.0 database through ODBC
Hi, I'm trying to connect from ORACLE 9.2 client to 8.1.7 DATABASE. The client is on WINDOWS XP. But I'm getting connection timed out error message. What's wrong with that ?
-
USB charges devices but they are not recognized in 'my computer'
I have a A135-S2356. It has 4 USB ports, only 3 are visible in device manager. Only 1 charges/sees my device....iphone charges, laptop external fans runs, external hard drive lights up, but nothing is recognized in 'my computer' I get an error messag
-
Installing Nwtweaver 2004s templates step 10 failing
Step 10 is failing with com.sap.tc.lm.ctc.cul.cpi.exceptions.CPIBaseException: <--Localization failed. Also in report RSPOR_SETUP it does not turn red but shows Existence of BW system cannot be checked automatically. Also the communication test on th
-
Changing import setting in itunes 8 - can't find out how to do it!
I cannot work out how to change the settings relating to the size and quality of music files ripped from CD's. The iTunes help tells me to go into the preference section and click on the advanced tab. However I Cannot see the import settings section
-
Looking for sound solution for J2ME.
Hello everyone, I am wondering how to play sound (for example, .wav, .mp3, etc.) on J2ME platform, especially Foundation profile. Can anyone provide any resources? Thanks in advance, George