Erik Pragt | 1 Dec 2011 15:05
Picon
Favicon
Gravatar

[groovy-dev] null vs [] question concerning spread operator

Dear all,

We were expecting this to pass:
assert []*.foo == []
assert null*.foo == []

Assertion failed:

assert null*.foo == []
             |   |
             |   false
             null

	at Script1.run(Script1.groovy:2)

Apparently spread on null doesn't return an empty list but null. From
here: http://groovy.codehaus.org/Operators#Operators-SpreadOperator%28.%29
I understand that spread operator uses iterator() method and for
NullObject it returns an iterator over an empty list. So why am I
getting null instead of an empty list? Also could anybody tell me
where to look in the code to see how spread-dot operator is
implemented?

Kind regards,

Marcin Erdmann & Erik Pragt

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

(Continue reading)

Jeff Brown | 1 Dec 2011 19:09
Gravatar

[groovy-dev] anonymous codehaus git url for the groovy repo

What URL is supposed to work for anonymous (not committer) access?
git://git.codehaus.org/groovy-git.git doesn't seem to work right now.

Thanks.

jb

--

-- 
Jeff Brown
SpringSource
http://www.springsource.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Jeff Brown | 1 Dec 2011 22:35
Gravatar

[groovy-dev] Re: anonymous codehaus git url for the groovy repo

On Thu, Dec 1, 2011 at 12:09 PM, Jeff Brown <jeff@...> wrote:
> What URL is supposed to work for anonymous (not committer) access?
> git://git.codehaus.org/groovy-git.git doesn't seem to work right now.
>
> Thanks.
>
>

FYI…

I just had a chat with Ben Walding.  He tells me that there is no
anonymous access right now but that he will set it up in a few hours.

jb
--

-- 
Jeff Brown
SpringSource
http://www.springsource.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Jochen Theodorou | 1 Dec 2011 22:52
Picon
Gravatar

Re: [groovy-dev] Re: anonymous codehaus git url for the groovy repo

Am 01.12.2011 22:35, schrieb Jeff Brown:
> On Thu, Dec 1, 2011 at 12:09 PM, Jeff Brown<jeff@...>  wrote:
>> What URL is supposed to work for anonymous (not committer) access?
>> git://git.codehaus.org/groovy-git.git doesn't seem to work right now.
>>
>> Thanks.
>>
>>
>
> FYI…
>
> I just had a chat with Ben Walding.  He tells me that there is no
> anonymous access right now but that he will set it up in a few hours.

strange... I am pretty sure it was working in the past. I actually 
thought I tried it myself even... and didn't the grails tests for groovy 
integration use anno access to get the repository?

bye blackdrag

--

-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
(Continue reading)

Jeff Brown | 1 Dec 2011 23:03
Gravatar

Re: [groovy-dev] Re: anonymous codehaus git url for the groovy repo

On Thu, Dec 1, 2011 at 3:52 PM, Jochen Theodorou <blackdrag@...> wrote:
> Am 01.12.2011 22:35, schrieb Jeff Brown:
>
>> On Thu, Dec 1, 2011 at 12:09 PM, Jeff Brown<jeff@...>  wrote:
>>>
>>> What URL is supposed to work for anonymous (not committer) access?
>>> git://git.codehaus.org/groovy-git.git doesn't seem to work right now.
>>>
>>> Thanks.
>>>
>>>
>>
>> FYI…
>>
>> I just had a chat with Ben Walding.  He tells me that there is no
>> anonymous access right now but that he will set it up in a few hours.
>
>
> strange... I am pretty sure it was working in the past. I actually thought I
> tried it myself even... and didn't the grails tests for groovy integration
> use anno access to get the repository?
>

Yes, it worked until the recent server migration.  The new anonymous
access has not been setup yet.

jb

--

-- 
Jeff Brown
(Continue reading)

Cédric Champeau | 2 Dec 2011 10:49
Picon
Gravatar

[groovy-dev] Closure shared variables and flow typing

Hi!

Yesterday, Guillaume & I had a face-to-face working session in Paris. One of our discussion subjects was centered on static type checking, and especially a corner case with closure shared variables. In this email, I will expose the problem and the solutions we had in mind. Let's start with a sample code:

