Sometimes exception is not catched
I have a strange problem.
This is the code of the calling method:
String returnValue = null;
try {
returnValue=myObject.myMethod()
catch (MyException ex) {
returnValue="abc";
} This is the code of the called method:
public String myMethod throws MyException {
if ( something ) {
throws new myException()
}Sometimes I find the stack trace in the standard output as if the exception is not catched.
This makes me crazy.
Does somebody know what's going on ?
Are you using:
throws new myException();
or
throw new myException();
? There is a difference; "throw" actually creates the error, but "throws" just watches for one.
Hope this helps,
SI
Similar Messages
-
Catcherror event "catch all system exceptions" is not catching subLanguageExecutionFault
catcherror event "catch all system exceptions" is not catching subLanguageExecutionFault in BPM process
hi rani,
thanks for the response
i supply all the connection details(gatewayhost, gatewayservice, programid, clinet, systemnumber, applicationhost, userid, password etc.) to the program which extends "JCoIDoc.Server".
the program is taking care of all the connection establishment details.but still m facing the same problem.
i have also confirmed that the user is a communication user, not a dialogue user.
thanks
pavan -
Can not catch in servlet exception thrown by EJB
Hello everybody.
I created an exception class InvalidDataException derived from Exception. This exception is thrown in an EJB session.
In my servlet I wrote two catch blocks. The first one is :
catch(InvalidDataException ex) and the second one is catch(Exception ex).
The InvalidDataException is not catched in the InvalidDataException block but in the Exception block. And in the Exception block I display the class of the catched exception, the class is the class of my InvalidDataException.
I hope my explanation is clear...
Any ideas ??
Thank you for your help
Here is the stacktrace, there are french words, dont be afraid :-)
10:20:48,261 INFO [STDOUT] avant lancement exception invalidData
10:20:48,264 ERROR [[BookServlet]] Servlet.service() for servlet BookServlet threw exception
pipeline.MyExceptions.InvalidDataException: La date de d\uffffbut doit \ufffftre ant\uffffrieure \uf
fff la date de fin du projet
at pipeline.ejb.FacadeBean.verifDates(FacadeBean.java:169)
at pipeline.ejb.FacadeBean.reserverRess(FacadeBean.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta
iner.java:228)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI
nterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance
Interceptor.java:169)
at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.
java:71)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:206)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.
java:136)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:643)
at org.jboss.ejb.Container.invoke(Container.java:917)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)
at $Proxy110.reserverRess(Unknown Source)
at pipeline.web.BookServlet.doPost(BookServlet.java:235)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.ja
va:174)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Htt
p11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)Hello,
I fix my problem. I included the class InvalidDataException in the *.war and in the *.jar so there were 2 definitions of InvalidDataException. Thats why my exception was not catched.
Bye -
CatchAll does not catch exception in ora:translateFromNative
Hello,
In a BPEL process, I have an Assign step where I use the ora:translateFromNative function. There is a CatchAll around the Sequence. When I provide wrong data in the inputvariable for the native translation (for instance a typo in the root element name), the XPATH function fails but the CatchAll does not catch this. Furthermore, the process state is not dehydrated so in the BPEL console you don't see anything about this. The log file however shows the following information:
<2007-06-25 13:31:01,723> <ERROR> <default.collaxa.cube.engine.dispatch> <BaseScheduledWorker::process> Failed to handle dispatch message ... exception ORABPEL-05002
Message handle error.
An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.PerformMessage"; the exception is: XPath expression failed to execute.
Error while processing xpath expression, the expression is "ora:translateFromNative(bpws:getVariableData('ReceiveBodConfirmation_confirm_InputVariable','payload','/client:PlasPOImportConfirmRequest/client:request'),'mro_confirm_bod.xsd','CONFIRM_BOD_002')", the reason is FOTY0001: type error.
Please verify the xpath query.
My gut feeling after reading this is that an exception occurs while BPEL is creating the fault that should be thrown.
In any case, this behaviour prevents me from creating a robust BPEL process. Any ideas on how I could deal with this would be much appreciated.
Kind regards,
PeterHoi Peter,
Is the message still in the recovery area? So BPEL is thinking that it is a runtime error and could be revoverd?
Did you log a TAR?
Marc -
Exception is not caught in the catch.
Hi,
In my application an exception is thrown but it doesn get caught in the inner catch but at the outermost catch.
809 throw Exception("Cannot Assign", 1120,)
(dbx) next
dbx: warning: can't find symbolic information for thrown type (missing N_LSYM/YR stab?)
dbx: warning: can't find symbolic information for thrown type (missing N_LSYM/YR stab?)
t@3 (l@3) exception will transfer flow to or past '_ex_debug_handshake1'
Use step or next to get to the catch location
stopped in __exdbg_notify_of_throw at 0xfb794a3c
0xfb794a3c: __exdbg_notify_of_throw : retl
dbx: warning: can't find symbolic information for thrown type (missing N_LSYM/YR stab?)
(dbx) where
current thread: t@3
=>[1] SelectionImpl::AssignCart(this = 0x4ab9f8, cart = CLASS), line 809 in "RouteImpl.cpp"
[2] Selection::AssignCart(this = 0x556de8, cart = CLASS), line 477 in "Route.cpp"
[3] CaseBase::RetailRoute(this = 0x4508d0), line 1595 in "CaseBase.cpp"
[4] CaseBase::Assignment(this = 0x4508d0), line 1542 in "CaseBase.cpp"
[5] CaseBase::acceptCart(this = 0x4508d0, cartNbr = CLASS), line 1175 in "CaseBase.cpp"
[6] CaseIF::acceptCart(this = 0x472f40, cartNbr = 0x4c66b8 "00010", error = CLASS), line 515 in "CaseIF.cpp"
AssignCart throws an exception which should get caught in CaseBase::AssignCart instead it gets caught in the catch block of CaseIF::acceptCart.
Thanks in advance for your help.
Thanks,
Santosh A.Exceptions/Errors are thrown and catch the same for static and non-static methods.
You cannot have fields or methods which are "outside" a class.
The only thing "outside" a class is a package, AFAIK.
The reason your exception is going to the console if because the exception is not being caught.
So is there anyway I can catch this exception and do a gracefully exit using the a static method?You need to place a try catch for this exception. Have a look at the stack trace to see where you could place this to catch the exception. -
EJB adapter errors are not catched by the composite fault handler
Hi,
I got a serious problem in soa suite 11g ps3 that ejb adapter failures are not catched by the soa suite fault framework.
for example when I do a persist of an entity on a EJB session bean and I dont provide all required fields I get a rollback error when the BPEL component is finished.
Instance ID bpel:142089
The transaction was rolled back. The work performed for bpel instance "142089" was rolled back, but the audit trail has been saved for this instance
Error Code: 1400
Call: INSERT INTO INFORMATIELEVERINGEN (ID, DATUM_BEWAREN_TOT, BEWAARTERMIJN_IN_DAGEN, GEBRUIKER, ADRES_WAARNAAR_VERSTUURD, OUTPUTPRODUCT_TYPE, INTERMEDIAIR_PRODUKT, INHOUD_VERSTREKKING, RIN_ID, DETAIL_3, DETAIL_1, DETAIL_2, KETEN_OBJECT_TYPE, ORG_ID, TIG_ID, DATUM_SAMENSTELLING, KETEN_OBJECT_ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
bind => [314, null, null, null, test, null, null, null, null, null, null, null, null, 1, 1, 2011-09-27, 42]
Query: InsertObjectQuery([email protected])
This error contained an exception thrown by the message handler.
Check the exception trace in the log (with logging level set to debug mode).
ORABPEL-05002
Message handle error.
error while attempting to process the message "com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessage"; the reported exception is: Error committing transaction:; nested exception is: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("VSG"."INFORMATIELEVERINGEN"."OUTPUTPRODUCT_TYPE")
what I did is to set idemponent = false on the partnerlink but then the invoke fails instead of the bpel ( same error ) and still no compensate or catch in bpel.
Added the fault policies to the composite and rethrowed the error to BPEL. Still no luck.
But then replaced the EJB adapter with the db adapter which does the same insert as the EJB and I got a nice bpelx:bindingFault which I can catch and handle.
thanksHere is the total error message
[2011-09-29T19:33:28.316+02:00] [soa_server1] [ERROR] [] [oracle.soa.bpel.engine.dispatch] [tid: orabpel.invoke.pool-4.thread-3] [userId: <anonymous>] [ecid: 4af4f9da03d6b2c4:-1e444ff3:132b61dbaea:-8000-0000000000000312,0:1:100000005] [APP: soa-infra] failed to handle message[[
java.sql.SQLIntegrityConstraintViolationException: ORA-01400: Kan geen NULL invoegen in ("HR"."INFORMATIELEVERINGEN"."OUTPUTPRODUCT_TYPE").
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1079)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1466)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3887)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1508)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:172)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:788)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:863)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:583)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:526)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeCall(AbstractSession.java:980)
at org.eclipse.persistence.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:131)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:206)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:192)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:341)
at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:162)
at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:177)
at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:465)
at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80)
at org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90)
at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:290)
at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:740)
at org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:643)
at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108)
at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2908)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1291)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1273)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1233)
at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:224)
at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:123)
at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3348)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1422)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:610)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1527)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:3181)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(RepeatableWriteUnitOfWork.java:332)
at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:157)
at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:68)
at weblogic.transaction.internal.ServerSCInfo.doBeforeCompletion(ServerSCInfo.java:1239)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1214)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:116)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1316)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2132)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:272)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:239)
at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:622)
at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetry(BaseLocalObject.java:455)
at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:52)
at com.collaxa.cube.engine.ejb.impl.bpel.BPELDeliveryBean_5k948i_ICubeDeliveryLocalBeanImpl.handleInvoke(Unknown Source)
at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:35)
at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:140)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.process(BaseDispatchTask.java:88)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTask.java:64)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
[2011-09-29T19:33:28.332+02:00] [soa_server1] [ERROR] [] [oracle.soa.bpel.engine.dispatch] [tid: orabpel.invoke.pool-4.thread-3] [userId: <anonymous>] [ecid: 4af4f9da03d6b2c4:-1e444ff3:132b61dbaea:-8000-0000000000000312,0:1:100000005] [APP: soa-infra] Failed to handle dispatch message ... exception ORABPEL-05002[[
Message handle error.
error while attempting to process the message "com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessage"; the reported exception is: Error committing transaction:; nested exception is: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: ORA-01400: Kan geen NULL invoegen in ("HR"."INFORMATIELEVERINGEN"."OUTPUTPRODUCT_TYPE").
Error Code: 1400
Call: INSERT INTO INFORMATIELEVERINGEN (ID, DATUM_BEWAREN_TOT, BEWAARTERMIJN_IN_DAGEN, GEBRUIKER, ADRES_WAARNAAR_VERSTUURD, OUTPUTPRODUCT_TYPE, INTERMEDIAIR_PRODUKT, INHOUD_VERSTREKKING, RIN_ID, DETAIL_3, DETAIL_1, DETAIL_2, KETEN_OBJECT_TYPE, ORG_ID, TIG_ID, DATUM_SAMENSTELLING, KETEN_OBJECT_ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
bind => [7, null, null, null, test, null, null, null, null, null, null, null, null, 1, 1, 2011-09-29, 42]
Query: InsertObjectQuery(nl.justid.verstrekkingen.model.entity.Informatielevering@2499c09)
This error contained an exception thrown by the message handler.
Check the exception trace in the log (with logging level set to debug mode).
ORABPEL-05002
Message handle error.
error while attempting to process the message "com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessage"; the reported exception is: Error committing transaction:; nested exception is: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: ORA-01400: Kan geen NULL invoegen in ("HR"."INFORMATIELEVERINGEN"."OUTPUTPRODUCT_TYPE").
Error Code: 1400
Call: INSERT INTO INFORMATIELEVERINGEN (ID, DATUM_BEWAREN_TOT, BEWAARTERMIJN_IN_DAGEN, GEBRUIKER, ADRES_WAARNAAR_VERSTUURD, OUTPUTPRODUCT_TYPE, INTERMEDIAIR_PRODUKT, INHOUD_VERSTREKKING, RIN_ID, DETAIL_3, DETAIL_1, DETAIL_2, KETEN_OBJECT_TYPE, ORG_ID, TIG_ID, DATUM_SAMENSTELLING, KETEN_OBJECT_ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
bind => [7, null, null, null, test, null, null, null, null, null, null, null, null, 1, 1, 2011-09-29, 42]
Query: InsertObjectQuery(nl.justid.verstrekkingen.model.entity.Informatielevering@2499c09)
This error contained an exception thrown by the message handler.
Check the exception trace in the log (with logging level set to debug mode).
at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:207)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.process(BaseDispatchTask.java:88)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTask.java:65)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:887)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:909)
at java.lang.Thread.run(Thread.java:662)
]] -
Sometimes messages are not sent
Sometimes Mail does not send an email message, which is problematic of course, but the real problem is that the message is nowhere to be found, except when rebuilding the Outbox (or by looking into the Outbox.mbox folder in Finder).
Some lines in the log do indicate something might be going wrong:
Jun 18 15:43:03 lab-226 Mail[7970]: Failed to get message data for <LibraryMessage: 0x1bf9e520, library id: 111528>
Jun 18 15:43:04 lab-226 Mail[7970]: couldn't load body for <LibraryMessage: 0x1bf9e520, library id: 111528>, aborting
Jun 18 15:51:52 lab-226 Mail[7970]: deleting invalid message from outbox
Does anyone experience this problem as well?I have this exact same problem. I'll type out a whole message, click send and poof! Gone. The message does not appear in my outbox or in my drafts folder even if I have saved a draft. I've had to resort to copying all my emails before sending just in case Mail doesn't send, I can still paste the message and try again. I don't remember always having this issue but I don't know exactly when it cropped up. The other day I received a message that something was corrupt and Mail needed to rebuild my index. Mail closed and then took 30 mins or so to rebuild my thousands of messages. When it opened back up I saw the messages that had "dissapeared" before in my outbox so I assume they actually were sent? I also noticed messages in my inbox that I hadn't seen before, some from weeks ago from people who I had told I never received their email. Very frustrating!
I'm wondering if the problem has anything to do with 10.5.3 or if it had cropped up before. I don't remember.
Does anyone have any ideas what could be wrong? I'm thinking of switching to Thunderbird if this doesn't get fixed soon. I can't be worrying about every email I type, whether or not it's been sent. -
Whats is the use of delaring SubType of Exception classes in catch clause
Hi,
Just go through the following code.
String ip="127.0.0.1";
StringTokenizer st = new StringTokenizer(ip,".");
int i=0,
while(st.hasMoreTokens()){
String str = st.nextToken();
try {
i=Integer.parseInt(str);
} catch (NumberFormatException e) {
System.out.println(e);
In the above code am using the NumberFormatException to catch clause the exception. But i can also use the super class Exception also in the catch clause, thats okay. Is there reason or advantage of using the particular class say (NumberFormatException) instead of super class (Exception) in the catch clause.
Is there any reasons like saving the compilation time.
For example,
There is an diff' between wild card import and ordinary import.
2 types of import statements
1) import java.util.*;
2) import java.util.ArrayList;
Here 1st type is wild card import, In this the compiler will import all the classes in that package. But am using only ArrayList in my program. So there is waste of compilation time here. Its is not efficient to use wild card import statement.
Like this any reason is there while declaring exception class in catch clause??
Regards,
Dhinesh Kumar RDeenu wrote:
Is there reason or advantage of using the particular class say (NumberFormatException) instead of super class (Exception) in the catch clause.It's clearer which specific exception you're handling.
You generally don't want to catch all exceptions.
In particular, RuntimeException and its descendants usually should not be caught.
1) import java.util.*;
2) import java.util.ArrayList;
Here 1st type is wild card import, In this the compiler will import all the classes in that package. But am using only ArrayList in my program. So there is waste of compilation time here. Its is not efficient to use wild card import statement.It doesn't "import" anything else. Importing doesn't actually load any classes. It just tells the compiler which class you're referring to when you use only the class name instead of the fully qualified name, or in the case of wildcards, tells it where to search to find a class that could match.
Good luck noticing any difference in compilation time.
It's clearer to import individual classes. -
Why can not catch the standard BACK event in ALV's USER_COMMAND event,
Hi expert, why i can not catch the standard BACK event in ALV's USER_COMMAND event,
Code:
DATA G_CON_UC_FORM TYPE SLIS_FORMNAME VALUE 'F_USER_COMMAND',
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = G_CON_FORM
I_CALLBACK_USER_COMMAND = G_CON_UC_FORM
IT_FIELDCAT = G_TAB_FIELDCAT
IT_SORT = G_TAB_SORT_INF
I_SAVE = G_CON_U
*<<<Liang
IT_EVENTS = G_TAB_ALV_EVENTS
*<<<Liang
TABLES
T_OUTTAB = G_TAB_OUTPUT_DATA
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
*& Form F_USER_COMMAND
ALV USER COMMAND processing
FORM F_USER_COMMAND .
IF SY-UCOMM = '&FO3'.
LEAVE TO SCREEN 0.
ENDIF.
ENDFORM. " F_USER_COMMAND
When I set breakpoint on this subrouting ,and try to click stardard BACK or CANCEL button, the callback form do not run, but if double click one of line of alv report, the callback form works well,
so why??hi
good
check this report and change your code accordingly.
THESE LINES ARE FOR THE MAIN PROGRAM ***
SAP V40B ***
REPORT Z_PICK_LIST .
TABLES: RESB.
SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-BL1.
SELECT-OPTIONS: S_WERKS FOR RESB-WERKS," Plant
S_AUFNR FOR RESB-AUFNR," Order number
S_BDTER FOR RESB-BDTER." Req. date
SELECTION-SCREEN END OF BLOCK BL1.
PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT DEFAULT '/STANDARD'.
DATA: BEGIN OF OUT OCCURS 10,
AUFNR LIKE RESB-AUFNR, " Order number
MATNR LIKE RESB-MATNR, " Material
BDMNG LIKE RESB-BDMNG, " Requirements in UM
MEINS LIKE RESB-MEINS, " Unit of Measure (UM)
ERFMG LIKE RESB-ERFMG, " Requirements in UE
ERFME LIKE RESB-ERFME, " Unit of Entry (UE)
MAKTX LIKE MAKT-MAKTX, " Mat. description
END OF OUT.
INCLUDE Z_ALV_VARIABLES.
INITIALIZATION.
REPNAME = SY-REPID.
PERFORM INITIALIZE_FIELDCAT USING FIELDTAB[].
PERFORM BUILD_EVENTTAB USING EVENTS[].
PERFORM BUILD_COMMENT USING HEADING[].
PERFORM INITIALIZE_VARIANT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
PERFORM F4_FOR_VARIANT.
AT SELECTION-SCREEN.
PERFORM PAI_OF_SELECTION_SCREEN.
START-OF-SELECTION.
PERFORM GET_ORDERS.
PERFORM GET_MATERIAL_DESCRIPTION.
END-OF-SELECTION.
PERFORM BUILD_LAYOUT USING LAYOUT.
PERFORM BUILD_PRINT USING PRINTS.
PERFORM WRITE_USING_ALV.
FORM INITIALIZE_FIELDCAT *
--> P_TAB *
FORM INITIALIZE_FIELDCAT USING P_TAB TYPE SLIS_T_FIELDCAT_ALV.
DATA: CAT TYPE SLIS_FIELDCAT_ALV.
CLEAR CAT.
ENDFORM. " INITIALIZE_FIELDCAT
*& Form GET_ORDERS
text
FORM GET_ORDERS.
SELECT AUFNR MATNR BDMNG MEINS ERFMG ERFME
FROM RESB
APPENDING TABLE OUT
WHERE XLOEK EQ SPACE " deletion indicator
AND XWAOK EQ 'X' " goods movement indicator
AND WERKS IN S_WERKS " plant
AND BDTER IN S_BDTER " req. date
AND AUFNR IN S_AUFNR. " pr. order
ENDFORM. " GET_ORDERS
*& Form GET_MATERIAL_DESCRIPTION
text
FORM GET_MATERIAL_DESCRIPTION.
SORT OUT BY MATNR.
LOOP AT OUT.
SELECT SINGLE MAKTX
INTO OUT-MAKTX
FROM MAKT
WHERE MATNR EQ OUT-MATNR
AND SPRAS EQ 'EN'.
MODIFY OUT.
ENDLOOP.
SORT OUT BY AUFNR MATNR.
ENDFORM. " GET_MATERIAL_DESCRIPTION
FORM TOP_OF_PAGE *
FORM TOP_OF_PAGE.
DATA: L_POS TYPE P.
first line
WRITE:/ TEXT-001. " Plant:
IF S_WERKS-HIGH NE SPACE.
WRITE: S_WERKS-LOW, TEXT-TO1, S_WERKS-HIGH.
ELSEIF S_WERKS-LOW NE SPACE.
LOOP AT S_WERKS.
WRITE: S_WERKS-LOW.
ENDLOOP.
ELSEIF S_WERKS-LOW EQ SPACE.
WRITE: TEXT-ALL.
ENDIF.
L_POS = ( SY-LINSZ DIV 2 ) - ( STRLEN( TEXT-TIT ) DIV 2 ).
POSITION L_POS. WRITE: TEXT-TIT.
L_POS = SY-LINSZ - 20.
POSITION L_POS. WRITE: TEXT-011, SY-UNAME RIGHT-JUSTIFIED. " User:
second line
WRITE:/ TEXT-002. " Order:
IF S_AUFNR-HIGH NE SPACE.
WRITE: S_AUFNR-LOW, TEXT-TO1, S_AUFNR-HIGH.
ELSEIF S_AUFNR-LOW NE SPACE.
LOOP AT S_AUFNR.
WRITE: S_AUFNR-LOW.
ENDLOOP.
ELSEIF S_AUFNR-LOW EQ SPACE.
WRITE: TEXT-ALL.
ENDIF.
L_POS = SY-LINSZ - 20.
POSITION L_POS. WRITE: TEXT-012,SY-DATUM. " Date:
third line
WRITE:/ TEXT-003. " Req. Date:
IF S_BDTER-HIGH(1) NE '0'.
WRITE: S_BDTER-LOW, TEXT-TO1, S_BDTER-HIGH.
ELSEIF S_BDTER-LOW(1) NE '0'.
LOOP AT S_BDTER.
WRITE: S_BDTER-LOW.
ENDLOOP.
ELSEIF S_BDTER-LOW(1) EQ '0'.
WRITE: TEXT-ALL.
ENDIF.
L_POS = SY-LINSZ - 20.
POSITION L_POS. WRITE: TEXT-013, SY-PAGNO. " Page:
ENDFORM. " TOP_OF_PAGE
FORM END_OF_LIST *
FORM END_OF_LIST.
DATA: L_POS TYPE P.
ULINE.
WRITE:/ '|', TEXT-021. " Delivered by:
L_POS = SY-LINSZ DIV 2.
POSITION L_POS. WRITE: '|', TEXT-031. " Received by:
L_POS = SY-LINSZ.
POSITION L_POS. WRITE: '|'.
WRITE:/ '|'.
L_POS = SY-LINSZ DIV 2.
POSITION L_POS. WRITE: '|'.
L_POS = SY-LINSZ.
POSITION L_POS. WRITE: '|'.
ULINE.
WRITE:/ '|', TEXT-012. " Date:
L_POS = SY-LINSZ DIV 2.
POSITION L_POS. WRITE: '|', TEXT-012. " Date:
L_POS = SY-LINSZ.
POSITION L_POS. WRITE: '|'.
WRITE:/ '|'.
L_POS = SY-LINSZ DIV 2.
POSITION L_POS. WRITE: '|'.
L_POS = SY-LINSZ.
POSITION L_POS. WRITE: '|'.
ULINE.
ENDFORM. " END_OF_LIST
*& Form WRITE_USING_ALV
text
FORM WRITE_USING_ALV.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = REPNAME
I_INTERNAL_TABNAME = 'OUT'
I_INCLNAME = REPNAME
CHANGING
CT_FIELDCAT = FIELDTAB.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_FIELDCATALOG_MERGE'.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPNAME
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
I_STRUCTURE_NAME = 'OUT'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELDTAB
I_DEFAULT = 'A'
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_EVENTS = EVENTS[]
IS_PRINT = PRINTS
TABLES
T_OUTTAB = OUT.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_LIST_DISPLAY'.
ENDIF.
ENDFORM. " WRITE_USING_ALV
THESE LINES ARE FOR THE INCLUDE ***
***INCLUDE Z_ALV_VARIABLES .
TYPE-POOLS: SLIS.
DATA: FIELDTAB TYPE SLIS_T_FIELDCAT_ALV,
HEADING TYPE SLIS_T_LISTHEADER,
LAYOUT TYPE SLIS_LAYOUT_ALV,
EVENTS TYPE SLIS_T_EVENT,
REPNAME LIKE SY-REPID,
F2CODE LIKE SY-UCOMM VALUE '&ETA',
PRINTS TYPE SLIS_PRINT_ALV,
TITLE(40) TYPE C,
G_SAVE(1) TYPE C,
G_EXIT(1) TYPE C,
G_VARIANT LIKE DISVARIANT,
GX_VARIANT LIKE DISVARIANT.
CONSTANTS: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE',
FORMNAME_END_OF_LIST TYPE SLIS_FORMNAME VALUE 'END_OF_LIST',
FORMNAME_BEFORE_LINE TYPE SLIS_FORMNAME VALUE 'BEFORE_LINE',
FORMNAME_AFTER_LINE TYPE SLIS_FORMNAME VALUE 'AFTER_LINE'.
FORM MAIN_STATEMENTS *
THIS IS THE CODE THAT MUST BE INSERTED IN THE MAIN PROGRAM
FORM MAIN_STATEMENTS.
Declare the parameter P_VARI wherever you want it. If you don't
want it, hide it with NO-DISPLAY, but it must exist.
parameters: p_vari like disvariant-variant. " ALV Variant
You have to add the following line after the data and parameter
declaration:
include z_alv_variables.
Then, after the data/parameter declaration, add these lines:
*initialization.
repname = sy-repid.
perform initialize_fieldcat using fieldtab[].
perform build_eventtab using events[].
perform build_comment using heading[].
perform initialize_variant.
If you are using the variable P_VARI (ALV Variant), also add this:
*at selection-screen on value-request for p_vari.
perform f4_for_variant.
*at selection-screen.
perform pai_of_selection_screen.
After the "END-OF-SELECTION" statement, add these lines:
perform build_layout using layout.
perform build_print using prints.
perform write_using_alv.
You also have to create the following forms: (you can find samples
in this program)
INITIALIZE_FIELDCAT
USER_COMMAND (only if you are creating a STATUS)
WRITE_USING_ALV
ENDFORM.
*& Form INITIALIZE_FIELDCAT_SAMPLE
THIS IS A SAMPLE, DO NOT USE THIS FORM IN YOUR PROGRAM
-->P_FIELDTAB[] text *
FORM INITIALIZE_FIELDCAT_SAMPLE USING P_TAB TYPE SLIS_T_FIELDCAT_ALV.
DATA: CAT TYPE SLIS_FIELDCAT_ALV.
CLEAR CAT. " Always clear before use
CAT-TABNAME = 'I'. " Your internal table
CAT-REF_TABNAME = 'ZCUSTMAS'. " The data dictionary reference table
CAT-FIELDNAME = 'KUNNR'. " Name of your field in the itable.
CAT-COL_POS = 1. " Output position
APPEND CAT TO P_TAB.
CAT-FIELDNAME = 'NAME1'. " Next field
CAT-COL_POS = 2.
APPEND CAT TO P_TAB.
CAT-FIELDNAME = 'STRAS'. " and the next
CAT-COL_POS = 3.
APPEND CAT TO P_TAB.
CAT-FIELDNAME = 'LOEVM'.
CAT-SELTEXT_S = 'Del'. " You can always override the descrip-
CAT-SELTEXT_M = 'Delivery'. " tion (short, medium, large)
CAT-SELTEXT_L = 'Delivery Num'.
CAT-COL_POS = 4.
APPEND CAT TO P_TAB.
CAT-FIELDNAME = 'FKIMG'.
CAT-DO_SUM = 'X'. " You want totals calculated.
CAT-NO_OUT = 'X'. " and hidden.
APPEND CAT TO P_TAB.
ENDFORM. " INITIALIZE_FIELDCAT
*& Form BUILD_EVENTTAB
THIS IS THE SAME FOR ALL THE PROGRAMS
-->P_EVENTS[] text *
FORM BUILD_EVENTTAB USING P_EVENTS TYPE SLIS_T_EVENT.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = P_EVENTS.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
CLEAR LS_EVENT.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_END_OF_LIST
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_END_OF_LIST TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
CLEAR LS_EVENT.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_BEFORE_LINE_OUTPUT
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_BEFORE_LINE TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
CLEAR LS_EVENT.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_AFTER_LINE_OUTPUT
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_AFTER_LINE TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
CLEAR LS_EVENT.
READ TABLE P_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO P_EVENTS.
ENDIF.
ENDFORM. " BUILD_EVENTTAB
*& Form BUILD_COMMENT
NOT REALLY NEEDED, BUT I'LL LEAVE IT THERE, JUST IN CASE...
-->P_HEADING[] text *
FORM BUILD_COMMENT USING P_HEADING TYPE SLIS_T_LISTHEADER.
DATA: HLINE TYPE SLIS_LISTHEADER,
TEXT(60) TYPE C,
SEP(20) TYPE C.
CLEAR: HLINE, TEXT.
HLINE-TYP = 'H'.
write: text-101 to text+23.
HLINE-INFO = TEXT.
APPEND HLINE TO P_HEADING.
ENDFORM. " BUILD_COMMENT
*& Form INITIALIZE_VARIANT
VERY IMPORTANT WHEN YOU USE VARIANTS!!!
FORM INITIALIZE_VARIANT.
G_SAVE = 'A'.
CLEAR G_VARIANT.
G_VARIANT-REPORT = REPNAME.
GX_VARIANT = G_VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = G_SAVE
CHANGING
CS_VARIANT = GX_VARIANT
EXCEPTIONS
NOT_FOUND = 2.
IF SY-SUBRC = 0.
P_VARI = GX_VARIANT-VARIANT.
ENDIF.
ENDFORM. " INITIALIZE_VARIANT
*& Form PAI_OF_SELECTION_SCREEN
ALSO FOR VARIANTS
FORM PAI_OF_SELECTION_SCREEN.
IF NOT P_VARI IS INITIAL.
MOVE G_VARIANT TO GX_VARIANT.
MOVE P_VARI TO GX_VARIANT-VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
I_SAVE = G_SAVE
CHANGING
CS_VARIANT = GX_VARIANT
EXCEPTIONS
WRONG_INPUT = 1
NOT_FOUND = 2
PROGRAM_ERROR = 3.
IF SY-SUBRC EQ 0.
G_VARIANT = GX_VARIANT.
ELSE.
PERFORM INITIALIZE_VARIANT.
ENDIF.
ELSE.
PERFORM INITIALIZE_VARIANT.
ENDIF.
ENDFORM. " PAI_OF_SELECTION_SCREEN
*& Form F4_FOR_VARIANT
text
FORM F4_FOR_VARIANT.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
IS_VARIANT = G_VARIANT
I_SAVE = G_SAVE
IMPORTING
E_EXIT = G_EXIT
ES_VARIANT = GX_VARIANT
EXCEPTIONS
NOT_FOUND = 2.
IF SY-SUBRC = 2.
MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
IF G_EXIT = SPACE.
P_VARI = GX_VARIANT-VARIANT.
ENDIF.
ENDIF.
ENDFORM. " F4_FOR_VARIANT
*& Form BUILD_LAYOUT
STANDARD LAYOUT
-->P_LAYOUT text *
FORM BUILD_LAYOUT USING P_LAYOUT TYPE SLIS_LAYOUT_ALV.
P_LAYOUT-F2CODE = F2CODE.
P_LAYOUT-ZEBRA = 'X'.
p_layout-detail_popup = 'X'.
P_LAYOUT-TOTALS_TEXT = SPACE.
P_LAYOUT-SUBTOTALS_TEXT = SPACE.
ENDFORM. " BUILD_LAYOUT
FORM BUILD_PRINT *
STANDARD PRINT OPTIONS *
--> P_PRINT *
FORM BUILD_PRINT USING P_PRINT TYPE SLIS_PRINT_ALV.
P_PRINT-NO_PRINT_LISTINFOS = 'X'.
P_PRINT-NO_PRINT_SELINFOS = ' '.
ENDFORM. " BUILD_PRINT
FORM PF_STATUS_SET *
NAME YOUR STATUS ALV. IF YOU NEED IT.. *
FORM PF_STATUS_SET USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ALV' EXCLUDING EXTAB.
ENDFORM. " PF_STATUS_SET
FORM USER_COMMAND_SAMPLE *
--> UCOMM *
--> SELFIELD *
FORM USER_COMMAND_SAMPLE USING UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
CASE UCOMM.
WHEN 'MSXL'. " Export to Excel
perform set_excel_export.
CLEAR UCOMM.
WHEN 'MM03'.
set parameter id 'MAT' field selfield-value.
call transaction 'MM03' and skip first screen.
CLEAR UCOMM.
WHEN 'BGR1'.
perform fill_available.
perform graph_available.
CLEAR UCOMM.
WHEN 'DOCU'.
call function 'Z_HELP' exporting repname = repname.
ENDCASE.
ENDFORM. " USER_COMMAND
*& Form WRITE_USING_ALV_SAMPLE
*THIS IS A SAMPLE AND MUST BE WRITTEN DIRECTLY IN THE MAIN PROGRAM
FORM WRITE_USING_ALV_SAMPLE.
YOU CAN MERGE WITH A DATA DICTIONARY TABLE USING THIS:
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = repname
i_internal_tabname = 'I'
i_inclname = repname
changing
ct_fieldcat = fieldtab.
if sy-subrc <> 0.
write: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_FIELDCATALOG_MERGE'.
endif.
OR JUST DISPLAY IT USING THIS:
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = repname
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'I'
is_layout = layout
it_fieldcat = fieldtab
i_default = 'A'
i_save = g_save
is_variant = g_variant
it_events = events[]
is_print = prints
tables
t_outtab = i.
if sy-subrc <> 0.
write: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_LIST_DISPLAY'.
endif.
ENDFORM. " WRITE_USING_ALV
thanks
mrutyun^ -
Throwing an exception within a catch
Hi all, I have a situation were I have a nested catch situation I would like to throw an exception within a catch and not catch it in my catch(Exception)
eg
try{
catch(exceptiontypeB e)
throw excetionTypeA
catch(exceptiontypeC e)
throw excetionTypeA
catch(Exception e)// the general exception, I dont whant to handel excetionTypeA from the other catch statements
throw excetionTypeA
please help cheers and thanxtry {
// Do something
catch (SpecialException foo) {
throw new ExceptionNotToBeCaught();
catch (Exception e) {
if (e instanceof ExceptionNotToBeCaught == false) {
// Process all exceptions here.
// ExceptionNotToBeCaught will be ignored
}- Saish
"My karma ran over your dogma." - Anon -
ScheduleAtFixedRate - not catching interupt from FutureTask.cancel()
I'm not quite understanding how to correctly cancel a thread that is spawned with scheduleAtFixedRate.
main() schedules the MyTask runnable to run every second (which works fine). The runnable (MyTask) prints that its running every second. main() waits 5 seconds then calls cancel (implemented by FutureTask). This is where I get confused. cancel() (if called with a true flag) is supposed to interrupt the thread, but I never get a print in my catch for an InterruptException, and I never fall into my Thread.interupted() condition.
So I have 3 questions:
1. When I run this code from eclipse, the runnable does stop running (I stop getting the prints). So it does seem to be getting canceled. However, I don't understand why I'm not catching the thread interrupt.
2. I'm forced to use the application terminate button in Eclipse to stop execution (not sure why it doesn't terminate normally).
3. Whats the advantage of scheduleAtFixedRate over just spawning the thread with a while(shutdownFlag==true) loop (with a sleep at the end of the loop) and using a volatile atomic boolean to set the flag to false and have the thread terminate?
Thanks for any help!
public static void main(String[] args) {
final int THREAD_POOL_SIZE = 1;
final int PERIODIC_TIME = 1;
final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(THREAD_POOL_SIZE);
MyTaskSingleton myTask = MyTaskSingleton.getInstance();
try {
final ScheduledFuture<?> myTaskHandle =
scheduler.scheduleAtFixedRate(myTask, 0, PERIODIC_TIME, TimeUnit.SECONDS);
Thread.sleep(5000);
System.out.println("TaskExecutor: MyTask cancel: " + myTaskHandle.cancel(true));
Thread.sleep(1000);
System.out.println("TaskExecutor: MyTask is done: " + myTaskHandle.isDone());
} catch (InterruptedException e) {
System.out.println("TaskExecutor: caught exception");
e.printStackTrace();
}Here is the run method of my runnable class.
public void run() {
try {
if (Thread.interrupted()){
System.out.println("MyTask: detected thread interrupt");
throw new InterruptedException();
System.out.println("MyTask: running...");
catch(InterruptedException e){
System.out.println("MyTask: caught Interrupt Exception");
e.printStackTrace();
}1. the only way your runnable will see an interrupted exception, is if it happens to be running when the cancel method is called. however, seeing as your run method is so trivial, the chances of the cancellation happening at the exact right time are very low. add a call to Thread.sleep() in your run method and you have a way better chance of seeing the interruption in the run method.
2. you need to shutdown the executor at the end of the main method. the thread it is using is keeping the application from exiting.
3. because you don't have to write all the code your self. not to mention that you can use 1 thread for multiple scheduled tasks (if you need more than 1). -
Hi,
we are calling an RFC synchronously from BPM. This is a standard BAPI, that does not have any RFC exception message (BAPI_IPAK_START and BAPI_ISREQUEST_GETSTATUS). We are only able to catch system errors, since no RFC exception message is avaiable for which we could define a different exception branch.
If an error happens in the RFC, an application error is thrown, which is not catched in the exception branch defined to handle the system error. After the application error, the process simply terminates- that's it.
Why is an application error not catched as system error? Is there any way to catch an application error and let the business process continue?
Your help will be rewarded,
VolkerHi Volker,
a BAPI does not throw any exception, therefore you cannot catch any.
- You could write a wrapper RFC around the BAPI which interprets the RETURN structure and throws exception in case of an error.
- You could have a fork in the BPM depending of the entries in RETURN.
Regards
Stefan -
Exception - getBLOB not implemented
import java.io.IOException;
import java.io.InputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class DisplayBlobServlet extends HttpServlet {
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,
ServletException {
// String photoid = request.getParameter("txtid");
Blob photo = null;
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
String query = "select plikimage from testimage where id=2";
ServletOutputStream out = response.getOutputStream();
try {
conn = getOracleConnection();
} catch (Exception e) {
response.setContentType("text/html");
out.println("<html><head><title>Person Photo</title></head>");
out.println("<body><h1>Database Connection Problem.</h1></body></html>");
return;
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(query);
if (rs.next()) {
photo = rs.getBlob(1);
} else {
response.setContentType("text/html");
out.println("<html><head><title>Person Photo</title></head>");
out.println("<body><h1>No photo found for id= 001 </h1></body></html>");
return;
response.setContentType("image/jpg");
InputStream in = photo.getBinaryStream();
int length = (int) photo.length();
int bufferSize = 1024;
byte[] buffer = new byte[bufferSize];
while ((length = in.read(buffer)) != -1) {
System.out.println("writing " + length + " bytes");
out.write(buffer, 0, length);
in.close();
out.flush();
} catch (SQLException e) {
response.setContentType("text/html");
out.println("<html><head><title>Error: Person Photo</title></head>");
out.println("<body><h1>Error=" + e.getMessage() + "</h1></body></html>");
return;
} finally {
try {
rs.close();
stmt.close();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
public static Connection getOracleConnection() throws Exception {
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@localhost:1521:ORCL";
String username = "SYSTEM";
String password = "qazwsx1";
Class.forName(driver); // load Oracle driver
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
}This servlet unfortunately gives me sucha a exception :
getBLOB not implemented for class oracle.jdbc.driver.T4CNamedTypeAccessor What to do ? Much appreciated for any help.
Edited by: user10484812 on 2011-12-09 07:32
Edited by: user10484812 on 2011-12-09 07:32It means that the Derby version you are using doesn't support moveToInsertRow();
You will either need to code it differently, use a Derby version that supports it, or use a different database product.
The Derby documentation suggests that the feature is not available in version 10.1, the latest official release. The feature has been implemented in the Derby codebase, and is in the 10.2.0.3 alpha snapshot, which they warn is not suitable for production usage, and you may not want to use until an official 10.2 release is made. -
How to deal exception using try{}catch{}
I don't know which is a good way from catch a exception and throw a exception,
I means that how to use exception in java,catch ? throw?Presumably you are not asking the same thing as here...
http://forum.java.sun.com/thread.jsp?thread=461313&forum=9&message=2114037
You catch an exception with code that looks like the following...
try
String s = null;
int i = s.length(); // This throws an exception
catch(NullPointerException e)
// Do something
You throw an exception with the following...
if (<some condition>)
throw new Exception("Something bad happened"); -
OracleConnection.ClearAllPools() throws exception Operation not valid due t
My app allows new logons so during the app startup I call my general "new logon" procedure that among other things does a ClearAllPools.
OracleConnection.ClearAllPools() throws exception "Operation not valid due to current state of the object".
I have converted from
System.Data.OracleClient.OracleConnection
to
Oracle.DataAccess.Client.OracleConnection
Did not have any problem when using the former.According to the documentation, ClearAllPools() throws an exception if there's no connection pool to clear. Most likely in that case the System.Data.OracleClient version is just not doing anything instead.
You should just be able to catch InvalidOperationException() at that point and ignore it.
Maybe you are looking for
-
A USB thumb drive with data created in Windows is not showing up on my desktop. Do I need a different driver or something?
-
I use InDesign CS6, I was told that if i hold the ALT key down and double click on a picture it will be opened in Photoshop. When I do it, it opens in Windows Photo Viewer. How do i get it to open in Ps?
-
Hi I am trying to create a manual check for my Vendor ABC. I am giving the external document # while creating the manual check. But the error message says "Document 1234 doesn't exist in company code CCCC year 2007" What could be the probable reaso
-
I've got reports written in windows-verson reports 2.5.5.2.7 and was running normally on 8.1.6.0.0 NT 4.0 database for over 2 years. Recently It crushed with a error message of rep-3301. after all the tests, we only knew that something wrong with one
-
Palm M100: Urgent Problem - HELP!!
Hi, I have a problem in both opening my Palm M100 on the desktop and in using the HotSync operation.. 1. When I try to open on the Desktop a Box opens with the message "Error: Failed to Address Book Database". When I click the 'OK' button a new Box o