Solved

Eclipse Browser

Posted on 2006-11-07
9
595 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
9 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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 “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now