def x = '123'
def cl = { x = new Date() }
x.toInteger()

The current implementation of the static type checked is totally wrong in that case (this is a bug I know about for long). Especially, it complains with the following error message:

Cannot find matching method java.util.Date#toInteger()

This is because the closure is visited before the call to x.toInteger() so the inferred type of x is changed although the closure is *not* called. This example illustrates the case of a closure shared variable, "x", and flow typing. In flow typing, we want this not to throw an error:

def x = new Date()
x = '123'
x.toInteger() // should work because the compiler can infer that x is of string type at this point

Now, when "x" is closure shared, we are facing a dangerous situation. Back to our first example:


def x = '123'
def cl = { x = new Date() }
x.toInteger()

The workaround seems to be easy: "hey, we don't call the closure, you must know that x is still a string at line 3!". If we do that, then we must also keep track of closure calls which may alter the shared variable:

def x = '123'
def cl = { x = new Date() }
cl()
x.toInteger() // now, this must throw an error because x has changed type !

In that case, this is a very problematic issue. Tracking shared variables is doable, but tracking closure calls depends on runtime execution and seems impossible. For example, we could have nastier code like this:

def x = '123'
def cl = { foo -> x = new Date() }
def cl2 = cl.curry('If you ever visit Nantes, we could have a talk')
cl2()
x.toInteger() // now, this must throw an error because x has changed type !

or even more problematic :

class A {
   Closure action
   def foo() { action() }
}

def x = '123'
def cl = { x = new Date() }
def a = new A(action:cl)
a.foo()
x.toInteger() // now, this must throw an error because x has changed type !

Basically, the latter example shows it is rather impossible to track closure calls implying shared variables at compile time. The first solution is to disable flow typing. We don't really like that idea, as it is definitely not in the "Groovy" spirit. Though flow typing may be seen as bad style, we still think things like this are groovier:

class A {}
class B extends A { void foo() {} }

A a = new B()
a.foo() // should be allowed in static mode

The first option, then, is not the one we want to promote. The second option is to go "Java style", and disallow closure shared variables, meaning each variable used in a closure should be final. The code you saw would therefore be invalid. But we don't like this idea because it would remove a large part of the interest of using "lightweight" closures.

The 3rd solution, first suggested by Guillaume, was to ignore tracking of closure execution, and let the program fail at runtime. For example, this would fail with a class cast exception:

def x = '123'
def cl = { x = new Date() }
cl()
x.toInteger()

But it would fail *at runtime*. Dynamic groovy would fail with a "No signature of method Date#toInteger". I don't really like this option for two reasons:
    1. it beats the concept of static type checking, which is IMHO interesting if errors are found at compile time rather than runtime
    2. it is conceptually wrong

After a short brainstorming session, where we discussed about possible warnings or disallowing assignments of shared variables in closures, I suggested an alternative option, which requires some trickery in the type checker, but seems conceptually correct: throwing an error on "x.toInteger()", knowing that if you assign a shared variable in a closure with an "incompatible" type, this is not bad style, but very bad style. The question is how can we throw an error here, without throwing an error when the variable is *not* closure shared (that is to say in the classical flow typing mode). My idea is to use the "lowest upper bound" algorithm to compute, for closure shared variables, the lowest common type of all assignments of a closure shared variables. Direct method calls (I mean, without explicit casts), in that case, should only be allowed on methods belonging to that common super type. This means that in that case:

def x = '123'
def cl = { x = new Date() }
cl()
x.toInteger()

We know that 'x' is assigned a string and a date. We compute the LUB of those types. Then method calls on 'x' would be checked against this type. Here, the LUB is an Object implementing Serializable. Serializable doesn't have a "toInteger" method, so "toInteger" would fail here. Guillaume, then, came with another example:

def x = '123'
def cl = { x = new Date() }
cl()
x = '456'
x.toInteger()

Using our algorithm, 'x.toInteger()' would throw a compilation error, so Guillaume said this would violate the principle of least surprise. At first, I thought we could be smarter, letting this pass if no method call was made between an assignment and the method call on the shared variable. For example, this would pass:

