Inconsistent Java Exception

90 views
Skip to first unread message

Jakes

unread,
Oct 2, 2011, 11:37:27 AM10/2/11
to webdriver
Hello,

I am getting repeatedly inconsistent exception like below.. Can
someone please explain me the cause. This happens mostly when click is
trying to perform.
java.lang.ExceptionInInitializerError

at
org.openqa.selenium.WebDriverException.getBuildInformation(WebDriverException.java:
70)

at
org.openqa.selenium.WebDriverException.createMessage(WebDriverException.java:
52)

at
org.openqa.selenium.WebDriverException.getMessage(WebDriverException.java:
42)

at
com.automation.paf.commonutils.JavaScriptUtil.firJSClickEvent(JavaScriptUtil.java:
167)

at
com.automation.paf.actions.BrowserActionClick.TryClick(BrowserActionClick.java:
87)

at
com.automation.paf.actions.BrowserActionClick.Execute(BrowserActionClick.java:
51)

at com.automation.paf.TestRunner.run(TestRunner.java:61)

at
com.automation.paf.TestRunner.RunBrowserActions(TestRunner.java:121)

at com.automation.paf.PAFTest.run(PAFTest.java:151)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.IllegalArgumentException: URI is not hierarchical

at java.io.File.<init>(Unknown Source)

at
org.openqa.selenium.internal.BuildInfo.loadBuildProperties(BuildInfo.java:
45)

at
org.openqa.selenium.internal.BuildInfo.<clinit>(BuildInfo.java:37)

... 10 more

Krishnan Mahadevan

unread,
Oct 2, 2011, 10:24:21 PM10/2/11
to webd...@googlegroups.com
Is this with Selenium 2.7.0 ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"




--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.


Jayakumar Raghavan

unread,
Oct 2, 2011, 10:50:06 PM10/2/11
to webd...@googlegroups.com
Yes it 2.7 using IE browser 
Thanks

Sent from my iPhone

Daniel Wagner-Hall

unread,
Oct 5, 2011, 4:49:03 AM10/5/11
to webd...@googlegroups.com
That looks very odd indeed - can you supply us with the page you're
testing against (either the full HTML, Javascript and CSS, or a link
to it if it's public), and the Java test case you're executing? Even
if it only happens some of the time, having a chance at seeing the bug
will make it easier for us to find/fix than random guesswork

Daniel Wagner-Hall

unread,
Oct 5, 2011, 5:37:06 AM10/5/11
to webd...@googlegroups.com
That looks very odd indeed - can you supply us with the page you're
testing against (either the full HTML, Javascript and CSS, or a link
to it if it's public), and the Java test case you're executing? Even
if it only happens some of the time, having a chance at seeing the bug
will make it easier for us to find/fix than random guesswork

On 3 October 2011 03:50, Jayakumar Raghavan <jrag...@gmail.com> wrote:

xazn...@aol.com

unread,
Oct 6, 2011, 3:36:35 AM10/6/11
to webdriver
I currently also ran into this issue that Jakes stated above. I
believe Jakes left out some information, but here is my scenario,
which I believe applies to Jakes too...

I have created a driver jar file that includes selenium jar and lib
jar(s) it uses. Upon manipulating an WebElement (eg. click,
isDisplayed, etc) that is NOT present or calling
driver.findElement(...) the NoSuchElementException calls the BuildInfo
that is included in the selenium jar, but crashes on line 45(http://
groups.google.com/group/webdriver/browse_thread/thread/
2b1a7fcd7072dcf1/1bb4378908b1e35a?show_docid=1bb4378908b1e35a).

I am not sure what is causing this, but I think it is due to the fact
that the jars are within a jar? In the link above you can see that it
is bombing out on the code: File file = new File(url.toURI());
The BuildInfo is part of selenium jar and not our code, but is used to
obtain information about the os and browser for the
NoSuchElementException.

Running the simple google demo for selenium locally, but looking for
an element that is not there throws the NoSuchElementException as
expected. Doing the same within a jar doesn't works as expected... If
I have two catch blocks, first the NoSuchElementException and second
Exception, then the second one will catch it. Upon printing out the
stack trace it show the root cause has to do with:
--->at java.io.File.<init>(Unknown Source)
--->at
org.openqa.selenium.internal.BuildInfo.loadBuildProperties(BuildInfo.java:
45)
at
org.openqa.selenium.internal.BuildInfo.<clinit>(BuildInfo.java:37)
... 10 more

Please advise...

Also, I made a simple test




On Oct 5, 2:37 am, Daniel Wagner-Hall <dawag...@gmail.com> wrote:
> That looks very odd indeed - can you supply us with the page you're
> testing against (either the full HTML, Javascript and CSS, or a link
> to it if it's public), and the Java test case you're executing? Even
> if it only happens some of the time, having a chance at seeing the bug
> will make it easier for us to find/fix than random guesswork
>
> On 3 October 2011 03:50, Jayakumar Raghavan <jragha...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Yes it 2.7 using IE browser
> > Thanks
>
> > Sent from my iPhone
> > On Oct 2, 2011, at 7:24 PM, Krishnan Mahadevan
> > <krishnan.mahadevan1...@gmail.com> wrote:
>
> > Is this with Selenium 2.7.0 ?
> > Thanks & Regards
> > Krishnan Mahadevan
>
> > "All the desirable things in life are either illegal, expensive, fattening
> > or in love with someone else!"
>

Jayakumar Raghavan

unread,
Oct 6, 2011, 7:58:58 PM10/6/11
to webd...@googlegroups.com
Beauty.. Yes, I am was creating selenium jar and lib jar packaging to my custom package jar.  
I never thought that jar package is cause of this problem... 

Thanks

xazn...@aol.com

unread,
Oct 7, 2011, 12:25:45 AM10/7/11
to webdriver
So were you able to figure out the issue with the packaging? I am
still unable to locate the issue. I just know that Build Info is
trying to open a file that it can't find due to my packaging of the
jars. Please advise of how your manifest looks like if its working. It
may help me out. =P

On Oct 6, 4:58 pm, Jayakumar Raghavan <jragha...@gmail.com> wrote:
> Beauty.. Yes, I am was creating selenium jar and lib jar packaging to my
> custom package jar.
> I never thought that jar package is cause of this problem...
>
> Thanks
>

Daniel Wagner-Hall

unread,
Oct 7, 2011, 12:01:33 PM10/7/11
to webd...@googlegroups.com
https://code.google.com/p/selenium/source/browse/trunk/java/client/src/org/openqa/selenium/internal/BuildInfo.java
contains the code which does the looking for this information. You
should be able to work out the manifest format from that.

I've filed https://code.google.com/p/selenium/issues/detail?id=2632 so
that we get around to fixing this at some point. Patches are, as
ever, very welcome!

Jayakumar Raghavan

unread,
Oct 7, 2011, 9:35:04 PM10/7/11
to webd...@googlegroups.com
Hi Dan,

catch (NullPointerException ignored) {
    } catch (URISyntaxException ignored) {
    } catch (IOException ignored) {
    }catch(IllegalArgumentException ignored){ }

Catch the exception IllegalArgumentException and ignore it? I don't have the source base set for it.  Can you patch fix this issue?
Reply all
Reply to author
Forward
0 new messages