Exception and Error
what is difference between exception and error..??
Please do not cross-post
http://forum.java.sun.com/thread.jspa?threadID=5138812&messageID=9509059#9509059
Similar Messages
-
Difference between Exception and Error?
PLz i want this for my interview. PLz describe as much as possible with example.
Valid and nice question
Lets try to understand in Short
Exception and Error are designed to manage unexpected behaviour of an application. If the problem is related to the business logic rule say for an instance If I am having an account in a bank and trying to withdraw more than the balance amount this is a scenario where i m trying to break the business policy of the bank.
This is a kind of situation where exception can be thrown so the program wont exit but the rest of the logic of the withdraw() method wont perform.
Error is something related to the system where we cant programetically manage to avoid that problem like memory problem stack overflow if this is a problem no language help u in managing such a problem so it is an error which cannot be handled -
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. -
Cant understand this exception and error
if i run the below programm am getting this type of error show below.How to cure this error.
<%@ page import="java.util.*;" %>
<%!
String username,password;
Connection myConnection;
Statement stmt,st;
ResultSet rs,rs1,rs2,rs3;
PreparedStatement ps=null;
%>
<%
config=getServletConfig();
username=config.getInitParameter("user");
password=config.getInitParameter("pass");
ServletContext context=getServletContext();
RequestDispatcher reqdis=context.getRequestDispatcher("login.jsp");
RequestDispatcher reqdis1=context.getRequestDispatcher("login.jsp");
if((username.equals(request.getParameter("user")))&&(password.equals(request.getParameter("pass"))))
reqdis.forward(request,response);
else
reqdis1.forward(request,response);
%>
</body>
</html>
HTTP Status 500 -
type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: java.lang.IllegalArgumentException: PWC1222: Path login.jsp does not start with a "/" character
root cause
java.lang.IllegalArgumentException: PWC1222: Path login.jsp does not start with a "/" character
note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1_02 logs.
Sun Java System Application Server 9.1_02how many times you'll post this same question? :-)
in dispatcher servlet "/" is missing
"/login.jsp");give like this
Edited by: Diablo_Chiru on May 15, 2008 4:33 AM -
Consuming a web service in ABAP exception and error
Hi experts,
I have succesfully implemented this example web service http://www.webservicex.net/airport.asmx?WSDL from http://www.webservicex.net/airport.asmx and everything works perfect so I know it is possible.
But my requirement is to implement the following web service: http://ws1.webservices.nl/business/soap_doclit?wsdl it is a document/literal soap web service and WS-I Basic Profile 1.0 compliant. When I try to create a proxy object I get the following errors:
- Exception occurred in library handler
- Incorrect value: Unknown Namespace http://schemas.xmlsoap.org/wsdl
I already found that library handler exception might have something to do with http bindings, I found note 1403271 but as my system is running on release 702 level 0008 this note is obsolete.
Now 2nd error, incorrect value I don't really understand.. I also think the web service is SOAP 1.1 and not 1.2 because that should also give problems according to this topic: Proxy object to consume web service - can anyone verify to be sure? I'm not that familiar with WSDL files but does anyone know what I can test and what I can remove from the web service?
The web service documentation is found here: https://webview.webservices.nl/documentation/files/interfaces/soap/soap-txt.html#SOAP_Interface.Differences_between_SOAP_interfaces
There are also other versions such as RPC/Encoded and one without a header but ALL versions give the exact same error.
Thx!check the beginning of your WSDL file
just after the first line <xml> you should have
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsa="http://www.w3.org/2005/08/addressing"
followed by the namespaces related to your web service if required.
SAP does all the job (generate the web service client) but any very little error in the file (or element not recognized) leads to this message "exception occurred in library handler" and it is not easy to know exactly what is the error... -
Exception and Error Handling from SRDemo giving duplicate errors.
Hi ,
I used code from SRDemo for Exception Handling and its giving me issue that all the error are get duplicate for every exception .
I have debug it because of reportErrors(final PageLifecycleContext ctx) invoked twice with same Exception in it .
Its get duplicated in UI .
Thanks in advance.A small update. I tried again by upgrading the PCO version to 15.0 But still the same.
I did the following 2 test cases:
Unplug the UTP cable to the PLC and write data via PCO query
Disable the agent instance and write data via PCO query
In both cases the PCO Query returned the following output:
Success: 1
LastErrorMessage: <empty>
The only information that I get is in the results but it is not a good practice to interpret this because I don't know all the possible messages.
Result for Case 1:
<?xml version="1.0" encoding="UTF-8"?><Rowsets CachedTime="" DateCreated="2015-03-26T14:13:18" EndDate="2015-03-26T14:13:12" StartDate="2015-03-26T13:13:12" Version="14.0 SP5 Patch 12 (1-okt-2014)">
<Messages>
<Message>PoederMagazijn/ATS PLC/M1 Order Dispatch/ProductDescription: Unspecified error</Message>
<Message>PoederMagazijn/ATS PLC/M1 Order Dispatch/ProductDescription: Operation failed</Message>
</Messages>
</Rowsets>
Result for Case 2:
<?xml version="1.0" encoding="UTF-8"?><Rowsets CachedTime="" DateCreated="2015-03-26T12:11:37" EndDate="2015-03-26T12:11:35" StartDate="2015-03-26T11:11:35" Version="14.0 SP5 Patch 12 (1-okt-2014)">
<Messages>
<Message>PoederMagazijn/ATS PLC/M1 Order Dispatch/OrderQuantityTarget: java.net.ConnectException: Connection refused: connect</Message>
<Message>PoederMagazijn/ATS PLC/M1 Order Dispatch/OrderQuantityConfirmed: java.net.ConnectException: Connection refused: connect</Message>
</Messages>
</Rowsets>
Please advice. I cannot provide any transaction integrity at this time. I would assume this to be one of the base principles of PCO. -
4 Types of exception and the code to handle them
Dear all,
I would like to know wheter runtime exception, errors exception, unchecked exception and checked exception are classified as the 4 types of exception.
What are the java coding of them? please help.There are two main families of exception in Java: checked and unchecked.
The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.
RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.
If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.
Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.
http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html -
Dear Guru's,
I am not able to solve the above issue for last couple of days.
I am newbie to the webservice
My Issue...
I am using Jdeveloper 11.1.2.4.0 Release 2
1. Using Jdev I built one small Web Service with two methods.
While testing the Webservice...
I passed User Id as Parameter and it successfully return the values (user id, user name and description) from fnd_user table
2. I created another application to consume the web service i created.
1. I added the webservice SOAP and added the method.
2. Created a jsf page and drag and drop the parameter and return values to the jsf page.
3. While executing the created jsf page I received the error message as below
"oracle.jbo.NoDefException: JBO-29114 ADFContext is not setup to process messages for this exception. Use the exception stack trace and error code to investigate the root cause of this exception. Root cause error code is JBO-25058. Error message parameters are {0=Attribute, 1=UserName, 2=UserName}"
Even I know that this issue is repeated one in our forum, I was not able to solve this issue.
Can anybody help to solve this issue.
Thanks and Regards,
Durai S EDear Guru's,
I am not able to solve the above issue for last couple of days.
I am newbie to the webservice
My Issue...
I am using Jdeveloper 11.1.2.4.0 Release 2
1. Using Jdev I built one small Web Service with two methods.
While testing the Webservice...
I passed User Id as Parameter and it successfully return the values (user id, user name and description) from fnd_user table
2. I created another application to consume the web service i created.
1. I added the webservice SOAP and added the method.
2. Created a jsf page and drag and drop the parameter and return values to the jsf page.
3. While executing the created jsf page I received the error message as below
"oracle.jbo.NoDefException: JBO-29114 ADFContext is not setup to process messages for this exception. Use the exception stack trace and error code to investigate the root cause of this exception. Root cause error code is JBO-25058. Error message parameters are {0=Attribute, 1=UserName, 2=UserName}"
Even I know that this issue is repeated one in our forum, I was not able to solve this issue.
Can anybody help to solve this issue.
Thanks and Regards,
Durai S E -
Safari has frozen with a dialogue box open that simply makes a statement and then invites a single click on 'ok'. Unfortunately nothing happens except and audible error beep
MartinandJoanne wrote:
Safari has frozen with a dialogue box open that simply makes a statement and then invites a single click on 'ok'. Unfortunately nothing happens except and audible error beep
Are we to guess at the statement? -
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 >>
-
I have been trying to install a piece of software on 2 Windows 7 PCS called Rightfax...during installing I get the error below;
System.Exception: An error occurred during the Microsoft VSTO Tools 4.0 install (exit code was -2146762485).
It then gives me an error log of ;
2015-04-23 14:43:03Z: Error: Unexpected problem occurred in task worker
System.Exception: An error occurred during the Microsoft VSTO Tools 4.0 install (exit code was -2146762485).
at CommonInstall.Tasks.InstallTask.LaunchInstall(String friendlyName, String exe, String args, Int32[] exitCodesToIgnore)
at CommonInstall.Tasks.InstallVSTO.OnRun(ITaskFeedback feedback)
at TaskWizard.Task.Run(ITaskFeedback feedback, Boolean recurse)
at TaskWizard.TaskWorker.RunTasks()
at TaskWizard.TaskWorker.OnDoWork(DoWorkEventArgs e)
2015-04-23 14:43:03Z: Error: Problem in sequence or one of its pages
System.Exception: An error occurred during the Microsoft VSTO Tools 4.0 install (exit code was -2146762485).
at CommonInstall.Tasks.InstallTask.LaunchInstall(String friendlyName, String exe, String args, Int32[] exitCodesToIgnore)
at CommonInstall.Tasks.InstallVSTO.OnRun(ITaskFeedback feedback)
at TaskWizard.Task.Run(ITaskFeedback feedback, Boolean recurse)
at TaskWizard.TaskWorker.RunTasks()
at TaskWizard.TaskWorker.OnDoWork(DoWorkEventArgs e)
at CommonInstall.PreparationWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
2015-04-23 14:43:03Z: Error: Problem in sequence or one of its pages
System.Exception: An error occurred during the Microsoft VSTO Tools 4.0 install (exit code was -2146762485).
at CommonInstall.Tasks.InstallTask.LaunchInstall(String friendlyName, String exe, String args, Int32[] exitCodesToIgnore)
at CommonInstall.Tasks.InstallVSTO.OnRun(ITaskFeedback feedback)
at TaskWizard.Task.Run(ITaskFeedback feedback, Boolean recurse)
at TaskWizard.TaskWorker.RunTasks()
at TaskWizard.TaskWorker.OnDoWork(DoWorkEventArgs e)
at CommonInstall.PreparationWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
2015-04-23 14:43:03Z: Info: Page changed from 'WizardWorkerPage' to 'ResultPage' driven by result 'Next' and exception 'none'
2015-04-23 14:44:06Z: Info: Page changed from 'ResultPage' to 'none' driven by result 'Next' and exception 'none'
2015-04-23 14:44:06Z: Info: Work has not been completed; install state will not be saved.
2015-04-23 14:44:06Z: Info: Reboot status = NotRequired
2015-04-23 14:44:06Z: Info: Exitcode = 0
2015-04-23 14:44:06Z: Info: Logging ended.
I have installed this software succesfully on other machines previously.....Hi RyanWelsh78,
This forum is discussing about Visual Stuido Tools for Office developing, your issue is related with the installing Rightfax add-in which is a third party product. As the reply from Eugene, you could contact Rightfax add-in developers for help.
Thanks for your understanding.
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
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:56Hi,
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 -
Error Handling and Error Messages
I already posted this in the java programming forum, but I dont think the people responded understand patterns, or what I was asking. Here is my original post, for reference I am not asking how to catch and exception, or how to display an error, I am asking about the pattern implementation.
I am currently in the process of creating my Exception model for my program, and I have a question about error messages. I was reading the book "Effective Java Programming" which deals with patterns and it states that an exception should state the error and report information on all relavent states. For instance If you have a class the modeled some sort of memory array, and an access was requested to a block of memory outside the array you should throw an ArrayIndexOutOfBoundsException("Index:" + index + ", start:" + 0 + ",end:" + Array.length) or if you made your own MemoryAddressOutOfBoundsException(same as above) which when printed should read
ArrayIndexOutOfBoundsException: Index:-1, start:0, end:0
stack trace
The pertinate information is the index, start index, and end index.
The book CLEARLY states as an industry design pattern that exceptions weather checked or unchecked should not contain user error messages. For instance with the above example one might be tempted to use this as the exception message: "The memory addres index is not a valid memory address." This is clearly a user error message.
So heres my situation. In a gui environment (command line console not visible) how do you generated a user error message, letting the user know that an internal exception has occured.
In my previous implementation of my project, I used the exception message the user error message and just reported the message on a dialog. I have heard of people using error catalogs, which centrallizes all the error messages into a single class or file.
I was wondering if and Error catalog was a good approach, how I might go about implementing one, and if not how do you the community handle user error messages.class MyAppErrors {
public static final int FILE_NOT_FOUND = 0;
public static final int DIR_NOT_FOUND = 1;
public stat final String[] errMsgs = {
"The file was not found.",
"The directory was not found.",
public String getErrMsg( int n ) { return errMsgs[n]; }
[\code]
And a nicer version would allow the calling code to pass in a substring so you could say "The file 'somename.ext' was not found." -
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 -
Native exception: IDispatch error #17460
Hi all!
Have you ever seen error message like this?
The request is not yet finished. The request was waiting for a reply from the host.] (612,PTDispatch.cpp)]
com.plumtree.server.marshalers.PTException: Native exception: IDispatch error #17460 (0x80044634): [Exception thrown at HttpGadgetProviderObject.cpp(1601): The Portal Server timed out while waiting for a reply from the host for this gadget. If this problem persists, please alert a system administrator.[/pre][pre]
The request is not yet finished. The request was waiting for a reply from the host.] (612,PTDispatch.cpp)
at com.plumtree.server.marshalers.PTDispatch.invokeRetObject(Native Method)
at com.plumtree.server.CIPTGadgetGateway.GetContent(CIPTGadgetGateway.java:65)
at com.plumtree.portalpages.browsing.gateway.GatewayControl.CheckActionSecurityAndExecute(GatewayControl.java:291)I get it, when I use setSettingValue(__) method of IPortletContext object, and there are too long setting values. (I think so.)
But I have no idea for the real reason :o/
Do you have?
But more important is: How can I solve this problem?
Cheers;
TociI'm crawling SQLDatabase. Actually, in that DB, there are indexed text which is already indexed from the other backend system.
The getDocument method is returning the url that a text is located in the other backend system.
I'm not using DocFetch, but now I think I have to use that.
Thank you for your helping
-Young-Jin
Maybe you are looking for
-
How to select columns from internal table using 'GUI_DOWNLOAD' ?
Hi, i am running a report & the fields for output is saved in an internal table which has as many as 10 fields. But I want to select only a few fields for output. There is a option COL_SELECT in function 'GUI_DOWNLOAD'. How to use it. If possible wit
-
I have been working in Lightroom 4.3 for MAC. From there I open 2 files to edit in Photoshop as layers so I can add a layer mask to the bottom layer and use the paint brush tool to make certain areas of the image darker or lighter. I have been doing
-
Why can't I preview indd files within InDesign's open file dialog box?
Hello all, It is bad enough that Adobe doesn't add a plugin to preview any Adobe source file within Windows Explorer (well, except for PDF but I think Microsoft did that). But I find it ridiculous that I cannot preview .indd source files inside InDes
-
Hello, I have a subsidiary in Taiwan using SBO2007B SP00 PL10. I want to upgrade it to SBO 8.81 PL04 with SQL Server 2008 R2. They are currently using a local addon used to cover legal requirement about VAT declaration. GUI VAT Add-on from ITTS. I w
-
Transaction code for Mass reprint of PO's
Hi ALL, Please suggest me any SAP Standard Code for reprinting thousands of PO's for certain vendors.I know ME9F & ME99,other than these tcodes. Thanks & Regards, Manjula