Problem with exceptions
hello all.
plz take a look at this code
try {
} catch (Exception e1) {
System.out.println("execption 1");
try {
} catch (Exception e2) {
System.out.println("execption 2");
what i want to do is if i have an execption in the first try, i dont want to execute the second one, like an if else block, and i dont want to use an GOTO ...
and i dont know how to do it.
can someone help me out plzzz.
Lazy OP.
try{
try{
methodOne();
catch(Exception x){
handlingOne();
throw x;
try{
methodTwo();
catch(Exception x){
handlingTwo();
throw x;
catch(Exception x){
beesAndFlowers();
OR:
boolean onedone = false;
try{
methodOne();
onedone = true;
methodTwo();
catch(Exception x){
if( onedone ) handlingTwo(); else handlingOne();
OR:
boolean oneok = true;
try{ methodOne() } catch(Exception x){ oneok = false; handlingOne(); }
if( oneok ){
try{ methodTwo() } catch(Exception x) { handlingTwo() }
ET CAETERA.
Similar Messages
-
Problem with Exceptional Aggregation
Hi Gurus
I have problem with Exceptional Aggregation.I have a cube which as following data
Plant , Fromcostcenter,ToCostcenter, g/l,fiscalyear/period, allocation %,amount
1 101234 102355 888881 001/2006 10 1000
1 101234 102355 888881 002/2006 10 1000
1 101234 102345 888882 001/2006 10 1000
1 101234 102346 888893 001/2006 90 1000
1 101234 102346 888893 002/2006 90 1000
1 101234 102346 888984 001/2006 90 1000
I need summarized report as follows
Fromcostcenter tocostcenter allocation%
101234 102355 10
101234 102346 90
But iam getting report as follows
101234 102355 30
101234 102355 270
The allocation% keyfigure should not be accumulated, so for this i specified Exceptional aggregation but not worked.
Any Suggestions,please help me.
Thanks
RaghuHi
I am also having same problem. Did you get a solution for your problem? Can you please tell me how did u manage to display 10 and 90 instead of 30 and 270?
I also tried exceptional aggregation if more than one value. but not working.
Thanks -
Query Problem With Exception Aggregation
Hello,
I have two I/O 0Customer and 0Cont_Acct and also I have a Infoset made out of both. Here is the problem i am trying to solve,
I want to figure out the customers who has more than five contract accounts associated with each customer number.
Here is the solution I approached....
1) Created a formula variable counter on the KF # of data records (which is provided in the Infoset automatically ) with exception aggregation total while referencing the contract acct I/O.
2) Kept my customer # and Contract acct on my rows area.
The results I am getting is less than satisfying. I am expecting this output below.
Customer # Cont Acct Total No of Cont.acct
A 1001 1
1002 1
1003 1
3
B 1007 1
I would appreciate anybody's help in this. Thanks a lot.
-AHi,
We have the same problem and raised an OSS ticket. They replied us with the note 1257455 which offers all ways of improving performance in such cases. I guess there s nothing else to do, but to precalculate this exception aggregated formula in data model via transformations or ABAP.
By the way, cache can not help you in this case since exc. agg. is calculated after cache retrieval.
Hope this helps,
Sunil -
Problem with exceptions in the query designer
Hi all,
i got this problem, there is a formula, than calculate "A" %A "B", This bring a value %, ok.
in my exceptions i got this ranges:
1 to 99,4 Bad 9
99,5 to 100 Good 1,
i execute the query and this bring the results, when there is a line with value 99,5, this appear without color, the rest is ok,
why this happend? whats the solution? please guys, i'll award youi m sorry the values are
0 to 99,4 Bad 9
99,5 to 100 Good 1
i solve it by this way
0 to 99,49999999999 Bad 9
99,5000000001 to 100 Good 1
i looks like the internal value of the KF is with a lot of decimal, the problem here is, when the value is 99,5 exactly, dont appear color, but i dont know how else solve it, any advice? -
DataBaseMetadata.getAttributes - Problem with Exception
I am Using Oracle 10g and have an exception when I run this code:
public void getAttributes(String schema, String type){
try{
md=conn.getMetaData();
rs=md.getAttributes(null,"SYSTEM","TABLE1", null);
while(rs.next()){
System.out.println(rs.getString("ATTR_NAME"));
}catch(SQLException ex){
System.out.println(ex.getSQLState());
System.out.println(ex.getErrorCode());
System.out.println(ex);
The Error code which is written by System.out.println(ex), it might be in greek font and doesn't appear in distinguishable font, so I can't understand in what the error refers to.
The ex.getSQLState() has the value null
and
the ex.getErrorCode() has the value 17023
I try it and the exception is triggered in this line:
rs=md.getAttributes(null,"SYSTEM","TABLE1", null);
Can someone help me with what this problem might be?If you want to use a JDBC standard technique and don't want to query Oracle's dictionary tables (such as USER_TABLES or ALL_TABLES), then your choices are pretty much DatabaseMetaData and ResultSetMetaData.
In my limited experience, both of these work fine on Oracle 10g; I don't understand why you're having problems.
You might try testing against a different schema, something other than SYSTEM. SYSTEM is special, and it wouldn't surprise me if it was different here. Also, SYSTEM should never ever ever be used for anything but Oracle's own database objects; if you have used SYSTEM for your own things, I would encourage you to reinstall your database, or at least to stop immediately. Also, your programs should never connect to the database as the SYSTEM user; only DBAs shuld use this account for the (very rare) upgrade and maintenance tasks that require it; most DBA tasks should be done from a seperate account that has been granted the DBA role. -
Problem with Exception Worksheet using Data from Supply Plan Data Table
I added a series for a flag that indicates whether product is sourced from multiple manufacturing sites for a given customer and item. The flag is on the supply plan data table because it depends on the scenario. I created an exception worksheet for when the flag is set but all combinations are being displayed. If the flag is not set for a given combo then "Selected Page Item has No Data" is displayed in place of the table. I want only the combinations that meet the exception to be shown. I tried setting up an exception worksheet for customer shipments which is also on the supply plan data table but saw the same issue with all combinations being displayed whether or not the condition is met. Does anyone know of any issues with using exception worksheets with the supply plan data table? I searched the documentation and saw that exceptions behave differently with promotion series but this isn't a promotion.
I'm using Demantra version 7.2. Thanks for any help!
Edited by: user9253208 on Mar 30, 2010 6:40 AMThanks. We have come up with a workaround. While the combinations on the left are not affected by the exception, the data in the main table is so we moved as many levels as possible into the table. The performance is slow but the data is more useful, especially when exported into Excel. I was hoping for a better solution but I guess we'll just have to stick with what we've come up with.
-
Hi,
I don't understand why I get a error here, any help really appreciatet :)
this is the error I get from the last catch block:
Unreachable catch block for IOException. This exception is never thrown from the try statement body
import java.io.*;
import java.net.*;
public class OutputThread extends Thread
PrintWriter write;
protected static Socket out;
protected static DataOutputStream output;
protected String choice = "";
protected String newProduct = "";
protected String newPrice = "";
protected String newAmount = "";
public OutputThread (Socket clientSocket)
out = clientSocket;
write = null;
public void setChoice(String choice)
this.choice = choice;
public void addProduct(String newProduct, String newPrice)
this.newProduct= newProduct;
this.newPrice = newPrice;
public void addSale (String newProduct, String newAmount)
this.newProduct = newProduct;
this.newAmount = newAmount;
protected static void initialize()
try
output = new DataOutputStream(out.getOutputStream());
catch(IOException e)
System.out.println(e.getMessage());
public void sendData(double data)
try
output.writeDouble(data);
catch(IOException e)
System.out.println(e.getMessage());
public void run()
try
write = new PrintWriter(out.getOutputStream(), true);
catch (UnknownHostException e)
System.out.println(e.getMessage());
System.exit(1);
catch (IOException e)
System.err.println(e.getMessage());
System.exit(1);
try
BufferedReader stdIn = new BufferedReader(
new InputStreamReader(System.in));
String userInput;
while (!choice.equals(null))
if(choice.equals("1"))
write.println("addProduct");
userInput = newProduct;
write.println(userInput);
userInput = newPrice;
write.println(userInput);
choice = "0";
else if(choice.equals("2"))
write.println("addSales");
userInput = newProduct;
write.println(userInput);
userInput = newAmount;
write.println(userInput);
choice = "0";
else if(choice.equals("3"))
write.println("getTotalValue");
choice = "0";
catch(IOException e)
System.out.println(e.getMessage());
}I mena that in here make your try and catch statement consecutive with each other.
ry
BufferedReader stdIn = new BufferedReader(
new InputStreamReader(System.in));
String userInput;
while (!choice.equals(null))
if(choice.equals("1"))
write.println("addProduct");
userInput = newProduct;
write.println(userInput);
userInput = newPrice;
write.println(userInput);
choice = "0";
else if(choice.equals("2"))
write.println("addSales");
userInput = newProduct;
write.println(userInput);
userInput = newAmount;
write.println(userInput);
choice = "0";
else if(choice.equals("3"))
write.println("getTotalValue");
choice = "0";
catch(IOException e)
System.out.println(e.getMessage());
} -
Problem with Exception - "Content not allowed in Prolog"
I was using org.w3c.dom package to handle all my XML data in JDK 1.4.1 environment. Recently, I have upgraded my Java version to JDK 1.5. When I run my code, while parsing the XML data, it is throwing an Exception - "Content not allowed in Prolog". I know that this Exception is because the XML data does not contain xml declaration in prolog.
But, I have the code that queries the database and builds the records in XML format. The sample XML is as follows.
<list>
<row>
<fld1>Val1</fld1>
<fld2>Val2</fld2>
</row>
<row>
<fld1>Val3</fld1>
<fld2>Val4</fld2>
</row>
</list>
I want to know why the JVM is validating for XML declaration? Why can't it continue parsing the XML in case it is well formed? Is there any way so that I can skip this validation?
Please reply. I am in a big trouble because, in case some changes are required, I need to implement in many places of my API.The isELIgnored flag just fixes this page.
If you want to use EL on your pages a better solution is to update your web.xml file:
EL Expressions in JSP2.0 containers:
In order to evaluate EL expressions, your web.xml file must be up to date.
If web.xml states that it is version 2.3 or less, then EL evaluation is disabled by default for backwards compatibility.
So if your web.xml starts with this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>Replace it with this
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
Cheers,
evnafets -
Problem with exception raised in UDM_GENWL
Exception "CNTRL ERROR" is raised when UDM_GENWL transaction code is to be executed in background. Please tell me how to correct that one.
Please reply whether I have to apply any SAP-NOTE
-
Problem with exception aggregation
Hi forums,
Can any one help in this issue?
We checked the data in the ECOM cube for the order 63349312 where it is giving 6 records eventhough we are deleting the adjacent duplicates of the order number in the start routine. (Is it like the deletion of adjacent duplicates happen in data packet level instead of happening in the entire cube level? B'cos the same order might present in the different packets.)
Hence the data is aggregating for the key figure, 'Number of Days' in the ECOM report. But if we check the keyfigure properties in the RSA1, there we selected the Exception Aggregation as 'First Value' and aggregation reference char as 'ZN_CORD' (Order number). Still it is aggregating the number of days value in the report.
Regards,
Charan.Hi Rohit,
We are doing same procedure as you mentioned. We assigned order number as refer characteristic to keyfigure No. of days in infi object level. But this operation is not working in report level
Order number ZCUDATE ZN_GSTRP ZN_CORDKF ZN_DAYSKF
63349312 18.01.2009 01.10.2008 1,000 109
63349312 18.01.2009 01.10.2008 1,000 109
63349312 18.01.2009 01.10.2008 1,000 109
63349312 18.01.2009 01.10.2008 1,000 109
63349312 18.01.2009 01.10.2008 1,000 109
63349312 18.01.2009 01.10.2008 1,000 109
I want o/p as
Order number ZCUDATE ZN_GSTRP ZN_CORDKF ZN_DAYSKF
63349312 18.01.2009 01.10.2008 1,000 109
but it is showing as
Order number ZCUDATE ZN_GSTRP ZN_CORDKF ZN_DAYSKF
63349312 18.01.2009 01.10.2008 1,000 676 -
****problems with my blackberry curve 8520 ****
Hi,
I'm having problems with excepting people and being excepted myself on bbm ???
Iv tried scanning barcodes and by pin entries in every way I can figure out to do ,and I'm out of ways now !!
All that comes up is its pending on my phone and others phones !
I'm also unable to be Bluetooth anything or for me to Bluetooth anyone ???!!
Please help as its driving me insaneSounds to me like you don't have a plan that has data on it, or a plan that doesn't include social networking. Call your cell phone company and ask what your plan includes or visit the website and log in using your details and see what your plan includes.
Did i help you with this problem? if so please show your appreciation by clicking the Like button inside of my post. Please remember I am not a RIM employee the support forums are user-to-user, not user-to-RIM. -
In my Iphone 5, Nothing on my App Store is working, its displaying blank (Except for Genius section). I've tried to uninstall and install itunes and all its component in my desktop but still it doesn't fix the app store issue. Not sure if its problem with apple servers. Someone help please!
settigns>itunes and app store to make sure you are signed in.. If you are, you will see your account name..... anyhow, click your account name, sign out and sign back in
also go to to settings>general>reset and reset network settings... if that doesnt work settings>general>reset and reset all settings!
one of those shall work. The last step would be to restore your device (apple.com/support) HT1414 -
Unexpected problem: uncaught exception when working with audio files in Soundtrack Pro
Hey,
Whenever I double click an audio file in the timeline to work on it, I end up getting the Error message: "Unexpected problem: uncaught exception" and Soundtrack Pro eventually crashes. Also, this happens when I try to work with audio files in the file editor. I have Leopard and am using Logic Studio 8. Any insight would be much appreciated. Thanks
MattDidnt know how to remove the original clip from the STP arrange window - or whatever it's called in STPro. So I could go no further in my perverse science experiment.
It also appeared that I could only import an aif but not a wav?
I gave up on STPro and did what I needed to do in Logic, which I use regularly.
Thank you for folowing up on this.
PS. I used to use an old PowerPC version (1.0.3) of STPro and loved the way it visually showed the change in the waveform when you added each efffect. It appears that the new version (3.0.1) does not allow you to do this anymore? You can render or flatten the effects to see the final waveform, but then you are dead in the water and cant make changes?
Im such a newbie at STPro that I am probably not using it right? -
Attempt to process file failed with Exception in XML Parser-format problem
Hi all,
Iam getting an unusual error in the J2EE stack in XI.
And the message is:
006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)' 2006-11-30 17:31:07 Error Exception caught by adapter framework: null 2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
My scenerio iam posting IDOC to a flat file with content conversion in the receiver side,the mapping got executed successfully and in the audit log i found that the error was after the 'Start converting XML document content to plain text'.
This means that error occured during content conversion of XML to the prescribed file format.
Can anyone suggest any better approach using which we may trace the junk data in IDoc. Manual adhoc approach could take time and is error prone.
Thanks in advance...
karunHi Bhavesh,
Thanks for the early reply. I checked the mapping and everything is fine and the output is also in valid XML format.
The audit log shows that the mapping got executed successfully and the error is after the step 'Start converting XML document content to plain text '. Is there any constraint in the file adapter regarding the message size for parsing.
2006-11-30 17:30:50 Success Transfer: "BIN" mode, size 2912595 bytes, character encoding -
2006-11-30 17:30:50 Success Start converting XML document content to plain text
2006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)'
2006-11-30 17:31:07 Error Exception caught by adapter framework: null
2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
2006-11-30 17:31:07 Success The asynchronous message was successfully scheduled to be delivered at Thu Nov 30 17:36:07 GMT 2006.
2006-11-30 17:31:07 Success The message status set to WAIT.
2006-11-30 17:31:08 Success Acknowledgement creation triggered for type: SystemErrorAck
2006-11-30 17:31:08 Success Acknowledgement sent successfully for type: SystemErrorAck
2006-11-30 17:36:08 Success Retrying to deliver message to the application. Retry: 1 -
HT204088 i am having a problem with my previous payment, its not excepting it?
i am having a problem with my previous payment, its not excepting it?
Redemption Code Help
http://helpx.adobe.com/x-productkb/global/redemption-code-help.html
If you just purchased the software and the redemption codes are coming up as invalid then the seller needs to resolve that. If you were able to acquire the serial number by redeeming the redemption code, then you should follow the seller's advice and contact Adobe support thru chat (when they are available).
Chat support - For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
Make sure you are logged in to the Adobe site, have cookies enabled, clear your cookie cache. If it fails to connect try using a different browser.
Serial number and activation chat support (non-CC)
http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )
Maybe you are looking for
-
How can i install my creative cloud on my windows 8 computer my laptop is an hp
It not letting me download what other options that you can give in order for me to download programs to my computer. Can you please help me???
-
When I try to print, it does not even appear to "connect" to the printer software. Normally, a printer icon will pop up in the taskbar, but this does not happen with Firefox. Also, in Mac, you have the option of saving the webpage as a pdf document.
-
Error using View Object in a optionList ?
Hello, I'm use JDeveloper 9.0.3, BC4J+UIXml, and I have a Create form with a optionList tag, populating with a Object View. I create a Object View called TipoLocalView. My code: <bc4j:messageChoice name="Tipo" attrName="SeqTipoLocalCampus" prompt="Ti
-
Chromium and the clipboard issue
I don't know how many of you guys are using pwsafe as password manager. It is a CLI application that stores usernames and passwords which are protected by a master password. Basically the command pwsafe -up puts first username and then password in th
-
IDOC to IDOC using IWay Adapter?
Hi, I believe I have sent my post to the wrong forum. Sorry about that. Can anyone here help? Please. The post I am talking about is: IDOC to IDOC using IWay Adapter? P.S.: How can I move that post to the right forum? Regards