Free Support Forum - aspose.com

Weblogic development timeout

Hi,
I have an issue when developing for Weblogic under myEclipse. It seems that the first time I invoke the (Aspose Words for Java) Document object after starting the web server it hangs up for about 30-40 seconds - just long enough for the web page I am developing to timeout.
This only happens once - the first instance of the Document object after starting Weblogic under myEclipse. After that it performs with normal speed. I apply the license in my Servlet startup, that is not hanging up.
This may not seem like much of a problem except that during the development stage - especially when developing a report - server restarts are relatively frequent (Weblogic does not hot deploy well with Struts) and time is money.
I also develop with Glassfish under myEclipse and it does not hang up; just an issue under Weblogic (tested under Weblogic 9 and 10, myEclipse version 8.5).

If there is any way you can figure out what is happening here I would appreciate it. The constant delay is annoying and reducing productivity.

Hi
Michael,


Thanks for your inquiry.

The extra time taken on the initial conversion is probably due to the following reasons:

  • When converting to HTML often shapes and some other drawing objects are rendered to graphics.
  • The first time a page or shape is rendered, Aspose.Words needs to precache fonts and other resources for rendering. This only happens for the first conversion.

If you want to do this precaching earlier then you can simply call doc.updatePageLayout() on an empty document.

Could you please verify if this happens on your machine even if you are converting a document with no shapes or images and just plain text?

Best Regards,

Thank you for the reply.
Yes, I have confirmed that this delay happens simply when opening a document, and I tested with a document (.dot) which is virtually empty (just one word of plain text).
I also found that in such a simple test the delay was much less than what I usually encounter. I took only 18 seconds to load the empty document on the first pass. In the next pass it took less than one second. When I am opening a real document, with more content it takes a lot longer of course and the combined delay is more like 30 to 40 seconds.
I have nothing but text and tables in my real documents.

I also confirmed that this does not happen under Glassfish; it seems to be related to Weblogic. Under Glassfish it opened the document in under a second on the first try.

Here is my test code:
public class AsposeStartupDelayTest extends HttpServlet {

public AsposeStartupDelayTest() {
super();
}

public void init() throws ServletException {
super.init();
}

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
// report start time
Calendar calendar = Calendar.getInstance();
java.sql.Timestamp currentTimestamp = new java.sql.Timestamp(calendar.getTimeInMillis());
System.out.println(“Begin open Document. time=” + currentTimestamp.toString());

// open Word template
Document doc = new Document(“d:/temp/asposeTest.dot”);

// report end time
calendar = Calendar.getInstance();
currentTimestamp = new java.sql.Timestamp(calendar.getTimeInMillis());
System.out.println(“Finished opening Document. time=” + currentTimestamp.toString());
} catch (Exception ex) {
System.out.println(ex);
}
}

}

Here are the results of two passes:

(first time after starting Weblogic)…
Begin open Document. time=2012-04-23 11:03:05.373
Finished opening Document. time=2012-04-23 11:03:23.088

(second time - Weblogic still running)…
Begin open Document. time=2012-04-23 11:03:35.913
Finished opening Document. time=2012-04-23 11:03:35.928

And again, the issue is not that I have to wait a few seconds, but that when developing a real report this delay is sufficient to cause the page I am testing to time out and I never see the results. The Aspose Words report is usually just one piece of the whole task and this often causes me to consume test cases without being able to verify that proper results were shown on the page.
Also, now that Oracle owns Java they have a habit of introducing things from Weblogic into Glassfish. Today this is just a Weblogic issue, but tomorrow it may well be a Glassfish issue as well.
Finally, I only see this delay in development (under myEclipse), it does not happen on the servers when running Weblogic directly.
Thanks again for checking into this - I understand it’s a tough issue.

Hi
Michael,


Thanks for the additional information. Could you please attach your input Word document, you’re getting this problem with, here for testing? I will investigate the issue on my side and provide you more information.

Best Regards,

This happens when opening ANY Word document (I tested .dot or .doc) with the Aspose Words Document object. However, I created a virtually empty document template file for verifying this issue and I will attach it now.

Thank You,
Michael Cory

Hi Michael,


Thanks for the inquiry. I’m afraid. I’m unable to reproduce the problem on my side. Please try to use the latest version at your end let us know how it goes on your side.

I Am using the latest version of Aspose Words.
You have not indicated what your test setup is.
You need to start Weblogic from MyEclipse and use exploded deployment. This is a development issue.

Hi Michael,


Thanks for the inquiry and sorry for the delay. As your query is taking some time to build exact scenario. It is to update you that I’m working on this and will update you as soon as possible.

Hi Michael,


Thanks for the inquiry. Could you please share some more details i.e. how much memory (RAM) is installed in your machine? , Operating System, OS Architecture (32 / 64 bit) and Stack Trace etc
In addition, have you tried it in run mode as shown in snapshot?

