aspose file tools*
The moose likes Beginning Java and the fly likes Analysing a StackTrace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Analysing a StackTrace" Watch "Analysing a StackTrace" New topic
Author

Analysing a StackTrace

Abhishk Singh
Ranch Hand

Joined: Aug 19, 2010
Posts: 45
I have following understanding regarding stacktraces:
If method1 calls method2 which calls method3 and so on...
then a stacktrace prints up the methods from the memory stack in Last In First Out order, like if an error occurred in method(N), then the statck trace would contain something like:
method(N),method(N-1)......method2,method1.
Hence we can try and resolve the error at methodN.

Now in the web application I am working on, I am getting following exception stack trace:

Caused by:
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:127)
at java.util.zip.ZipFile.<init>(ZipFile.java:144)
at weblogic.utils.zip.ZipURLConnection.connect(Handler.java:81)
at weblogic.utils.zip.ZipURLConnection.getInputStream(Handler.java:59)
at java.net.URL.openStream(URL.java:1010)
at weblogic.webservice.core.encoding.DefaultRegistry.loadResource(DefaultRegistry.java:84)
at weblogic.webservice.core.encoding.DefaultRegistry.<init>(DefaultRegistry.java:39)
at weblogic.webservice.core.rpc.ServiceImpl.<init>(ServiceImpl.java:91)
at myapp.worklist_new.WorklistComponent1INFExport_WorklistComponent1INFHttpService_Impl.<init>(WorklistComponent1INFExport_WorklistComponent1INFHttpService_Impl.java:22)
at myapp.worklist_new.WorklistComponent1INFExport_WorklistComponent1INFHttpService_Impl.<init>(WorklistComponent1INFExport_WorklistComponent1INFHttpService_Impl.java:16)
at com.ultimatix.framework.util.WPSWorkflowImpl.getWorklistComponent1INF(WPSWorkflowImpl.java:1720)
at com.ultimatix.framework.util.WPSWorkflowImpl.getFilteredWorklist(WPSWorkflowImpl.java:1605)
at com.ultimatix.framework.util.WPSWorkflowImpl.getWorklist(WPSWorkflowImpl.java:390)
at com.ultimatix.framework.util.WorkflowDelegate.getWorklist(WorkflowDelegate.java:1106)
at com.ultimatix.sample.clientUtils.WorklistDelegate.getList(WorklistDelegate.java:190)
at com.ultimatix.framework.jsf.component.DataTablePaginatorBean.getDataPage(DataTablePaginatorBean.java:269)
at com.ultimatix.framework.jsf.component.DataTablePaginatorBean$LocalDataModel.fetchPage(DataTablePaginatorBean.java:143)
at com.ultimatix.framework.jsf.component.PagedListDataModel.getPage(PagedListDataModel.java:91)
at com.ultimatix.framework.jsf.component.PagedListDataModel.getRowCount(PagedListDataModel.java:71)
***********************************************************************************************************************

the statement: "myapp.worklist_new.WorklistComponent1INFExport_WorklistComponent1INFHttpService_Impl.<init>(WorklistComponent1INFExport_WorklistComponent1INFHttpService_Impl.java:22)" is used while invoking a web service from our web application. I am not able to realize how ZipException is coming in this stack trace, since the functionality to invoke the web service dosen't include opening any Zipped file.

Can it be due to any filters in the web application where some code related to Zip files may be present.

I would also like to mention that in the web application , at the place where code for opening and writing zipped file is present, there is no finally block after try/catch blocks to close ZipOutputStream. ZipOutputStream is closed in case of successful operation only and in case of an exception there is no finally block in the code to close this stream. Could this be a problem.

I understand that the question posted above is abstract and not very explanatory of the issue. Still request you to provide your inputs.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14342
    
  22

The <init> refers to a constructor, so if you see a line like this:

at java.util.zip.ZipFile.<init>(ZipFile.java:127)

it refers to code in the constructor of class java.util.zip.ZipFile.

HTTP requests and responses can be zipped, to save bandwidth (the less bytes you have to send over the network, the better). Probably you're calling a webservice here via WebLogic and the response to the request is zipped. WebLogic uses Java's built-in ZIP classes to unzip the response. Note that one of the classes used is named weblogic.utils.zip.ZipURLConnection. That sounds a lot like a HTTP connection class that uses ZIP.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Abhishk Singh
Ranch Hand

Joined: Aug 19, 2010
Posts: 45
Thanks for the input.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Analysing a StackTrace