Exception not catched...
Friends,
I am using this :
File file = new File(path2upload);
if(!file.exists()){ file.mkdirs(); }
if (!file.exists())
file.createNewFile();
factory.setRepository(file);
// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload(factory);
try {
//RESTRICT FILE SIZE TO 10 MB
upload.setSizeMax(FILESIZELIMIT);
}catch(Exception e)
{ response.sendRedirect("index.jsp"); out.println("SIZE EXCEEDED"); }Since i want to redirect the page when it should through the exception
for the size.
when i give larger file than 10 mb it should give me following error :
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: the request was rejected because its size (39841706) exceeds the configured maximum (10485760)
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
javax.servlet.ServletException: the request was rejected because its size (39841706) exceeds the configured maximum (10485760)
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.fileUpload_jsp._jspService(fileUpload_jsp.java:178)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (39841706) exceeds the configured maximum (10485760)
org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:797)
org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:323)
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:341)
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
org.apache.jsp.fileUpload_jsp._jspService(fileUpload_jsp.java:101)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Is this business logic put in the view page (the JSP) ? If so, don't do that. Use JSPs for view only and use servlets/beans for business logic.
Similar Messages
-
Exception not catched when closing dialog
Hi,
When I close one of my dialog (JDialog), this exception is raised. None of
the classes from Exception trace are mine (they are all from javax or java)
. How can I catch or avoid this exception??
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.plaf.basic.BasicTreeUI.isToggleEvent(BasicTreeUI.java:2192)
at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent
(BasicTreeUI.java:2247)
at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection
(BasicTreeUI.java:3432)
at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed
(BasicTreeUI.java:3393)
at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
at java.awt.Component.processMouseEvent(Component.java:5485)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)Thanks,
MarieHey,
I doubt this stack trace is gonna be much help to anyone.
Are you performing any clean up operations when you close your dialog.?
You may well be, at any point in the dialog's life time, setting some field or value of a default Swing class to null. Or inadvertently passing a variable that evaluates to null, although it may not appear to you that it is in fact null.
I fear you will have to start from the beginning of your code and analyse all the setXxxx() methods you call and be sure you are not in one-way-or-another passing any null values.
For some methods null parameters maybe legal. However if that value is retreived by some other class and used but can not handle null values it will throw the exception.
Imagine you set a JTable to use a grid of values litered with null values. It may not complain (I dont actually know). But if you have some logic that cannot handle null yet uses any arbitrary table value, at some point it will break.
The best thing I could say is check what data is going in and out of you JTree. Also, you can examine the source code.
If you can, post your dialog with any supporting data so that it can be run via a main method.
Good luck,
Darren -
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 -
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 -
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 -
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 -
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)
]] -
Return in finally block hides exception in catch block
Hi,
if the line marked with "!!!" is commented out, the re-thrown exception is not seen by the caller (because of the return in the finally block). If the line is commented in, it works as I would expect. Is this is bug or a feature? I assume the return removes the call to troubleMaker() from the call stack - including the associated exception...
Christian Treber
[email protected]
public class ExceptionDemo extends TestCase
public void testException()
String lResult = "[not set]";
try
lResult = troubleMaker();
System.out.println("No exception from troubleMaker()");
} catch(Exception e)
System.out.println("Caught an exception from troubleMaker(): " + e);
System.out.println("Result: " + lResult);
public String troubleMaker()
boolean lErrorP = false;
try
if(6 > 5)
throw new RuntimeException("Initial exception");
return "normal";
} catch (RuntimeException e)
System.out.println("Caught runtime exception " + e);
lErrorP = true;
throw new RuntimeException("Exception within catch");
} finally
System.out.println("Finally! Error: " + lErrorP);
if(!lErrorP)
return "finally";This is specified in the Java Language Specification, section 14.19.2 .
-- quote
If execution of the try block completes abruptly because of a throw of a value V, then there is a choice:
* If the run-time type of V is assignable to the parameter of any catch clause of the try statement, then the first (leftmost) such catch clause is selected. The value V is assigned to the parameter of the selected catch clause, and the Block of that catch clause is executed. Then there is a choice:
o If the catch block completes normally, then the finally block is executed. Then there is a choice:
+ If the finally block completes abruptly for any reason, then the try statement completes abruptly for the same reason.
-- end quote
"completing abruptly" (in this instance) means a throw or a return, as specified in section 14.1
Ok? It's not a bug, it's the defined behaviour of the language. And when you think about it, this behaviour gives you the option to do what you want in your finally block. -
Native C++ Custom Exception Not Recognized
Hi,
I'm having a problem with the native part of my code when throwing a custom exception. It is never caught when the exception is thrown in a separate class, it always falls in the generic catch(...) section. I know this problem has something to do with JNI and Java since running a C++ test program doing the same thing recognizes the exception and catches it.
My Program is something like this
Java Part:
public class RunException {
public static void main(String args[]) {
doSomething();
}C++ Part:
class CustomException: public exception {
public :
exception() {};
class CatchException: public exception {
public:
doSomething() {
try {
throwException->throwException();
throw CustomException(); //this would have been caught in catch(CustomException)
}catch(CustomException e) {
//never goes in here
catch(int e) {
//this works
catch(...) {
//always goes ends up here here
class ThrowException {
public:
throwException() {
throw CustomException(); //this ends up in catch(...)
//throw 1 - throwing an integer would work
} I'm not sure what's causing this but I'm guessing it has something to do with loading and linking or maybe some sort of JVM security policy/behavior? Any help would be greatly appreciated.
Edited by: z3n3r on Nov 13, 2008 7:51 PMNever seen this. Some comments on your C++:
class CustomException: public exception {
public :
exception() {};That should be CustomException() {}
}catch(CustomException e) {That should be catch (CustomException &e). Never catch exceptions by value.
throwException() {That should be throwException() throw(CustomException) {}, although good old MSVC still ignores it 15 years later ... -
Resteasy in-built exceptions not caught in the exception mapper
Hi friends,
I have written some exception mappers to catch and handle the in-built rest easy exceptions like NotFoundException,MethodNotAllowedException, etc., Sample code as shown:
@Provider
public class NotFoundExceptionMapper implements ExceptionMapper<org.jboss.resteasy.spi.NotFoundExc eption>
@Override
Response toResponse(org.jboss.resteasy.spi.NotFoundExceptio n exception) {
return Response.status(500).build();
I have also written a try catch block in my web filter class. Whenever a NotFoundException occurs, it is not caught in the mapper, but it goes to the catch block in the Filter.
Whereas I have tried another exception mapper class to handle JsonParsingException. This is working correctly and giving a proper response from the mapper whenever a Json Parse exception occurs.
The issue is only with the case of resteasy inbuilt exceptions.
Also, the Provider has been registered in the application context using the include-filter tag inside component scan.
Is there any additional configuration to be done for this?
Please guide me as to what needs to be done to catch rest easy in-built exceptions in the mapper class itself.
Regards,
RMCross posted
http://stackoverflow.com/questions/10251640/resteasy-in-built-exceptions-not-caught-in-the-exception-mapper
http://www.java-forums.org/advanced-java/58655-resteasy-built-exceptions-not-caught-exception-mapper.html
db -
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^ -
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 -
my iPhone 5 is not catching up my website, although having a big screen... What does it need to get the pages in auto mobile queries converting?
You need to code your web site to recognize the mobile browser and send a page that's actually usable when it does.
-
Exception not handled by the Collaxa Cube system
Hi!
i have plsql procedure and i published it as a web service using JDev 10.1.3, web service is deployed on OC4J 10.1.3. When i call it directly, everything works fine. When i make a BPEL process jast wrapping this web service (receive, assign, invoke, assign, reply - that`s all) the web service is invoked fine without error, but then error appears in the bpel process:
Exception not handled by the Collaxa Cube system. An unhandled exception has been thrown in the Collaxa Cube system. The exception reported is: "java.lang.NullPointerException at com.collaxa.cube.engine.delivery.DeliveryHelper.saveAttachments(DeliveryHelper.java:436) at com.collaxa.cube.ws.wsif.providers.axis.WSIFOperation_ApacheAxis.saveAttachments(WSIFOperation_ApacheAxis.java:3521) at com.collaxa.cube.ws.wsif.providers.axis.WSIFOperation_ApacheAxis.populateOutMsgParts(WSIFOperation_ApacheAxis.java:1403) at com.collaxa.cube.ws.wsif.providers.axis.WSIFOperation_ApacheAxis.buildResponseMessages(WSIFOperation_ApacheAxis.java:1303) at com.collaxa.cube.ws.wsif.providers.axis.WSIFOperation_ApacheAxis.invokeAXISRPCStyle(WSIFOperation_ApacheAxis.java:1815) at com.collaxa.cube.ws.wsif.providers.axis.WSIFOperation_ApacheAxis.invokeRequestResponseOperation(WSIFOperation_ApacheAxis.java:1613) at com.collaxa.cube.ws.wsif.providers.axis.WSIFOperation_ApacheAxis.executeRequestResponseOperation(WSIFOperation_ApacheAxis.java:1083) at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:452) at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:327) at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:189) at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__invoke(BPELInvokeWMP.java:601) at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:317) at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:188) at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3408) at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1836) at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75) at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:166) at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:252) at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5438) at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1217) at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.createAndInvoke(CubeEngineBean.java:120) at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.syncCreateAndInvoke(CubeEngineBean.java:153) at ICubeEngineLocalBean_StatelessSessionBeanWrapper0.syncCreateAndInvoke(ICubeEngineLocalBean_StatelessSessionBeanWrapper0.java:486) at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequestAnyType(DeliveryHandler.java:520) at com.collaxa.cube.engine.delivery.DeliveryHandler.initialRequest(DeliveryHandler.java:435) at com.collaxa.cube.engine.delivery.DeliveryHandler.request(DeliveryHandler.java:132) at com.collaxa.cube.ejb.impl.DeliveryBean.request(DeliveryBean.java:101) at IDeliveryBean_StatelessSessionBeanWrapper22.request(IDeliveryBean_StatelessSessionBeanWrapper22.java:479) at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:120) at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:70) at _ngDoInitiate._jspService(_ngDoInitiate.java:289) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121) at com.evermind.server.http.EvermindPageContext.include(EvermindPageContext.java:267) at _displayProcess._jspService(_displayProcess.java:792) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222) at com.collaxa.cube.fe.DomainFilter.doFilter(DomainFilter.java:152) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) at java.lang.Thread.run(Thread.java:534) ". Exception: java.lang.NullPointerException Handled As: com.collaxa.cube.CubeException
i found similar problem calling axis web service, but this web service runs on OC4J ... any suggestions what to do?
Thanks,
TomasUser,
I'd probably try the [url http://forums.oracle.com/forums/forum.jspa?forumID=212]BPEL Forum for this one.
Regards,
John
Maybe you are looking for
-
Displaying non English file name in portlet
Hi, I have a portlet that display all the files in a directory that is not on any of the Plumtree servers (portal, collaboration, etc ...). This directory could be a local directory or a directory on a network but not on any of the plumtree servers.
-
Depuis que j'ai fait une mise à jour avec iOS5.1.1 je ne peux plus synchroniser mes contacts et mon calendrier avec mon ordinateur. Est-ce quelqu'un connaîtrait le moyen de régler ce problème?
-
PowerShell Notification Script for Login Servers...
Dears, I'm looking for PowerShell script when any users login to the windows server 2012 to send me notification email, I wants to use task schedule for that, my point is we have many servers, and I need message come to my email when any users login
-
How to put my itunes library in the cloud from my pc.
I am trying to put my itunes libraryfrom my pc in the cloud so that I can transfer it to my new mac. I cannot find how to do this
-
Internal and External number ranges
Hi, If we have already created an internal number range and posted few SA documents. Then can we change the internal number range to external number range or vice versa(i.e external to internal number range) Regards Adnan