def x = '123'
def cl = { x = new Date() }
cl()
x = '456'
x.toInteger()

But this would not:

def x = '123'
def cl = { x = new Date() }
cl()
x = '456'
logger.debug('info')
x.toInteger() // would fail, because we don't know what logger.debug does. Potentially, it could lead to using the "cl" closure. If you as a human know that it would not, the compiler cannot know, so it must invalidate the call

However, Guillaume came with an excellent counter-example. What if "x" is used in another thread? For example :

def x = '123'
Thread.start { x = new Date() }
x = '456'
x.toInteger()

There is absolutely no guarantee that when "x.toInteger()" will be called, "x" will be of type 'String'. There are chances that it will be of type Date, depending on when the assignement is executed... We all agree that using a shared variable in this use case is a very, ugly, fool code style, but it demonstrates that at compile time, we cannot make any better hint that "x" would be of the LUB type.

This is why I think the solution of throwing an error systematically when such a method call is found is the right way to go. This would allow the classical "flow typing" to work. This would also encourage good style because using a shared variable to store whatever you want is not a good idea.

Eventually, we must think about this use case :

def x = 1
def cl = { x.toInteger() }
x = '123'
cl()

This is a similar problem. Here, to be able to statically check the closure, we must know the type of the shared variable. There is no assignment in the closure, but still, we can statically check it if we use the very same algorithm. A call to ".toInteger()" would only be allowed if we know that this method belongs to all types that have been assigned to x. This won't be fun to implement, but I still think this is the most promising way to do this.

Let us know what you think.
-- Cédric Champeau SpringSource - A Division Of VMware http://www.springsource.com/ http://twitter.com/CedricChampeau
Jochen Theodorou | 2 Dec 2011 12:36
Picon
Gravatar

Re: [groovy-dev] Closure shared variables and flow typing

Am 02.12.2011 10:49, schrieb Cédric Champeau:
[...]

hmm.... I want to suggest an alternative, which is not so easy, but well...

> |def x = '123'
> def cl = { x = new Date() }
> x.toInteger()|

my thinking would be to define a definite synchronous closure call (scc) 
and an possible async call (pac), as well as a quasi-final state for a 
local variable... a local variable involved in a pac, cannot reach the 
quasi-final state, since the time of execution is unknown. But for a scc 
it is possible. And deadcode elimination for blocks.

In that thinking the above program should fail, because cl is dead code. 
But even if we would not add that, then x.toInteger() should work, since 
cl is never called, thus there is no pac or scc, and the quasi final 
state of x is reached right after the declaration. Since this step kind 
of requires to recognize cl being dead code I am for it not to compile 
because of that... in the end, the program above looks like there should 
have been done something else, but was not, thus is most probably not 
correct in the user sense...

The slightly more complicated case would be:

 > def x = '123'
 > cl = { x = new Date() }
 > x.toInteger()

there is a pac on the assignment for cl, thus it should fail on 
x.toInteger()

We may want even go as far as encoding the information that the closure 
is called async or not in the type annotation... which is a big reason 
as for why I am for a String based solution.

[...]
> |The workaround seems to be easy: "hey, we don't call the closure, you
> must know that x is still a string at line 3!". If we do that, then we
> must also keep track of closure calls which may alter the shared variable:
>
> |def x = '123'
> def cl = { x = new Date() }
> cl()
> x.toInteger()| // now, this must throw an error because x has changed type !

In my thinking the quasi-final state is before x.toInteger is reached 
only after the scc cl(), thus the flow-type for x is Date and then 
x.toInteger will fail.

[...]
> |def x = '123'
> def cl = { foo -> x = new Date() }
> def cl2 = cl.curry('If you ever visit Nantes, we could have a talk')
> cl2()
> x.toInteger()| // now, this must throw an error because x has changed type !

we have a pac with the curry call, thus fail

> or even more problematic :
>
> |class A {
> Closure action
> def foo() { action() }
> }
>
> ||def x = '123'
> def cl = { x = new Date() }
> def a = new A(action:cl)
> a.foo()
> x.toInteger() // now, this must throw an error because x has changed type !|