Hi Imran,

Yes, I have tried starting Weblogic in Run mode as you describe. I just tried that again to be sure and I still get the delay the first time I try to open a Word document using the Aspose Words Document object. As you can see from my test case there is nothing else going on in my code except opening a document.

I will provide as much info as I can about my system (below) but I have to say that I have a reasonably capable machine and that all other developers here have the same issue.
I think the most telling clues are that:
1. I do not have this issue when developing with Glassfish (same setup - myEclipse, hot deploy).
2. I do not experience this delay on the test or production servers (which makes me suspect something about starting Weblogic from Eclipse).
3. All other developers here have the same issue.

You have the insight into the Document object - what could be happening here? Is it trying to verify the license (I have newly acquired a valid license)? Trying to access other resources besides the document I am opening? Could this be a network issue?


My Machine:
Dell Optiplex 755
Intel Core 2 Duo CPU E6550 @2.33 GHZ
1.98 GHZ, 1.96 GB RAM

OS: Windows XP Professional 2002 Service Pack 3 (32 bit)

There is not stack trace, no Exceptions are thrown, it just takes anywhere from 15 to 45 seconds to open a document that would normally open 1-2 seconds.

Eclipse configuration:
MyEclipse Version: 8.5 Build id: 8.5-20100319
I am running Weblogic 9.1 (to match the customer) and Eclipse is configured to run Weblogic using the JDK it shipped with (D:\bea\jdk150_04)

Optional JVM Arguments for Weblogic:
-Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=32m -XX:MaxPermSize=128m -Xverify:none -da


Thank You,
Michael


FYI - I just tried starting Weblogic using the jrocket JVM that shipped with Weblogic 9.1 (D:\bea\jrockit90_150_04).<br>Same issue. I know I tried all these things before, but thought you might ask, so I tried again.<br><br>    I have tried so many things now that I think I could reproduce this issue anywhere, given myEclipse and Weblogic. I had even tried on a new machine, running Windows 7 with Weblogic version 10 and had exactly the same issue.<br><br>    So, if this is an internal issue, like network related, then what else is happening when trying to open a document?<br><br>Michael<br>

Hi Michael,


It is unfortunate to hear about the issue you are having .We will do our best to find the issue and resolve it as soon as possible. Could you please clarify if the same issue happens when loading a blank document? i.e calling Document doc = new Document();

Thanks,

Adam,
Yes. I just tried running my test Servlet with a blank document as you have described above and indeed it took several seconds to instance the (empty) Document object.
Here is the output from my test Servlet (provided earlier)…

The first time hitting the Servlet it took 24 seconds…
Begin open Document. time=2012-05-04 11:18:25.764
Finished opening Document. time=2012-05-04 11:18:49.035

The second time took only a few milliseconds!..
Begin open Document. time=2012-05-04 11:18:56.113
Finished opening Document. time=2012-05-04 11:18:56.129

Of course there will be some time to load the Servlet, but that is typically less than one second.

Thank You,
Michael

Hi Michael,


Thanks for your patience and providing the additional information. We are working over your query and will get back to you as soon as possible.

Best Regards,

Have you been able to reproduce this issue?

Hi
Michael,


Thanks for your patience. I have restarted my machine and tested your scenario over Oracle’s WebLogic Server 10.3.0; the total elapsed time observed on 64-bit Windows 7 platform for the first run was 44 seconds. But, it includes the time WebLogic Server takes to start (approx 43 seconds for the first time). The ‘Document’ loading did not take much time (approx 0.5 seconds) on my side. Moreover, I used the latest version of Aspose.Words for Java i.e. 11.4.0 on my side. Could you please download the latest version of Aspose.Words from the following link and let us know how it goes on your side?
http://www.aspose.com/community/files/72/java-components/aspose.words-for-java/default.aspx

I hope, this will help.

Best Regards,

If you used my simple test servlet, it is clear that I am not counting the time it takes for Weblogic server to start up! I did download the latest version back in April when I reported this issue to you and I don’t have the time to keep proving this issue to you. Unless you can tell me that you 1. reproduced the issue in Words 11.2.0 or earlier and 2. That you have made some changes related to this in the latest version, then NO I am not going to download yet anther release and waste my time testing this.

By the way - did you test this using myEclipse? and using hot deploy? That is the scenario - development, not production.

Hi
Michael,


Thanks for the additional information.

We always encourage our customers to use the latest release versions of Aspose.Words as it contains newly introduced features, enhancements and fixes for issues reported earlier. Now concerning to the issue that you are facing, I used the same setup including MyEclipse, WebLogic and Windows 7 on my side. Could you please create and attach here a simple WebApplication. I will host this web app on my side and let you know my findings then. We’re sorry for the inconvenience.

Best Regards,