Can not catch exception in jsp?
It sames that it is not a must to catch exception potentially throwed.The following snippet can work well.But if in a standard java file ,we should catch the naming exception.How to explain this phenomena?
<%! int a=8;%>
<%
System.out.println("begin jsp");
Hashtable h=new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
h.put(Context.PROVIDER_URL,"jnp://127.0.0.1:1099");
InitialContext ic=new InitialContext(h);
CalcHome ch=(CalcHome) ic.lookup(CalcHome.JNDI_NAME);
System.out.println("begin create cal");
Calc c=ch.create();
a=c.calcBonus(2,2);
System.out.println(a);
%>
<%=a%>
But don't forget to have isErrorPage="true" or it will ignore the try/catch, at least with my server (IPlanet).
I have actually found it much nicer to have a full error page with JSP. All my JSP pages have errorPage set to an error.jsp and isErrorPage set to false.
This means no try/catch blocks anywhere muddying up code. Just the error page has all the catches. I like it.
Similar Messages
-
How to catch exception in JSP????
how to catch exception in JSP?
I use JDeveloper 3.1
I use connection with database .
When I insert record in database
when have duplicate of primary key
how to catch this exception and
back to previous page?
I trying with folowing:
<jsp:useBean id="RowEditor" class="oracle.jbo.html.databeans.EditCurrentRecord" scope="request">
<% try {
RowEditor.setUseJS(true);
RowEditor.initialize(pageContext, "package2_Package2Module.Drzavi1View");
RowEditor.setSubmitText("Save");
RowEditor.setTargetUrl("Drzavi1View_SubmitInsertForm.jsp");
RowEditor.createNewRow();
RowEditor.setReleaseApplicationResources(true);
RowEditor.render();
catch(Exception e) {
%>
<script>
alert("primary key duplication");
history.back();
</script>
<% } %>
but i't not working
please help mei catch exceptions as you do, i don't have any problem...
are you throwing the exception from your bean?
actually i don't catch an Exception, but an SQLException...
but it works... here is my code...
try
myclass.addElement(); // this is an insert into Oracle
catch( DataBaseFailException e ) /// an exception that i throws inside after i receive an SQLException
session.setAttribute("gMessage","e.getMessage()); // error code -
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^ -
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 -
Can not add Exceptions to Transparent proxy
Hello all,
I am sure this is simple but I can not figure out what has changed to cause this. Currently, I can not add items to the exception list in HTTP Transparent Proxy.
I only see refresh and close buttons on the screen - no Apply changes.
I have 2 BM servers and one I have access to without issues but the other does not work.
It definitely worked at some point in time because it has 25 entries but has since stopped.
What am I missing?
Thanks,
Steve D.sjdimare wrote:
> Here are the details:
>
> Both servers are identical in configuration (other than ip addresses):
>
> NW 6.5 SP7 and updated TCP
> BM 3.9 SP2 (tweaked per CJ website)
>
> Both servers exist in their on OU which is partitioned
>
> The server that is working currently only has 17 exceptions but I do
> not think it is a # of exceptions issue.
>
> While in iManager, if I select Proxy Services, on the main page the
> buttons on the bottom of one server shows "Apply Changes, Backup and
> Close" while the non-working server only has " Refresh and Close". This
> seems to indicate to me that their is a rights or roles issue in
> iManager that did not exist before but I can not figure out where.
>
> Thanks for your assistance.
>
> Steve D.
>
>
1. Tid 3506678. Apply Changes button is missing in the iManager server
configuration proxy screen
Be aware of the issue when you manager a bm server from non local
iManager instance. Tid 7001625:Apply changes button not submitting changes -
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 -
Why a method can not be invoked in JSP ???
I define a method in a JAVA Class file,as this:
public Enumeration getElementsNamed(String name, String parentname) {
Element elem = doc.getDocumentElement();
NodeList nodes = elem.getElementsByTagName(name);
int size = nodes.getLength();
Vector elemVec = new Vector(size);
for (int i = 0; i < size; i++) {
Node node = nodes.item(i);
if (nodes .item(i).getParentNode().getLocalName().equals(parentname)) {
elemVec.addElement(new UddiObject((Element) node));
return elemVec.elements();
I want to get a Element who's Localname is the name and his parent Element's laocalname is the parentname from a DOM tree.
This can be run well in a normal Java environment just as JDK1.4.
and is a JSP file,I import the Class first.
and invkoed the method in somewhere, the TOMCAT give me an error:
The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
the JSP file is :
<%@ page import="java.util.*,org.w3c.dom.*, edu.hunnu.uddi.*, java.sql.*,java.io.*,edu.hunnu.uddiserver.util.*,edu.hunnu.uddiserver.inquiry.*" %>
<h1>Get tModel</h1>
<%
Connection con = SqlConnection.getConnection();
String Description="";
String detail ="<get_tModelDetail generic=\"2.0\" xmlns=\"urn:uddi-org:api_v2\"><tModelKey>"+tModelKey+"</tModelKey></get_tModelDetail>";
ByteArrayInputStream bas = new ByteArrayInputStream(detail.getBytes());
TModelDetails tmodelDetails = new TModelDetails( new Get_TModelDetail(bas), con);
UddiObject obj=tmodelDetails.getData();
obj=obj.getElement(UddiTags.TMODEL);
Description=Description+((TModel)obj).getDescription();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error at this
%>
<%%>
WHY??? and HOW????oh~It is my mistake.
and the JSP file would be:
<%@ page import="java.util.*,org.w3c.dom.*, edu.hunnu.uddi.*, java.sql.*,java.io.*,edu.hunnu.uddiserver.util.*,edu.hunnu.uddiserver.inquiry.*" %>
<h1>Get tModel</h1>
<%
Connection con = SqlConnection.getConnection();
String Description="";
String detail ="<get_tModelDetail generic=\"2.0\" xmlns=\"urn:uddi-org:api_v2\"><tModelKey>"+tModelKey+"</tModelKey></get_tModelDetail>";
ByteArrayInputStream bas = new ByteArrayInputStream(detail.getBytes());
TModelDetails tmodelDetails = new TModelDetails( new Get_TModelDetail(bas), con);
UddiObject obj=tmodelDetails.getData();
obj=obj.getElement(UddiTags.TMODEL);
Enumeration enum=obj.getElementsNamed("description","tModel");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error at this
%>
and the variable "obj" :
<tModel operator="www.hunnu.edu.cn"tModelKey="uuid:50C693A0-7AB8-11D5-93A0-CFE2D4CCB519"><name>simple.services</name><description>This is a basic tModel for service providers and consultant</description><overviewDoc><overviewURL>http://www.hunnu.edu.cn</overviewURL><description>Service documentation can be obtainedfrom the URL provided</description></overviewDoc><identifierBag/><categoryBag/></tModel> -
Bpel Server Does Not Catch Exceptions Thrown By Custom Xpath Functions
Hi.
I am using some custom xpath functions in a bpel process and whenever they fail I get an XPathExecutionError with summary:
XPath expression failed to execute.
Error while processing xpath expression, the expression is "<my function>", the reason is FOTY0001: type error.
Please verify the xpath query.
I am forcing my function to fail by giving a wrong input, which should result in an XPathFunctionException("Input does not respect format").
There is a note on Metalink with ID 458434.1 on this subject which says that patch 5926809 should fix my problem.
Patch 5926809 fixes Bug 5926809 - ORA:PARSEESCAPEDXML XPATH EXPRESSION FAILED TO EXECUTE FOTY0001: TYPE ERROR.
I am using it, but it does not work :(
I am using version 10.1.3.3.0 of App Server with various patch sets, including fix for bug 5926809.
Has anyone suggestions on how to overcome this problem?
ThanksHello,
I am trying to add a custom xpath function to the BPEL server, and I see that you made it work. I am using Oracle SOA Suite 10.1.3.3 and jDeveloper 10.1.3.4. I am using this function inside an xsl mapping file, although I am able to compile and deploy the Bpel Process to the server, it stops mapping where I placed the function and I have not seen any meaningful message from the domain/log/ files.
Can you tell me how you did it?
I think you will tell me faster than Oracle support, I already placed an SR but they just give me superficial advice.
I appretiate your time and advice,
Guillermo -
Can't catch exception in form from server
The Block is built on procedure.
Use code in procedure of the blocking:
SELECT id
INTO temp
FROM tab
WHERE id = n_var --variable
FOR UPDATE NOWAIT;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20001, 'ERROR');
Open two copies of form.
In one form change record. In the other form in an effort change record appears the error with code -20001.
This is correct.
If the form does not contain the trigger ON-ERROR - a code of the error -20001.
If add the trigger ON-ERROR:
IF DBMS_ERROR_CODE = -20001 THEN
MESSAGE('RECORD IS LOCKED');
MESSAGE('RECORD IS LOCKED');
END IF;
I get the error with code -1403.
Why? When i delete trigger - error code -20001.
How do I get the code of the error -20001 in trigger ON-ERROR. Why DBMS_ERROR_CODE = -1403 if in procedure i generate error with code = -20001???I don't have another sql query.
All work correct while i don't add trigger ON-ERROR.
Without this trigger, form work is correct. I get error from server with code -20001. When i add trigger ON-ERROR - in this trigger dbms_error_code = -1403. Why? How error code may depend from this trigger? -
Can't catch the exception when transaction rollback ,BPEL/SOA 11G,updated!
Hi Guys ,
I have two insert/update invoke actions through dbadpter in my BPEL process .
When I set the GetActiveUnitOfWork property of those two db adapters to true ,it successfully makes the global transaction work . any of them failed will cause the other rollback.
But the CatchAll brunch can't catch the exception in that case,
I can only see exception message from the system output :
02/11/2009 11:36:46 AM oracle.toplink.transaction.AbstractSynchronizationListener beforeCompletion
WARNING:
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.1.0) (Build 090527)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (Table1_PK) violated
from BPEL console , you can't even see the error , the process finished with no exception.
When I set GetActiveUnitOfWork to false, CatchAll brunch is able to catch the exception , but global rollback is not working .
I try all the other method like set the transaction property of BPEL to required , using checkpoint() in java embedding . it looks like only way is set GetActiveUnitOfWork to true, but can't catch exception.
Here are some updated:
Here is my process
Main Sequence
Invoke (dbadapter update)
Invoke (dbadapter insert)
Global CatchAll
Invoke(jmsAdapter sendjms)
if I disable the CatchAll branch , when insert failed , the insert will rollback as well, even GetActiveUnitOfWork set to false.
enable CatchAll branch , even doing nothing in this branch , the update won't rollback when insert failed. it looks like when catch the exception , bpel seems not rollback , I try to add throw rollback in catchall branch, no any effect.
any clue ?
Kevin
Edited by: kyi on Nov 5, 2009 10:10 AMHi All,
We are also facing a similar kind of issue.
We have a simple BPEL which will makes use of JAva embedding to call an end point to check its availibility.
The Java code for cheking the enpoint connectivity is below
try{
boolean endpointAvailable = false;
long start = System.currentTimeMillis();
int endpointTestURL_port = 8445 ;
int endpointTestURL_timeout = 500;
String endpointTestURL_queryString = "" ;
String endpointTestURL_protocol = (String)getVariableData ("endpointProtocol");
addAuditTrailEntry("endpointTestURL_protocol: " + endpointTestURL_protocol);
String endpointTestURL_host = (String)getVariableData ("endpointHost");
addAuditTrailEntry("endpointTestURL_hostl: " + endpointTestURL_host);
URL endpoint = new URL(endpointTestURL_protocol, endpointTestURL_host, 8445, endpointTestURL_queryString);
addAuditTrailEntry("endpoint object is created" );
String endpointTestURL = endpoint.toExternalForm();
addAuditTrailEntry("Checking availability of endpoint at URL: " + endpointTestURL);
// Configure connection
HttpURLConnection connection = (HttpURLConnection)endpoint.openConnection();
connection.setRequestMethod("GET");
addAuditTrailEntry("The Method is Get");
connection.setConnectTimeout(5000);
addAuditTrailEntry("Timeout is 500 ms");
// Open connection
connection.connect();
addAuditTrailEntry("Open Connection");
String responseMessage = connection.getResponseMessage();
addAuditTrailEntry("Recieved availability response from endpoint as: " + responseMessage);
// Close connection
connection.disconnect();
endpointAvailable = true;
if (endpointAvailable)
setVariableData("crmIsAvailable", "true");
else
setVariableData("crmIsAvailable", "false");
catch(Exception e)
System.out.println ("Error in checking endpoint availability " + e) ;
addAuditTrailEntry("error message is : " +e);
When we run the above as a seperate java program it runs fine i.e goes to the catch block and catches the exception.
But when we run it within the java embedding in BPEL(11G) it gives us the follwoing error.
The reason was The execution of this instance "490001" for process "default/GMDSSalesLeadsBackMediationInterface!1.0*soa_e1a6362f-c148-417c-819c-9327017ebfa4" is supposed to be in an active jta transaction, the current transaction status is "ROLLEDBACK" .
Consult the system administrator regarding this error.
at com.oracle.bpel.client.util.TransactionUtils.throwExceptionIfTxnNotActive(TransactionUtils.java:119)
at com.collaxa.cube.engine.CubeEngine.store(CubeEngine.java:4055)
at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4372)
at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4281)
at com.collaxa.cube.engine.CubeEngine._createAndInvoke(CubeEngine.java:713)
at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:545)
at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:654)
at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:355)
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:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
at oracle.security.jps.ee.ejb.JpsAbsInterceptor$1.run(JpsAbsInterceptor.java:88)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
at oracle.security.jps.wls.JpsWeblogicEjbInterceptor.runJaasMode(JpsWeblogicEjbInterceptor.java:61)
at oracle.security.jps.ee.ejb.JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:106)
at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:106)
at sun.reflect.GeneratedMethodAccessor960.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
at weblogic.ejb.container.injection.EnvironmentInte
we also get
BEA1-108EA2A88DAF381957FF
weblogic.transaction.internal.TimedOutException: Transaction timed out after 301 seconds
BEA1-108EA2A88DAF381957FF
at weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1733)
at weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:1578)
at weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1900)
at weblogic.transaction.internal.ServerTransactionManagerImpl.wakeUp(ServerTransactionManagerImpl.java:1488)
at weblogic.transaction.internal.WLSTimer.timerExpired(WLSTimer.java:35)
at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
javax.ejb.EJBException: Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: Transaction timed out after 301 seconds
BEA1-108EA2A88DAF381957FF
We tried the following
Increase the JTA timeout in the EM console to a larger value like 600 secs.
The BPEL instance is not getting created.
Any help would be appreciated
Thanks
Lalit -
Can i catch an exception from another thread?
hi,guys,i have some code like this:
public static void main(String[] args) {
TimeoutThread time = new TimeoutThread(100,new TimeOutException("超时"));
try{
t.start();
}catch(Exception e){
System.out.println("eeeeeeeeeee");
TimeoutThread will throws an exception when it runs ,but now i can't get "eeeeeeeeeee" from my console when i runs the main bolck code.
i asked this question in concurrent forums,somebody told me that i can't.so ,i think if i can do this from aspect of jvm.
thank you for your help
Edited by: Darryl Burke -- Double post of how to catching exceptions from another thread lockinguser5449747 wrote:
so ,i think if i can do this from aspect of jvm. What does that mean? You think you'll get a different answer in a different forum?
You can't catch exceptions from another thread. It's that easy. You could somehow ensure that exceptions from that other thread are always caught and somehow passed to your thread, but that would be a different thing (you would still be catching the exception on the thread it is originating from, as is the only way).
For example you can use setUncaughtExceptionHandler() on your thread to provide an object that handles an uncaught exceptions (and you could pass that uncaught exception to your other thread in some way). -
How to catch exception when have max connection pool
hi,
i have define in oracle user that i could have max 10 sessions at the same time.
I have jdbc datasource & connection pool defined at glassfish server(JSF application).
now, if in application is too many queries to the database then i have error: nullpointer exception - becouse when i try to do:
con = Database.createConnection(); - it generates nullpointer exception becouse there isn't free connection pool
i try to catch exception like this:
public List getrep_dws_wnioski_wstrzymane_graph() { int i = 0; try { con = Database.createConnection(); ps = (Statement) con.createStatement(); rs = ps.executeQuery("select data, klasa, ile_dni_wstrzymana, ile_wnioskow from stg1230.dwsww_wstrzymane_dws8 order by data, klasa, ile_dni_wstrzymana, ile_wnioskow"); while(rs.next()){ rep_dws_wnioski_wstrzymane_graph.add(i,new get_rep_dws_wnioski_wstrzymane_graph(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4))); i++; } } catch (NamingException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); throw new NoConnectionException(); // catch null 1 } finally { try { con.close(); } catch (SQLException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); throw new NoConnectionException(); // catch null 2 } } return rep_dws_wnioski_wstrzymane_graph; }
but at line:
con.close();
i have nullpointerexception
and
at line
throw new NoConnectionException(); // catch null 2
i have: caused by exception.NoConnectionException
what's wrong with my exception class? how to resolve it?
public class NoConnectionException extends RuntimeException{ public NoConnectionException(String msg, Throwable cause){ super(msg, cause); } public NoConnectionException(){ super(); } }
at web.xml i have defined:
<error-page> <exception-type>exception.NoConnectionException</exception-type> <location>/NoConnectionExceptionPage.jsp</location> </error-page>thanks,
i did it and i have error:
java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit
at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
at logic.Database.createConnection(Database.java:37): conn = ds.getConnection();
public class Database {
public static Connection createConnection() throws NamingException,
SQLException {
Connection conn = null;
try{
Context ctx = new InitialContext();
if (ctx == null) {
throw new NamingException("No initial context");
DataSource ds = (DataSource) ctx.lookup("jdbc/OracleReports");
if (ds == null) {
throw new NamingException("No data source");
conn = ds.getConnection(); // here's exception when max connections to database
if (conn == null) {
throw new SQLException("No database connection");
} catch (NamingException e) {
e.printStackTrace();
throw new NoConnectionException();
} catch (SQLException e) {
e.printStackTrace();
throw new NoConnectionException();
catch (NullPointerException e) {
e.printStackTrace();
throw new NoConnectionException(); // obsluga bledy na wypadek jesli braknie wolnych polaczen do bazy
return conn;
}and at my ealier code i have error:
at logic.GetDataOracle.getrep_dws_wnioski_wstrzymane_graph(GetDataOracle.java:192)
at line: con = Database.createConnection();
in code:
public List getrep_dws_wnioski_wstrzymane_graph() {
int i = 0;
try {
con = Database.createConnection();
ps = (Statement) con.createStatement();
rs = ps.executeQuery("select data, klasa, ile_dni_wstrzymana, ile_wnioskow from stg1230.dwsww_wstrzymane_dws8 order by data, klasa, ile_dni_wstrzymana, ile_wnioskow");
while(rs.next()){
rep_dws_wnioski_wstrzymane_graph.add(i,new get_rep_dws_wnioski_wstrzymane_graph(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4)));
i++;
} catch (NamingException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (NullPointerException e) {
e.printStackTrace();
throw new NoConnectionException();
} finally {
try {
if(con != null)
con.close();
} catch (SQLException e) {
e.printStackTrace();
} catch (NullPointerException e) {
e.printStackTrace();
throw new NoConnectionException();
return rep_dws_wnioski_wstrzymane_graph;
}so what's wrong?
i have limit max sessions 10 at oracle so i set at my connection pool 5 connections as max. But when i get max 5 sesssins and try to execute next query then i can't catch exception.. -
How to catch exception from shared library on Linux?
Description:
JNI dynamically loads shared library. Shared library throws exception (class CTestException). JNI can not catch it by CTestException name, only (...) works.
My config:
Linux RH AS 4 (x86 64)
gcc: 3.4.5
glib: 2.2.5
Java 1.5.0_06
g++ compiler options for JNI and shared libraries:
g++ -Wl,-E -fPIC -shared ...
There are multiple bugs on Java bugs database regarding C++ ABI incompatibility between Java binaries and stdc++ libraries linked with native code. But I could not find any conclusions on these bugs. Only plans/suggestions to recompile Java on new gcc. These bugs were quite old (regarding Java 1.3, 1.4). Now 1.6 is available but still there is same incompatibility. Maybe I am missing something and there is a way to fix this problem? Like to use specific gcc/glib versions for compilation? How people solve such problems? Any help is appreciated.It isn't any different; the commands are the same. You can find the exp executable in tehe $ORACLE_HOME/bin directory.
-
The rainbow circle comes on as soon as the iTunes tries to recognize the iPad 1.
And from that point it is a loop I can not break except via Force Quit.
I am awaiting a Snow Lep[ard disk to tray and remove Mountain Lion
which has been trouble since the day of original instalation.
I have had to twice reload Mounatain Lion via the net
and It is still dangerously unstable on my earl 2009 intel machine.
One very unhappy camper here.Also with WiFi off on iPad I can run iTunes,
but use USB to connect the iPad and it all goes bad again.
I can find no way to make itunes and iPad recognize each other.
It just keeps looping around.
From the console get this ( redacted loop) :
3/10/13 2:59:35.604 PM AppleMobileDeviceHelper[458]: [0x10020c2b0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
3/10/13 2:59:34.266 PM SyncServer[1708]: [0x7f90d840bed0] |Autoregistration|Error| failed to autoregister client description /Applications/Safari.app/Contents/SafariSyncClient.app/Contents/Resources/Safar iClientDescription.plist: *** SyncServices Exception
Type : ISDSQLiteStatementExecutionException
Reason : error executing statement: 8 (attempt to write a readonly database)
Database Path : */Library/Application Support/SyncServices/Local/admin.syncdb
Database Access Mode : Read Only
Open SQLite Files :
*/Library/Application Support/SyncServices/Local/admin.syncdb
Stack Trace :
0 SyncServices 0x00007fff9166c22c _ISDSQLiteBlowOut + 1107
1 SyncServices 0x00007fff91674971 -[ISDDatabase(SqliteHelpers) raiseSQLiteExceptionWithName:format:] + 237
2 SyncServices 0x00007fff915d3dba -[ISDDatabase(SqliteHelpers) stepStatement:] + 220
3 SyncServices 0x00007fff9161d6cc -[ISDAdminDatabase executeSQLToUpdateOrInsertClient:] + 321
4 SyncServices 0x00007fff9161e441 -[ISDAdminDatabase updateClient:] + 121
5 SyncServices 0x00007fff91622387 -[ISDDataManager noteChangesFromClient:key:value:] + 406
6 SyncServices 0x00007fff91623a77 -[ISDDataManager _updateSyncAlertToolForClient:fromDescription:] + 279
7 SyncServices 0x00007fff91625a36 -[ISDDataManager _updateClient:fromDescription:forceRefresh:] + 1573
8 SyncServices 0x00007fff916263cf -[ISDDataManager registerClientWithIdentifier:description:descriptionFilePath:descriptionBundleI d:descriptionBundleRelativePath:descriptionBinRelativePath:wasChanged:] + 773
9 SyncServices 0x00007fff9164ec59 -[ISDServer registerClientWithIdentifier:description:descriptionFilePath:descriptionBundleI d:descriptionBundleRelativePath:descriptionBinRelativePath:] + 298
10 SyncServices 0x00007fff9164ed5a -[ISDServer registerClientWithIdentifier:description:descriptionFilePath:descriptionBundleI d:descriptionBundleRelativePath:] + 38
11 SyncServices 0x00007fff91651821 -[ISDServer autoregisterDefaultClients] + 1925
12 SyncServer 0x000000010a898ec9 SyncServer + 7881
13 libdyld.dylib 0x00007fff974457e1 start + 0
3/10/13 2:59:34.312 PM SyncServer[1708]: [0x7f90d840bed0] |DataManager|Warning| Unregistering client KotoeriUserDictSyncClientIdentiifier because client description file at path /System/Library/Input Methods/Kotoeri.app/Contents/Support/WordRegister.app/Contents/Resources/Kotoer iUserDict.syncschema/Contents/Resources/ClientDescription.plist does not exist.
3/10/13 2:59:34.314 PM SyncServer[1708]: [0x7f90d840bed0] |ISDException|Error| *** SyncServices Exception
Type : ISDSQLiteStatementExecutionException
Reason : error executing statement: 8 (attempt to write a readonly database)
Database Path : */Library/Application Support/SyncServices/Local/admin.syncdb
Database Access Mode : Read Only
Open SQLite Files :
*/Library/Application Support/SyncServices/Local/admin.syncdb
Stack Trace :
0 SyncServices 0x00007fff9166c22c _ISDSQLiteBlowOut + 1107
1 SyncServices 0x00007fff91674971 -[ISDDatabase(SqliteHelpers) raiseSQLiteExceptionWithName:format:] + 237
2 SyncServices 0x00007fff915d3dba -[ISDDatabase(SqliteHelpers) stepStatement:] + 220
3 SyncServices 0x00007fff9161d04c -[ISDAdminDatabase executeSQLToRemoveSyncStatesForClient:] + 192
4 SyncServices 0x00007fff9161d7ed -[ISDAdminDatabase executeSQLToRemoveClient:] + 38
5 SyncServices 0x00007fff9161e564 -[ISDAdminDatabase removeClient:] + 102
6 SyncServices 0x00007fff91626512 -[ISDDataManager unregisterClientWithIdentifier:] + 158
7 SyncServices 0x00007fff91625df6 -[ISDDataManager _validateClientDescriptionFilesAndUnregisterIfNecessary] + 362
8 SyncServer 0x000000010a89913c SyncServer + 8508
9 libdyld.dylib 0x00007fff974457e1 start + 0
3/10/13 2:59:34.315 PM SyncServer[1708]: [0x7f90d840bed0] |AdminDB|Error| Exception *** SyncServices Exception
Type : ISDSQLiteStatementExecutionException
Reason : error executing statement: 8 (attempt to write a readonly database)
Database Path : */Library/Application Support/SyncServices/Local/admin.syncdb
Database Access Mode : Read Only
Open SQLite Files :
*/Library/Application Support/SyncServices/Local/admin.syncdb
Stack Trace :
0 SyncServices 0x00007fff9166c22c _ISDSQLiteBlowOut + 1107
1 SyncServices 0x00007fff91674971 -[ISDDatabase(SqliteHelpers) raiseSQLiteExceptionWithName:format:] + 237
2 SyncServices 0x00007fff915d3dba -[ISDDatabase(SqliteHelpers) stepStatement:] + 220
3 SyncServices 0x00007fff9161d04c -[ISDAdminDatabase executeSQLToRemoveSyncStatesForClient:] + 192
4 SyncServices 0x00007fff9161d7ed -[ISDAdminDatabase executeSQLToRemoveClient:] + 38
5 SyncServices 0x00007fff9161e564 -[ISDAdminDatabase removeClient:] + 102
6 SyncServices 0x00007fff91626512 -[ISDDataManager unregisterClientWithIdentifier:] + 158
7 SyncServices 0x00007fff91625df6 -[ISDDataManager _validateClientDescriptionFilesAndUnregisterIfNecessary] + 362
8 SyncServer 0x000000010a89913c SyncServer + 8508
9 libdyld.dylib 0x00007fff974457e1 start + 0
) executing sql to remove client <ISDClient 0x7f90d8431060 [KotoeriUserDictSyncClientIdentiifier]>{ type="app" name="Kotoeri SyncDictionary Client"
description file="<ISDFileReference 0x7f90d843f290 [B1037167-0242-4123-8A7B-0FB786317B8E-2421-000013020ED7DFA7]]>{ path="/System/Library/Input Methods/Kotoeri.app/Contents/Support/WordRegister.app/Contents/Resources/Kotoer iUserDict.syncschema/Contents/Resources/ClientDescription.plist"; mtime=2009-06-11 02:33:40 +0000; bundleId="(null)"; bundleRelativePath="(null)"; windowsBinRelativePath="(null)"}"
image="<ISDFileReference 0x7f90d843e970 [94053BBC-465B-4976-A2BF-BDAB33DF7004-2421-000013020EDFBB19]]>{ path="/System/Library/Input Methods/Kotoeri.app/Contents/Support/WordRegister.app/Contents/Resources/Kotoer iUserDict.syncschema/Contents/Resources/SyncDictionary.icns"; mtime=2009-06-11 02:33:40 +0000; bundleId="(null)"; bundleRelativePath="(null)"; windowsBinRelativePath="(null)"}"
formatter="(null)" ((null))
localization bundle="(null)"
sync alert tool="<ISDFileReference 0x7f90d84373f0 [5BAB142B-1BD3-44F9-8291-2A7E49A7FDBE-9198-000027F70A92CAA6]]>{ path="/System/Library/Input Methods/Kotoeri.app/Contents/Support/WordRegister.app/Contents/SharedSupport/Sy ncingDictionaryTool"; mtime=2012-09-26 21:50:13 +0000; bundleId="(null)"; bundleRelativePath="(null)"; windowsBinRelativePath="(null)"}"
syncs after = no
sync alert types="(
server
sync states = (
"<ISDSyncState 0x7f90d84368f0 [com.apple.inputmethod.Kotoeri.sync.dictionary.SyncEntity]>{ last sync 0 (null) status=7 enabled=1 wants pull Truth=0 sync mode=3 pull-only=0 push-only=0 refilter=0 properties=com.apple.syncservices.RecordEntityName, dictionary name, word, key, privSpeech}"
local ids are guids = no
3/10/13 2:59:34.363 PM SyncServer[1708]: [0x7f90d840bed0] |ISDException|Error| *** SyncServices Exception
Type : ISDSQLiteStatementExecutionException
Reason : error executing statement: 8 (attempt to write a readonly database)
Database Path : */Library/Application Support/SyncServices/Local/admin.syncdb
Database Access Mode : Read Only
Open SQLite Files :
*/Library/Application Support/SyncServices/Local/admin.syncdb
Stack Trace :
0 SyncServices 0x00007fff9166c22c _ISDSQLiteBlowOut + 1107
1 SyncServices 0x00007fff91674971 -[ISDDatabase(SqliteHelpers) raiseSQLiteExceptionWithName:format:] + 237
2 SyncServices 0x00007fff915d3dba -[ISDDatabase(SqliteHelpers) stepStatement:] + 220
3 SyncServices 0x00007fff9161d04c -[ISDAdminDatabase executeSQLToRemoveSyncStatesForClient:] + 192
4 SyncServices 0x00007fff9161d7ed -[ISDAdminDatabase executeSQLToRemoveClient:] + 38
5 SyncServices 0x00007fff9161e564 -[ISDAdminDatabase removeClient:] + 102
6 SyncServices 0x00007fff91626512 -[ISDDataManager unregisterClientWithIdentifier:] + 158
7 SyncServices 0x00007fff91625df6 -[ISDDataManager _validateClientDescriptionFilesAndUnregisterIfNecessary] + 362
8 SyncServer 0x000000010a89913c SyncServer + 8508
9 libdyld.dylib 0x00007fff974457e1 start + 0
3/10/13 2:59:34.364 PM SyncServer[1708]: [0x7f90d840bed0] |Server|Error| fatal error during sync server initialization: *** SyncServices Exception
Type : ISDSQLiteStatementExecutionException
Reason : error executing statement: 8 (attempt to write a readonly database)
Database Path : */Library/Application Support/SyncServices/Local/admin.syncdb
Database Access Mode : Read Only
Open SQLite Files :
*/Library/Application Support/SyncServices/Local/admin.syncdb
Stack Trace :
0 SyncServices 0x00007fff9166c22c _ISDSQLiteBlowOut + 1107
1 SyncServices 0x00007fff91674971 -[ISDDatabase(SqliteHelpers) raiseSQLiteExceptionWithName:format:] + 237
2 SyncServices 0x00007fff915d3dba -[ISDDatabase(SqliteHelpers) stepStatement:] + 220
3 SyncServices 0x00007fff9161d04c -[ISDAdminDatabase executeSQLToRemoveSyncStatesForClient:] + 192
4 SyncServices 0x00007fff9161d7ed -[ISDAdminDatabase executeSQLToRemoveClient:] + 38
5 SyncServices 0x00007fff9161e564 -[ISDAdminDatabase removeClient:] + 102
6 SyncServices 0x00007fff91626512 -[ISDDataManager unregisterClientWithIdentifier:] + 158
7 SyncServices 0x00007fff91625df6 -[ISDDataManager _validateClientDescriptionFilesAndUnregisterIfNecessary] + 362
8 SyncServer 0x000000010a89913c SyncServer + 8508
9 libdyld.dylib 0x00007fff974457e1 start + 0
3/10/13 2:59:34.373 PM com.apple.launchd.peruser.507[216]: (com.apple.syncservices.SyncServer[1708]) Exited with code: 1
3/10/13 2:59:34.441 PM AppleMobileDeviceHelper[1491]: [0x10020c2b0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
3/10/13 2:59:34.593 PM com.apple.launchd.peruser.507[216]: (com.apple.syncservices.SyncServer) Throttling respawn: Will start in 8 seconds
3/10/13 2:59:34.710 PM AppleMobileDeviceHelper[683]: [0x10020c2b0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
3/10/13 2:59:34.748 PM AppleMobileDeviceHelper[625]: [0x10020c2b0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
3/10/13 2:59:34.889 PM AppleMobileDeviceHelper[994]: [0x10020c2d0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
3/10/13 2:59:35.604 PM AppleMobileDeviceHelper[458]: [0x10020c2b0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
Etc ----------- Etc ----------- Etc ----------- Etc -----------
Etc ----------- Etc ----------- Etc ----------- Etc -----------
Etc ----------- Etc ----------- Etc ----------- Etc -----------
3/10/13 3:00:45.296 PM SyncServer[1759]: [0x7fda8940bed0] |ISDException|Error| *** SyncServices Exception
Type : ISDSQLiteStatementExecutionException
Reason : error executing statement: 8 (attempt to write a readonly database)
Database Path : */Library/Application Support/SyncServices/Local/admin.syncdb
Database Access Mode : Read Only
Open SQLite Files :
*/Library/Application Support/SyncServices/Local/admin.syncdb
Stack Trace :
0 SyncServices 0x00007fff9166c22c _ISDSQLiteBlowOut + 1107
1 SyncServices 0x00007fff91674971 -[ISDDatabase(SqliteHelpers) raiseSQLiteExceptionWithName:format:] + 237
2 SyncServices 0x00007fff915d3dba -[ISDDatabase(SqliteHelpers) stepStatement:] + 220
3 SyncServices 0x00007fff9161d04c -[ISDAdminDatabase executeSQLToRemoveSyncStatesForClient:] + 192
4 SyncServices 0x00007fff9161d7ed -[ISDAdminDatabase executeSQLToRemoveClient:] + 38
5 SyncServices 0x00007fff9161e564 -[ISDAdminDatabase removeClient:] + 102
6 SyncServices 0x00007fff91626512 -[ISDDataManager unregisterClientWithIdentifier:] + 158
7 SyncServices 0x00007fff91625df6 -[ISDDataManager _validateClientDescriptionFilesAndUnregisterIfNecessary] + 362
8 SyncServer 0x000000010013f13c SyncServer + 8508
9 libdyld.dylib 0x00007fff974457e1 start + 0
3/10/13 3:00:45.297 PM SyncServer[1759]: [0x7fda8940bed0] |AdminDB|Error| Exception *** SyncServices Exception
Type : ISDSQLiteStatementExecutionException
Reason : error executing statement: 8 (attempt to write a readonly database)
Database Path : */Library/Application Support/SyncServices/Local/admin.syncdb
Database Access Mode : Read Only
Open SQLite Files :
*/Library/Application Support/SyncServices/Local/admin.syncdb
Stack Trace :
0 SyncServices 0x00007fff9166c22c _ISDSQLiteBlowOut + 1107
1 SyncServices 0x00007fff91674971 -[ISDDatabase(SqliteHelpers) raiseSQLiteExceptionWithName:format:] + 237
2 SyncServices 0x00007fff915d3dba -[ISDDatabase(SqliteHelpers) stepStatement:] + 220
3 SyncServices 0x00007fff9161d04c -[ISDAdminDatabase executeSQLToRemoveSyncStatesForClient:] + 192
4 SyncServices 0x00007fff9161d7ed -[ISDAdminDatabase executeSQLToRemoveClient:] + 38
5 SyncServices 0x00007fff9161e564 -[ISDAdminDatabase removeClient:] + 102
6 SyncServices 0x00007fff91626512 -[ISDDataManager unregisterClientWithIdentifier:] + 158
7 SyncServices 0x00007fff91625df6 -[ISDDataManager _validateClientDescriptionFilesAndUnregisterIfNecessary] + 362
8 SyncServer 0x000000010013f13c SyncServer + 8508
9 libdyld.dylib 0x00007fff974457e1 start + 0
) executing sql to remove client <ISDClient 0x7fda8a609e20 [KotoeriUserDictSyncClientIdentiifier]>{ type="app" name="Kotoeri SyncDictionary Client"
description file="<ISDFileReference 0x7fda8a60a370 [B1037167-0242-4123-8A7B-0FB786317B8E-2421-000013020ED7DFA7]]>{ path="/System/Library/Input Methods/Kotoeri.app/Contents/Support/WordRegister.app/Contents/Resources/Kotoer iUserDict.syncschema/Contents/Resources/ClientDescription.plist"; mtime=2009-06-11 02:33:40 +0000; bundleId="(null)"; bundleRelativePath="(null)"; windowsBinRelativePath="(null)"}"
image="<ISDFileReference 0x7fda8a61f530 [94053BBC-465B-4976-A2BF-BDAB33DF7004-2421-000013020EDFBB19]]>{ path="/System/Library/Input Methods/Kotoeri.app/Contents/Support/WordRegister.app/Contents/Resources/Kotoer iUserDict.syncschema/Contents/Resources/SyncDictionary.icns"; mtime=2009-06-11 02:33:40 +0000; bundleId="(null)"; bundleRelativePath="(null)"; windowsBinRelativePath="(null)"}"
formatter="(null)" ((null))
localization bundle="(null)"
sync alert tool="<ISDFileReference 0x7fda8a61fe30 [5BAB142B-1BD3-44F9-8291-2A7E49A7FDBE-9198-000027F70A92CAA6]]>{ path="/System/Library/Input Methods/Kotoeri.app/Contents/Support/WordRegister.app/Contents/SharedSupport/Sy ncingDictionaryTool"; mtime=2012-09-26 21:50:13 +0000; bundleId="(null)"; bundleRelativePath="(null)"; windowsBinRelativePath="(null)"}"
syncs after = no
sync alert types="(
server
sync states = (
"<ISDSyncState 0x7fda8a609940 [com.apple.inputmethod.Kotoeri.sync.dictionary.SyncEntity]>{ last sync 0 (null) status=7 enabled=1 wants pull Truth=0 sync mode=3 pull-only=0 push-only=0 refilter=0 properties=com.apple.syncservices.RecordEntityName, dictionary name, word, key, privSpeech}"
local ids are guids = no
3/10/13 3:00:45.342 PM SyncServer[1759]: [0x7fda8940bed0] |ISDException|Error| *** SyncServices Exception
Type : ISDSQLiteStatementExecutionException
Reason : error executing statement: 8 (attempt to write a readonly database)
Database Path : */Library/Application Support/SyncServices/Local/admin.syncdb
Database Access Mode : Read Only
Open SQLite Files :
*/Library/Application Support/SyncServices/Local/admin.syncdb
Stack Trace :
0 SyncServices 0x00007fff9166c22c _ISDSQLiteBlowOut + 1107
1 SyncServices 0x00007fff91674971 -[ISDDatabase(SqliteHelpers) raiseSQLiteExceptionWithName:format:] + 237
2 SyncServices 0x00007fff915d3dba -[ISDDatabase(SqliteHelpers) stepStatement:] + 220
3 SyncServices 0x00007fff9161d04c -[ISDAdminDatabase executeSQLToRemoveSyncStatesForClient:] + 192
4 SyncServices 0x00007fff9161d7ed -[ISDAdminDatabase executeSQLToRemoveClient:] + 38
5 SyncServices 0x00007fff9161e564 -[ISDAdminDatabase removeClient:] + 102
6 SyncServices 0x00007fff91626512 -[ISDDataManager unregisterClientWithIdentifier:] + 158
7 SyncServices 0x00007fff91625df6 -[ISDDataManager _validateClientDescriptionFilesAndUnregisterIfNecessary] + 362
8 SyncServer 0x000000010013f13c SyncServer + 8508
9 libdyld.dylib 0x00007fff974457e1 start + 0
3/10/13 3:00:45.343 PM SyncServer[1759]: [0x7fda8940bed0] |Server|Error| fatal error during sync server initialization: *** SyncServices Exception
Type : ISDSQLiteStatementExecutionException
Reason : error executing statement: 8 (attempt to write a readonly database)
Database Path : */Library/Application Support/SyncServices/Local/admin.syncdb
Database Access Mode : Read Only
Open SQLite Files :
*/Library/Application Support/SyncServices/Local/admin.syncdb
Stack Trace :
0 SyncServices 0x00007fff9166c22c _ISDSQLiteBlowOut + 1107
1 SyncServices 0x00007fff91674971 -[ISDDatabase(SqliteHelpers) raiseSQLiteExceptionWithName:format:] + 237
2 SyncServices 0x00007fff915d3dba -[ISDDatabase(SqliteHelpers) stepStatement:] + 220
3 SyncServices 0x00007fff9161d04c -[ISDAdminDatabase executeSQLToRemoveSyncStatesForClient:] + 192
4 SyncServices 0x00007fff9161d7ed -[ISDAdminDatabase executeSQLToRemoveClient:] + 38
5 SyncServices 0x00007fff9161e564 -[ISDAdminDatabase removeClient:] + 102
6 SyncServices 0x00007fff91626512 -[ISDDataManager unregisterClientWithIdentifier:] + 158
7 SyncServices 0x00007fff91625df6 -[ISDDataManager _validateClientDescriptionFilesAndUnregisterIfNecessary] + 362
8 SyncServer 0x000000010013f13c SyncServer + 8508
9 libdyld.dylib 0x00007fff974457e1 start + 0
3/10/13 3:00:45.355 PM com.apple.launchd.peruser.507[216]: (com.apple.syncservices.SyncServer[1759]) Exited with code: 1
3/10/13 3:00:45.485 PM AppleMobileDeviceHelper[458]: [0x10020c2b0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
3/10/13 3:00:45.562 PM AppleMobileDeviceHelper[1491]: [0x10020c2b0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
3/10/13 3:00:45.637 PM com.apple.launchd.peruser.507[216]: (com.apple.syncservices.SyncServer) Throttling respawn: Will start in 9 seconds
3/10/13 3:00:45.833 PM AppleMobileDeviceHelper[683]: [0x10020c2b0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
3/10/13 3:00:45.872 PM AppleMobileDeviceHelper[625]: [0x10020c2b0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
3/10/13 3:00:46.012 PM AppleMobileDeviceHelper[994]: [0x10020c2d0] |Mingler|Error| failed to connect to the server: NSInvalidReceivePortException connection went invalid while waiting for a reply because a mach port died
3/10/13 3:00:46.129 PM xpcd[978]: com.apple.ShareKitHelper[1765]: registration request failed: (0x11, 0x0) Container object initialization failed: NSCocoaErrorDomain:513 You don’t have permission to save the file “com.apple.ShareKitHelper” in the folder “Containers”.
Dest: ~/Library/Containers/com.apple.ShareKitHelper/Data/Library/Preferences
Destination permissions info:
0 stat: 2
-1 stat: 2
-2 stat: 2
-3 stat: 2
-4 o:Root m:040755 f:()
!#acl 1
user:D978C030-0D6E-4A58-A012-372B84E56E0D:daviddonald2:507:allow:read,execute,re adattr,readextattr,readsecurity
user:F75E5500-9D70-483E-B876-56D2EF93AB4A:daviddonald:504:allow:read,execute,rea dattr,readextattr,readsecurity
fs: hfs, fsid: 1000006/11, mf: 0480d000
-5 <LIBRARY> o:User m:040700 f:hidden
!#acl 1
group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF0000000C:everyone:12:deny:delete
fs: hfs, fsid: 1000006/11, mf: 0480d000
-6 <HOME> o:User m:040750 f:()
!#acl 1
group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF0000000C:everyone:12:deny:delete
user:985AEC78-B80F-40F7-B3D2-9D2DFC63F373:ssns2:508:allow:read,write,execute,app end,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity
user:8DED6E0B-4D65-4B17-BEDA-D44EB02F8AF4:ssns:502:allow:read,write,execute,appe nd,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity
user:F75E5500-9D70-483E-B876-56D2EF93AB4A:daviddonald:504:allow:read,write,execu te,append,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity
fs: hfs, fsid: 1000006/11, mf: 0480d000
-7 o:Root m:040755 f:()
fs: hfs, fsid: 1000006/11, mf: 0480d000
3/10/13 3:00:46.507 PM ReportCrash[1741]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
3/10/13 3:00:46.507 PM ReportCrash[1741]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
3/10/13 3:00:46.507 PM ReportCrash[1741]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
3/10/13 3:00:46.507 PM ReportCrash[1741]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
3/10/13 3:00:46.507 PM ReportCrash[1741]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
3/10/13 3:00:46.508 PM ReportCrash[1741]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
3/10/13 3:00:46.508 PM ReportCrash[1741]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
3/10/13 3:00:46.508 PM ReportCrash[1741]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
3/10/13 3:00:46.508 PM ReportCrash[1741]: failed looking up LS service ( scCreateSystemService returned MACH_PORT_NULL, called from SetupCoreApplicationServicesCommunicationPort, so using client-side NULL calls.
3/10/13 3:00:46.508 PM ReportCrash[1741]: LaunchServices/5123589: Unable to lookup coreservices session port for session 0x186a0 uid=0 euid=0
3/10/13 3:00:46.565 PM com.apple.launchd[1]: (com.apple.ShareKitHelper[1765]) Job appears to have crashed: Illegal instruction: 4
3/10/13 3:00:46.565 PM com.apple.launchd[1]: (com.apple.ShareKitHelper) Throttling respawn: Will start in 10 seconds -
Why jsp throw exception , but error page can' t catch it .
I use japanese Unix.
so must add follow
<%@ page contentType="text/html;charset=SJIS" %>
then error happen
Jim Clark wrote:
> I'm not sure what the problem is, but the following works for me in WL5.1
> SP3 on NT:
>
> <%@ page errorPage="testerror.jsp" %>
> <h1>hello</h1>
> <%
> String yes = "yes";
> if ( yes.equals("yes")) throw new IllegalStateException("yes");
> %>
>
> The page that shows is my testerror.jsp. Double check your page directive
> specifying your error page.
>
> --
> Jim Clark
> Idea Integration
> http://www.idea.com
>
> "yang" <[email protected]> wrote in message news:[email protected]...
> > I use error page , but jsp have exception . error page not catch it.
> >
> > throw follow exception only
> >
> > ? 6 19 19:01:03 JST 2000:<E> <ServletContext-General> Servlet failed
> > with Exception
> >
> > java.lang.IllegalStateException: Attempt to change ContentType after
> > calling getWriter() (cannot cha
> > nge charset from 'SJIS' to 'null')
> > at java.lang.Throwable.fillInStackTrace(Native Method)
> > at java.lang.Throwable.fillInStackTrace(Compiled Code)
> > at java.lang.Throwable.<init>(Compiled Code)
> > at java.lang.Exception.<init>(Compiled Code)
> > at java.lang.RuntimeException.<init>(Compiled Code)
> > at java.lang.IllegalStateException.<init>(Compiled Code)
> > at
> > weblogic.servlet.internal.ServletResponseImpl.setEncoding(Compiled Code)
> >
> > at
> > weblogic.servlet.internal.ServletResponseImpl.setContentType(Compiled
> > Code)
> > at
> > weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
> > at
> > weblogic.servlet.internal.RequestDispatcherImpl.forward(Compiled Code)
> > at weblogic.servlet.jsp.PageContextImpl.forward(Compiled Code)
> > at
> > jsp_servlet._aeonmarket._loan._W_95_AEL032._jspService(Compiled Code)
> > at weblogic.servlet.jsp.JspBase.service(Compiled Code)
> > at
> > weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
> > at
> > weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
> > Code)
> > at
> > weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
> > Code)
> > at
> > weblogic.servlet.internal.ServletContextManager.invokeServlet(Compiled
> > Code)
> > at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled
> > Code)
> > at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
> > at weblogic.kernel.ExecuteThread.run(Compiled Code)
> >
Maybe you are looking for
-
Any Std SAP Report on Inventory Movement Bulk MAterials & Back Flushed item
Hello Is there any Standard SAP Report on Inventory Movements for Bulk Materials and Back flushed items ?
-
Hi there, I am collecting some advice and suggestions for using java with scanner. I was previously using a scanning program to handle survey results.... but there are HEAPS of trouble of that program(and I paid for that program). I am thinking of wr
-
Contact with same first name as previous, overwrit...
PC Suite 6.84. When I create a new contact with the same first name as an existing contact in PC Suite, and then I save it to the phone, the new contact info overwrites the old! For example: first name: Airlines last name: United So that entry is the
-
Select options , Parameters
Guy , if I write N* in a parameter or select option field , and I want the system to bring me all coincidences with N in a select , How can I do that ?. How it works , thank you.
-
I'm experimenting with JWS using a simple HelloWorld application. If I clear the cache, the app shows that it is starting, however, after a short time (30 seconds) the window closes (without ever starting my app). If I run the app again, I get the We