pac in the constructor call -> fail

[...]
> After a short brainstorming session, where we discussed about possible
> warnings or disallowing assignments of shared variables in closures, I
> suggested an alternative option, which requires some trickery in the
> type checker, but seems conceptually correct: throwing an error on
> "x.toInteger()", knowing that if you assign a shared variable in a
> closure with an "incompatible" type, this is not bad style, but very bad
> style. The question is how can we throw an error here, without throwing
> an error when the variable is *not* closure shared (that is to say in
> the classical flow typing mode). My idea is to use the "lowest upper
> bound" algorithm to compute, for closure shared variables, the lowest
> common type of all assignments of a closure shared variables. Direct
> method calls (I mean, without explicit casts), in that case, should only
> be allowed on methods belonging to that common super type. This means
> that in that case:
>
> |def x = '123'
> def cl = { x = new Date() }
> cl()
> x.toInteger()|
>
> We know that 'x' is assigned a string and a date. We compute the LUB of
> those types. Then method calls on 'x' would be checked against this
> type. Here, the LUB is an Object implementing Serializable. Serializable
> doesn't have a "toInteger" method, so "toInteger" would fail here.
> Guillaume, then, came with another example:

you actually have a similar problem with if-else, or not? I see a scc, 
thus x type is Date and it fails. For me the blocks of an if-else, or 
with are scc as well.

> |def x = '123'
> def cl = { x = new Date() }
> cl()
> x = '456'
> x.toInteger()|

here we have a scc, thus the quasi-final state is reached after the last 
assignment, thus it should work.

> But this would not:
>
> |def x = '123'
> def cl = { x = new Date() }
> cl()
> x = '456'
> logger.debug('info')
> x.toInteger() // would fail, because we don't know what logger.debug
> does. Potentially, it could lead to using the "cl" closure. If you as a
> human know that it would not, the compiler cannot know, so it must
> invalidate the call|

no, I would let that pass as well. Why do you think logger can influence 
the time at which cl is executed?

> However, Guillaume came with an excellent counter-example. What if "x"
> is used in another thread? For example :
>
> |def x = '123'
> Thread.start { x = new Date() }
> x = '456'
> x.toInteger()|

there is a pac, thus error.

[...]
> This is why I think the solution of throwing an error systematically
> when such a method call is found is the right way to go. This would
> allow the classical "flow typing" to work. This would also encourage
> good style because using a shared variable to store whatever you want is
> not a good idea.

in my idea classic flow style should work as well.

> Eventually, we must think about this use case :
>
> |def x = 1
> def cl = { x.toInteger() }
> x = '123'
> cl()

that is a scc. The place at which we have to make the type checks for an 
scc case is after the call, thus this is to be seen as

 > |def x = 1
 > x = '123'
 > { x.toInteger() }()

and should work, but of course it means a bit trouble for the type 
checker logic, since it must kind of delay a type check.

> |
> This is a similar problem. Here, to be able to statically check the
> closure, we must know the type of the shared variable. There is no
> assignment in the closure, but still, we can statically check it if we
> use the very same algorithm. A call to ".toInteger()" would only be
> allowed if we know that this method belongs to all types that have been
> assigned to x. This won't be fun to implement, but I still think this is
> the most promising way to do this.

In my logic even this will pass

 > |def x = new Date()
 > def cl = { x.toInteger() }
 > x = '123'
 > cl()

Because if I understood you right, you don't want this case to pass. The 
LUB for this does not contain anything with a toInteger method.

bye blackdrag

--

-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Paul Hammant | 2 Dec 2011 18:13

Re: [groovy-dev] Grapes: needs better debuging capability.

See below.

On Tue, Nov 22, 2011 at 6:06 PM, Paul King <paulk-V+QuBFElvc30CCvOHzKKcA@public.gmane.org> wrote:

Does running this provide any more info:

grape install org.seleniumhq.selenium selenium-java 2.12.0



developer <at> coolio:~/work/regression-tests.github.com$ grape install org.seleniumhq.selenium:selenium-java 2.12.0
:: loading settings :: url = jar:file:/home/developer/work/regression-tests.github.com/groovy-1.8.4/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: caller#all-caller;working
    confs: [default]

