?
Solved

Eclipse Browser

Posted on 2006-11-07
9
Medium Priority
?
611 Views
Last Modified: 2012-06-27
I am using Eclipse browser in my application, it works fine with non java script page(URL), but amy application hangs when I try to load java script page.
Here is the code

Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FillLayout());

browser = new Browser(container, SWT.NONE);
browser.setUrl("http://192.168.1.41");

I also tried OLE objects instead of browser, but the result is same.
Here is the code

OleFrame frame = new OleFrame(container, SWT.NONE);
OleControlSite controlSite = new OleControlSite(frame, SWT.NONE, "Shell.Explorer");
OleAutomation automation = new OleAutomation(controlSite);
controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
int[] rgdispid = automation.getIDsOfNames(new String[]{"Navigate", "URL"});
int dispIdMember = rgdispid[0];

Variant[] rgvarg = new Variant[1];//this is the URL parameter
rgvarg[0] = new Variant("http://192.168.1.41/");
Variant pVarResult = automation.invoke(dispIdMember, rgvarg);
rgvarg[0].dispose();


Kindly let me know where I am wrong...I am using Eclipse 3.2

Thanks
0
Comment
Question by:Shabzt
  • 4
  • 3
7 Comments
 
LVL 7

Expert Comment

by:tomboshell
ID: 17888703
I would check to see if the Javascript is in error.  You should be able to call the same site in a normal web browser, if it runs there then there may be a problem with the Eclipse version and then you should enter a bug at Eclipse and include the relevant code and errors/traces.  If it does not run there then recheck the URL and such, you set the host but is there a particular page you are trying to visit?  like: http://192.168.1.41/myProject/index.html or such?  Is the server running?  

Or you could try out the ATF project which includes a Javascript debugger and a Mozilla Gecko integrations. http://www.eclipse.org/atf/  It is aimed at the Ajax crowd but does have some nice tools with the debugger, just watch out on the build types (incremental build may make it slower due to more parsing)
0
 

Author Comment

by:Shabzt
ID: 17888860
Page loads normally, if I try to use normal browser. If I try to catch exceptions from my code even then it does not throw any exception. It means everything from application point of view seems to be normal, but application hangs, that why even I tried to use OLE classes but without luck :(
0
 
LVL 7

Expert Comment

by:tomboshell
ID: 17889265
If you are using applets it is a known error:  https://bugs.eclipse.org/bugs/show_bug.cgi?id=59506

There have been many other bugs reported to Eclipse along similar themes that have been linked to this error.  I would suggest following the status of this bug.  May be of interest.  

Other ideas is to try out the ATF project and see about the debugging aspects
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Shabzt
ID: 17890016
Thanks for your reply,

Can I have some way to even catch this exception so that I can prevent my application to be in the hanging condition, which is very bad
0
 
LVL 7

Expert Comment

by:tomboshell
ID: 17892306
If it just hangs then it would be hard to say.  I would look into profilers, and/or debug (java debug) your application...or mix up both.  You will need to find in what method it is hanging.  I will be hitting the road again tomorrow and then wont be able to check the messages further (sorry).  
0
 

Author Comment

by:Shabzt
ID: 17895632
Thanks for your reply,

I tried debugging it, but from my application's end it is running smoothly. The method is executing properly and there is no exception. but it hangs in browser.setUrl("192.168.1.41");
0
 
LVL 7

Accepted Solution

by:
tomboshell earned 2000 total points
ID: 17913144
step into the setUrl method, you should have the sources for eclipse in the install, so you can debug the Eclipse specific items too.  If you can find out where it is broken in Eclipse you would have a better chance of getting it fixed.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month16 days, 15 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question