Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Eclipse Browser

Posted on 2006-11-07
9
599 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 213
tomcat startup error 5 104
Tomcat: Unable to run tomcat service. 2 23
How to convert from xls to xlsx using java 7 55
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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

828 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