:: problems summary ::
:::: WARNINGS
        module not found: org.seleniumhq.selenium:selenium-java#2.12.0;latest.default

    ==== localm2: tried

      file:/home/developer/.m2/repository/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom

      -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:

      file:/home/developer/.m2/repository/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar

    ==== codehaus: tried

      http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom

      -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:

      http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar

    ==== ibiblio: tried

      http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom

      -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:

      http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar

    ==== java.net2: tried

      http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom

      -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:

      http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar


:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
 
Paul Hammant | 2 Dec 2011 18:16

Re: [groovy-dev] Grapes: needs better debuging capability.

Once more with debug info :


developer <at> coolio:~/work/regression-tests.github.com$ grape -V install org.seleniumhq.selenium:selenium-java 2.12.0
:: loading settings :: url = jar:file:/home/developer/work/regression-tests.github.com/groovy-1.8.4/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
no default ivy user dir defined: set to /home/developer/.ivy2
including url: jar:file:/home/developer/work/regression-tests.github.com/groovy-1.8.4/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings-public.xml
no default cache defined: set to /home/developer/.ivy2/cache
including url: jar:file:/home/developer/work/regression-tests.github.com/groovy-1.8.4/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings-shared.xml
including url: jar:file:/home/developer/work/regression-tests.github.com/groovy-1.8.4/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings-local.xml
including url: jar:file:/home/developer/work/regression-tests.github.com/groovy-1.8.4/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings-main-chain.xml
including url: jar:file:/home/developer/work/regression-tests.github.com/groovy-1.8.4/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings-default-chain.xml
settings loaded (40ms)
    default cache: /home/developer/.ivy2/cache
    default resolver: default
    -- 5 resolvers:
    shared [file]
    default [chain] [local, main]
    local [file]
    public [ibiblio]
    main [chain] [shared, public]
:: resolving dependencies :: caller#all-caller;working
    confs: [default]
    validate = false
    refresh = false
resolving dependencies for configuration 'default'
== resolving dependencies for caller#all-caller;working [default]
== resolving dependencies caller#all-caller;working->org.seleniumhq.selenium:selenium-java#2.12.0;latest.default [default->default]
downloadGrapes: Checking cache for: dependency: org.seleniumhq.selenium:selenium-java#2.12.0;latest.default {default=[default]}
default-cache: no cached resolved revision for org.seleniumhq.selenium:selenium-java#2.12.0;latest.default
don't use cache for org.seleniumhq.selenium:selenium-java#2.12.0;latest.default: checkModified=true
        tried file:/home/developer/.m2/repository/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom
    maven-metadata not available: file:/home/developer/.m2/repository/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
        tried file:/home/developer/.m2/repository/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar
    maven-metadata not available: file:/home/developer/.m2/repository/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
    localm2: no ivy file nor artifact found for org.seleniumhq.selenium:selenium-java#2.12.0;latest.default
default-cache: no cached resolved revision for org.seleniumhq.selenium:selenium-java#2.12.0;latest.default
        tried http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom
CLIENT ERROR: Not Found url=http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
    maven-metadata not available: http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
CLIENT ERROR: Not Found url=http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/
problem while listing resources in http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/ with codehaus:
  java.io.IOException The HTTP response code for http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/ did not indicate a success. See log for more detail.
        tried http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar
    maven-metadata not available: http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
CLIENT ERROR: Not Found url=http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/
problem while listing resources in http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/ with codehaus:
  java.io.IOException The HTTP response code for http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/ did not indicate a success. See log for more detail.
    codehaus: no ivy file nor artifact found for org.seleniumhq.selenium:selenium-java#2.12.0;latest.default
default-cache: no cached resolved revision for org.seleniumhq.selenium:selenium-java#2.12.0;latest.default
        tried http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom
CLIENT ERROR: Not Found url=http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
    maven-metadata not available: http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
CLIENT ERROR: Not Found url=http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/
problem while listing resources in http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/ with ibiblio:
  java.io.IOException The HTTP response code for http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/ did not indicate a success. See log for more detail.
        tried http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar
    maven-metadata not available: http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
CLIENT ERROR: Not Found url=http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/
problem while listing resources in http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/ with ibiblio:
  java.io.IOException The HTTP response code for http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/ did not indicate a success. See log for more detail.
    ibiblio: no ivy file nor artifact found for org.seleniumhq.selenium:selenium-java#2.12.0;latest.default
default-cache: no cached resolved revision for org.seleniumhq.selenium:selenium-java#2.12.0;latest.default
        tried http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom
CLIENT ERROR: Not found url=http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
    maven-metadata not available: http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
CLIENT ERROR: Not found url=http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/
problem while listing resources in http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/ with java.net2:
  java.io.IOException The HTTP response code for http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/ did not indicate a success. See log for more detail.
        tried http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar
    maven-metadata not available: http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/maven-metadata.xml
CLIENT ERROR: Not found url=http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/
problem while listing resources in http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/ with java.net2:
  java.io.IOException The HTTP response code for http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/ did not indicate a success. See log for more detail.
    java.net2: no ivy file nor artifact found for org.seleniumhq.selenium:selenium-java#2.12.0;latest.default
WARN:     module not found: org.seleniumhq.selenium:selenium-java#2.12.0;latest.default
WARN: ==== localm2: tried
WARN:   file:/home/developer/.m2/repository/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom
WARN:   -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:
WARN:   file:/home/developer/.m2/repository/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar
WARN: ==== codehaus: tried
WARN:   http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom
WARN:   -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:
WARN:   http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar
WARN: ==== ibiblio: tried
WARN:   http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom
WARN:   -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:
WARN:   http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar
WARN: ==== java.net2: tried
WARN:   http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom
WARN:   -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:
WARN:   http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar
    resolved ivy file produced in /home/developer/.groovy/grapes/resolved-caller-all-caller-working.xml
:: downloading artifacts ::
    resolve done (1279ms resolve - 0ms download)

:: problems summary ::
:::: WARNINGS
        module not found: org.seleniumhq.selenium:selenium-java#2.12.0;latest.default

    ==== localm2: tried

      file:/home/developer/.m2/repository/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom

      -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:

      file:/home/developer/.m2/repository/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar

    ==== codehaus: tried

      http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom

      -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:

      http://repository.codehaus.org/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar

    ==== ibiblio: tried

      http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom

      -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:

      http://repo1.maven.org/maven2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar

    ==== java.net2: tried

      http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].pom

      -- artifact org.seleniumhq.selenium:selenium-java#2.12.0;latest.default!2.12.0.jar:

      http://download.java.net/maven/2/org/seleniumhq/selenium:selenium-java/2.12.0/[revision]/2.12.0-[revision].jar


:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
Paul Hammant | 2 Dec 2011 18:27

Re: [groovy-dev] Grapes: needs better debuging capability.

Incidentally, in case it wasn't clear from other replies just now, I'm still having problems with Groovy 1.8.4 on a Ubuntu 10 box that's otherwise good for Groovy work.


Specifically the suggested solution :

<at> Grab('org.seleniumhq.selenium:selenium-htmlunit-driver:2.8.0')
<at> Grab('org.seleniumhq.selenium:selenium-java:2.8.0')
<at> GrabExclude('xml-apis:xml-apis')

... Doesn't work for my scenario. 

Here's the build output.

developer <at> coolio:~/work/regression-tests.github.com$ groovy issues/2915.groovy
Caught: java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V
java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V
    at org.apache.xpath.jaxp.XPathExpressionImpl.eval(XPathExpressionImpl.java:115)
    at org.apache.xpath.jaxp.XPathExpressionImpl.eval(XPathExpressionImpl.java:99)
    at org.apache.xpath.jaxp.XPathExpressionImpl.evaluate(XPathExpressionImpl.java:184)
    at org.openqa.selenium.firefox.internal.FileExtension.readIdFromInstallRdf(FileExtension.java:121)
    at org.openqa.selenium.firefox.internal.FileExtension.writeTo(FileExtension.java:61)
    at org.openqa.selenium.firefox.internal.ClasspathExtension.writeTo(ClasspathExtension.java:64)
    at org.openqa.selenium.firefox.FirefoxProfile.installExtensions(FirefoxProfile.java:531)
    at org.openqa.selenium.firefox.FirefoxProfile.layoutOnDisk(FirefoxProfile.java:509)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:74)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:147)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:78)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:126)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:77)
    at 2915.run(2915.groovy:10)

I'm running groovy 1.8.4 (confirmed via 'which' and examination of PATH and GROOVY_HOME settings).  This is on Ubuntu 10, patched up to date.

You can try it yourself if you like :

  1. git clone https://github.com/SeleniumHQ/regression-tests.github.com.git
  2. cd regression-tests.github.com
  3. git checkout -b gh-pages origin/gh-pages
  4. groovy issues/2915.groovy

- Paul


On Wed, Nov 23, 2011 at 3:36 AM, Paul Hammant <paul-POq8DFUn+ZRAfugRpC6u6w@public.gmane.org> wrote:
Great stuff Paul.  I hadn't seen that gist before my posting, but I'll certainly cite it from the article and copy the GrabExclude way of overcoming the issue :)


On Tue, Nov 22, 2011 at 11:18 PM, Paul King <paulk-V+QuBFElvc30CCvOHzKKcA@public.gmane.org> wrote:

Just for your info, I found 'GrabExclude'ing the xml-apis artifacts helped also to get selenium/webdriver running across a range of different peoples machines and Java/Groovy versions when I was playing with this some months back:

https://github.com/paulk-asert/MakeTestingGroovy/blob/master/WebDriver/src/TestSimpBlogWebDriver.groovy


Cheers, Paul.


On 23/11/2011 10:06 AM, Paul King wrote:

Does running this provide any more info:

grape install org.seleniumhq.selenium selenium-java 2.12.0


On 23/11/2011 5:28 AM, Paul Hammant wrote:
Here's a stack trace that went through on a Ubuntu 10.04 box. Both with Groovy 1.7.4 and Groovy 1.8.4:

Caught: java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V
java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V
at org.apache.xpath.jaxp.XPathExpressionImpl.eval(XPathExpressionImpl.java:115)
at org.apache.xpath.jaxp.XPathExpressionImpl.eval(XPathExpressionImpl.java:99)
at org.apache.xpath.jaxp.XPathExpressionImpl.evaluate(XPathExpressionImpl.java:184)
at org.openqa.selenium.firefox.internal.FileExtension.readIdFromInstallRdf(FileExtension.java:121)
at org.openqa.selenium.firefox.internal.FileExtension.writeTo(FileExtension.java:61)
at org.openqa.selenium.firefox.internal.ClasspathExtension.writeTo(ClasspathExtension.java:64)
at org.openqa.selenium.firefox.FirefoxProfile.installExtensions(FirefoxProfile.java:531)
at org.openqa.selenium.firefox.FirefoxProfile.layoutOnDisk(FirefoxProfile.java:509)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:74)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:147)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:78)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:126)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:77)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:186)
at test.run(test.groovy:11)
at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:266)
at groovy.lang.GroovyShell.run(GroovyShell.java:229)
at groovy.lang.GroovyShell.run(GroovyShell.java:159)
at groovy.ui.GroovyMain.processOnce(GroovyMain.java:548)
at groovy.ui.GroovyMain.run(GroovyMain.java:335)
at groovy.ui.GroovyMain.process(GroovyMain.java:321)
at groovy.ui.GroovyMain.processArgs(GroovyMain.java:118)
at groovy.ui.GroovyMain.main(GroovyMain.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)

Groovy script is here - http://paulhammant.com/2011/11/14/reporting-selenium2-bugs/

The same dep on selenium-java <any version> works well in Maven-land on the same platform, but barfs with Groovy/Grapes. Xalan must be twice in the classpath, which I could probably work through if I had could see that that is explicitly true (and they are diff versions).

Groovy has a -d option for debug, but it all it shows is the expanded stack-trace above.

What would be great is a -showClassPath directive, or -showClassLoaderTree if that's more pertinent.

Regards,

- Paul





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email





Gmane