Skip Menu |

This queue is for tickets about the WWW-HtmlUnit CPAN distribution.

Report information
The Basics
Id: 81176
Status: resolved
Priority: 0/
Queue: WWW-HtmlUnit

People
Owner: Nobody in particular
Requestors: Alain.Desilets [...] nrc-cnrc.gc.ca
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: "Stojanovic, Marta" <Marta.Stojanovic [...] nrc-cnrc.gc.ca>
Subject: Bug on Windows
Date: Wed, 14 Nov 2012 13:05:34 -0800
To: "bug-WWW-HtmlUnit [...] rt.cpan.org" <bug-WWW-HtmlUnit [...] rt.cpan.org>
From: "Desilets, Alain" <Alain.Desilets [...] nrc-cnrc.gc.ca>
I would like to report a bug in WWW/HtmlUnit.pm, which causes it to fail on Windows. Essentially, HtmlUnit.pm assumes that the classpath separator is ':'. But on Windows, it's ';', because ':' conflicts with the names of disks like C:/windows. The fix is to add this at the beginning of HtmlUnit.pm our $classpath_separator = $^O =~ /win/i ? ";" : ":"; and then use $classpath_separator instead of ':' everywhere where ':' is used to concatenate jar pathes together. Best regards, Alain Désilets Agent de recherche Technologies de l'information et des communications Conseil national de recherches Canada Tél. : 613-993-0610 | Téléc. : 613-952-0215 alain.desilets@nrc-cnrc.gc.ca Research Officer Information and Communication Technology National Research Council Canada Telephone: 613-993-0610 | Fax: 613-952-0215 alain.desilets@nrc-cnrc.gc.ca
I've applied your suggested fix and uploaded version 0.18 to CPAN just now. Once it gets processed up there, please give it a try and let me know if it works. Thanks! --Brock On Wed Nov 14 16:05:47 2012, Alain.Desilets@nrc-cnrc.gc.ca wrote: Show quoted text
> I would like to report a bug in WWW/HtmlUnit.pm, which causes it to > fail on Windows. > > Essentially, HtmlUnit.pm assumes that the classpath separator is ':'. > But on Windows, it's ';', because ':' conflicts with the names of > disks like C:/windows. > > The fix is to add this at the beginning of HtmlUnit.pm > > our $classpath_separator = $^O =~ /win/i ? ";" : ":"; > > and then use $classpath_separator instead of ':' everywhere where ':' > is used to concatenate jar pathes together. > > Best regards, > > Alain Désilets > > Agent de recherche > Technologies de l'information et des communications > Conseil national de recherches Canada > Tél. : 613-993-0610 | Téléc. : 613-952-0215 > alain.desilets@nrc-cnrc.gc.ca > > Research Officer > Information and Communication Technology > National Research Council Canada > Telephone: 613-993-0610 | Fax: 613-952-0215 > alain.desilets@nrc-cnrc.gc.ca
CC: "Stojanovic, Marta" <Marta.Stojanovic [...] nrc-cnrc.gc.ca>
Subject: RE: [rt.cpan.org #81176] Bug on Windows
Date: Thu, 15 Nov 2012 05:19:53 -0800
To: "bug-WWW-HtmlUnit [...] rt.cpan.org" <bug-WWW-HtmlUnit [...] rt.cpan.org>
From: "Desilets, Alain" <Alain.Desilets [...] nrc-cnrc.gc.ca>
Wow! Thank you very much for a speedy fix! We will try it for sure and let you know. Best regards, Alain Désilets Show quoted text
-----Original Message----- From: Brock Wilcox via RT [mailto:bug-WWW-HtmlUnit@rt.cpan.org] Sent: Wednesday, November 14, 2012 10:46 PM To: Desilets, Alain Subject: [rt.cpan.org #81176] Bug on Windows <URL: https://rt.cpan.org/Ticket/Display.html?id=81176 > I've applied your suggested fix and uploaded version 0.18 to CPAN just now. Once it gets processed up there, please give it a try and let me know if it works. Thanks! --Brock On Wed Nov 14 16:05:47 2012, Alain.Desilets@nrc-cnrc.gc.ca wrote:
> I would like to report a bug in WWW/HtmlUnit.pm, which causes it to > fail on Windows. > > Essentially, HtmlUnit.pm assumes that the classpath separator is ':'. > But on Windows, it's ';', because ':' conflicts with the names of > disks like C:/windows. > > The fix is to add this at the beginning of HtmlUnit.pm > > our $classpath_separator = $^O =~ /win/i ? ";" : ":"; > > and then use $classpath_separator instead of ':' everywhere where ':' > is used to concatenate jar pathes together. > > Best regards, > > Alain Désilets > > Agent de recherche > Technologies de l'information et des communications Conseil national > de recherches Canada Tél. : 613-993-0610 | Téléc. : 613-952-0215 > alain.desilets@nrc-cnrc.gc.ca > > Research Officer > Information and Communication Technology National Research Council > Canada > Telephone: 613-993-0610 | Fax: 613-952-0215 > alain.desilets@nrc-cnrc.gc.ca
CC: "Stojanovic, Marta" <Marta.Stojanovic [...] nrc-cnrc.gc.ca>
Subject: RE: [rt.cpan.org #81176] Bug on Windows
Date: Thu, 15 Nov 2012 10:28:17 -0500
To: "bug-WWW-HtmlUnit [...] rt.cpan.org" <bug-WWW-HtmlUnit [...] rt.cpan.org>
From: "Desilets, Alain" <Alain.Desilets [...] nrc-cnrc.gc.ca>
I tried installing WWW::HtmlUnit-0.18 and it's not working. But I think it's because the installation didn't install all the necessary jars. Here's what I did exactly. - Killed the JVM, and erased all the _Inline directories on my C: drive. cpanp uninstall WWW::HtmlUnit - Then went to perl/site/lib/WWW/HtmlUnit and made sure to delete the jar directory there cpanp f WWW::HtmlUnit I 15 # Note: item 15 corresponds to v0.18 - At some point, it told me that a test had failed and asked me if I wanted to proceed anyway. I said yes. - After that, I went to perl/site/lib/WWW/ and saw that HtmlUnit.pm was indeed the version with the new fix. I then executed this script: --- use strict; use warnings; no warnings 'redefine'; no warnings 'uninitialized'; print "before use WWW::HtmlUnit\n"; use WWW::HtmlUnit; print "after use WWW::HtmlUnit\n"; --- And got: --- Set up gcc environment - 3.4.5 (mingw-vista special r3) Class com.gargoylesoftware.htmlunit.WebClient not found at C:/Perl/site/lib/Inline/Java.pm line 619. BEGIN failed--compilation aborted at C:/Users/desiletsa/Documents/eclipse_workspace/WeBiText/Spikes/HtmlUnit/try_HtmlUnit.pl line 7, <GEN0> line 4. --- I don't know in which jar the WebClient class is supposed to be, but here is the content of perl/site/lib/WWW/HtmlUnit/jar: --- commons-collections-3.2.1.jar sac-1.3.jar xercesImpl-2.9.1.jar commons-logging-1.1.1.jar serializer-2.7.1.jar xml-apis-1.3.04.jar htmlunit-confirmhandler-2.8.jar xalan-2.7.1.jar --- This seems quite different from what HtmlUnit::collect_default_jars() expects: --- sub collect_default_jars { my $jar_path = find_jar_path(); return join $classpath_separator, map { "$jar_path/$_" } qw( commons-codec-1.6.jar commons-collections-3.2.1.jar commons-io-2.2.jar commons-lang3-3.1.jar commons-logging-1.1.1.jar cssparser-0.9.7.jar htmlunit-2.10.jar htmlunit-confirmhandler-2.8.jar htmlunit-core-js-2.10.jar httpclient-4.2.1.jar httpcore-4.2.1.jar httpmime-4.2.1.jar nekohtml-1.9.16.jar sac-1.3.jar serializer-2.7.1.jar xalan-2.7.1.jar xercesImpl-2.9.1.jar xml-apis-1.3.04.jar ); } --- Several of the jars that collect_default_jars() expects to find seem to be missing from my HtmlUnit/jar directory. In particular, htmlunit-2.10.jar, which is probably where the com.gargoylesoftware.htmlunit.WebClient class is? Is this normal? And if not, why do you think the installer fails to install those jars? Note that I tried installing 0.18 on a Linux box, and it's not working there either. I get the same " Class com.gargoylesoftware.htmlunit.WebClient not found" error there too. Here is the content of my WWW/HtmlUnit/jar directory on the linux box: --- commons-collections-3.2.1.jar htmlunit-core-js-2.9.jar serializer-2.7.1.jar commons-io-2.0.1.jar httpclient-4.1.2.jar xalan-2.7.1.jar commons-lang-2.6.jar httpcore-4.1.2.jar xercesImpl-2.9.1.jar commons-logging-1.1.1.jar httpmime-4.1.2.jar xml-apis-1.3.04.jar htmlunit-2.9.jar nekohtml-1.9.15.jar htmlunit-confirmhandler-2.8.jar sac-1.3.jar --- It seems to contain more jars than on my Windows installation, but it's still missing 2 of them, and for more than half of the other jars, the version numbers don't correspond: - commons-codec-1.6.jar (missing completely) - commons-io-2.2.jar (it has v2.0.1) - commons-lang3-3.1.jar (it has v2.6) - cssparser-0.9.7.jar (missing altogether) - htmlunit-2.10.jar (it has v2.9) -- THIS ONE IS PROABLY THE CAUSE OF THE ERROR MESSAGE - htmlunit-core-js-2.10.jar (it has v2.9) - httpclient-4.2.1.jar (it has v4.1.2) - httpcore-4.2.1.jar (it has v4.1.2) - httpmime-4.2.1.jar (it has v4.1.2) - nekohtml-1.9.16.jar (it has v1.9.15) If I change the version numbers in collect_default_jars(), so that they reflect the version numbers of what's in my jar directory, then when I run the script, I get a different error: --- Exception in thread "IJST-#0" java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at org.perl.inline.java.InlineJavaClass.ValidateClass(InlineJavaClass.java:76) at org.perl.inline.java.InlineJavaProtocol.Report(InlineJavaProtocol.java:117) at org.perl.inline.java.InlineJavaProtocol.Do(InlineJavaProtocol.java:56) at org.perl.inline.java.InlineJavaServer.ProcessCommand(InlineJavaServer.java:153) at org.perl.inline.java.InlineJavaServer.ProcessCommand(InlineJavaServer.java:142) at org.perl.inline.java.InlineJavaServerThread.run(InlineJavaServerThread.java:51) Caused by: java.lang.ClassNotFoundException: org.apache.commons.codec.DecoderException at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) ... 8 more Can't receive packet from JVM: at /usr/lib/perl5/site_perl/5.8.8/Inline/Java/Protocol.pm line 431 BEGIN failed--compilation aborted at try_HtmlUnit.pl line 5, <GEN6> line 3. [webitext@iitm50ws1397 HtmlUnit]$ --- So it looks like this was able to get passed the initial error. So it does seem like there is a problem with the WWW::HtmlUnit installer for v0.18. Is this something that can be fixed? Again, thank you for your help in resolving this issue. Best regards, Alain Désilets
I see it too, the problem is that many of the jars were not included in the 0.18 release. On Thu Nov 15 10:28:32 2012, Alain.Desilets@nrc-cnrc.gc.ca wrote: Show quoted text
> I tried installing WWW::HtmlUnit-0.18 and it's not working. But I > think it's because the installation didn't install all the > necessary jars. > > Here's what I did exactly. > > - Killed the JVM, > and erased all the _Inline directories on my C: drive. > > cpanp > uninstall WWW::HtmlUnit > > - Then went to > perl/site/lib/WWW/HtmlUnit and made sure to delete the jar > directory there > > cpanp > f WWW::HtmlUnit > I 15 # Note: item 15 > corresponds to v0.18 > > - At some point, it told me that a test had > failed and asked me if I wanted to proceed anyway. I said yes. > - > After that, I went to perl/site/lib/WWW/ and saw that HtmlUnit.pm > was indeed the version with the new fix. > > I then executed this > script: > > --- > use strict; > use warnings; > no warnings 'redefine'; > no warnings 'uninitialized'; > > print "before use WWW::HtmlUnit\n"; > use WWW::HtmlUnit; > print "after use WWW::HtmlUnit\n"; > --- > > And > got: > > --- > Set up gcc environment - 3.4.5 (mingw-vista special > r3) > Class com.gargoylesoftware.htmlunit.WebClient not found at > C:/Perl/site/lib/Inline/Java.pm line 619. > BEGIN failed-- > compilation aborted at >
C:/Users/desiletsa/Documents/eclipse_workspace/WeBiText/Spikes/HtmlUnit/ try_HtmlUnit.pl Show quoted text
> line 7, <GEN0> line 4. > --- > > I don't know in which jar the > WebClient class is supposed to be, but here is the content of > perl/site/lib/WWW/HtmlUnit/jar: > > --- > commons-collections- > 3.2.1.jar sac-1.3.jar xercesImpl-2.9.1.jar > commons- > logging-1.1.1.jar serializer-2.7.1.jar xml-apis-1.3.04.jar > htmlunit-confirmhandler-2.8.jar xalan-2.7.1.jar > --- > > This seems > quite different from what HtmlUnit::collect_default_jars() expects: > --- > sub collect_default_jars { > my $jar_path = find_jar_path(); > return join $classpath_separator, map { "$jar_path/$_" } qw( > commons-codec-1.6.jar > commons-collections-3.2.1.jar > commons-io-2.2.jar > commons-lang3-3.1.jar > commons-logging- > 1.1.1.jar > cssparser-0.9.7.jar > htmlunit-2.10.jar > htmlunit-confirmhandler-2.8.jar > htmlunit-core-js-2.10.jar > httpclient-4.2.1.jar > httpcore-4.2.1.jar > httpmime- > 4.2.1.jar > nekohtml-1.9.16.jar > sac-1.3.jar > serializer-2.7.1.jar > xalan-2.7.1.jar > xercesImpl-2.9.1.jar > xml-apis-1.3.04.jar > ); > } > --- > > Several of the jars that > collect_default_jars() expects to find seem to be missing from my > HtmlUnit/jar directory. In particular, htmlunit-2.10.jar, which > is probably where the com.gargoylesoftware.htmlunit.WebClient class > is? > > Is this normal? And if not, why do you think the installer > fails to install those jars? > > Note that I tried installing 0.18 > on a Linux box, and it's not working there either. I get the same " > Class com.gargoylesoftware.htmlunit.WebClient not found" error > there too. > > Here is the content of my WWW/HtmlUnit/jar directory > on the linux box: > > --- > commons-collections-3.2.1.jar > htmlunit-core-js-2.9.jar serializer-2.7.1.jar > commons-io- > 2.0.1.jar httpclient-4.1.2.jar xalan-2.7.1.jar > commons-lang-2.6.jar httpcore-4.1.2.jar > xercesImpl-2.9.1.jar > commons-logging-1.1.1.jar httpmime- > 4.1.2.jar xml-apis-1.3.04.jar > htmlunit-2.9.jar > nekohtml-1.9.15.jar > htmlunit-confirmhandler-2.8.jar sac-1.3.jar > --- > > It seems to contain more jars than on my Windows > installation, but it's still missing 2 of them, and for more than > half of the other jars, the version numbers don't correspond: > > - > commons-codec-1.6.jar (missing completely) > - commons-io-2.2.jar > (it has v2.0.1) > - commons-lang3-3.1.jar (it has v2.6) > - > cssparser-0.9.7.jar (missing altogether) > - htmlunit-2.10.jar (it > has v2.9) -- THIS ONE IS PROABLY THE CAUSE OF THE ERROR MESSAGE > - > htmlunit-core-js-2.10.jar (it has v2.9) > - httpclient-4.2.1.jar (it > has v4.1.2) > - httpcore-4.2.1.jar (it has v4.1.2) > - httpmime- > 4.2.1.jar (it has v4.1.2) > - nekohtml-1.9.16.jar (it has v1.9.15) > If I change the version numbers in collect_default_jars(), so that > they reflect the version numbers of what's in my jar directory, > then when I run the script, I get a different error: > > --- > Exception in thread "IJST-#0" java.lang.NoClassDefFoundError: > org/apache/commons/codec/DecoderException > at > java.lang.Class.forName0(Native Method) > at > java.lang.Class.forName(Class.java:264) > at >
org.perl.inline.java.InlineJavaClass.ValidateClass(InlineJavaClass.java: 76) Show quoted text
> at >
org.perl.inline.java.InlineJavaProtocol.Report(InlineJavaProtocol.java:1 17) Show quoted text
> at >
org.perl.inline.java.InlineJavaProtocol.Do(InlineJavaProtocol.java:56) Show quoted text
> at >
org.perl.inline.java.InlineJavaServer.ProcessCommand(InlineJavaServer.ja va:153) Show quoted text
> at >
org.perl.inline.java.InlineJavaServer.ProcessCommand(InlineJavaServer.ja va:142) Show quoted text
> at >
org.perl.inline.java.InlineJavaServerThread.run(InlineJavaServerThread.j ava:51) Show quoted text
> Caused by: java.lang.ClassNotFoundException: > org.apache.commons.codec.DecoderException > at > java.net.URLClassLoader$1.run(URLClassLoader.java:217) > at > java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > ... 8 more > Can't receive packet from JVM: at > /usr/lib/perl5/site_perl/5.8.8/Inline/Java/Protocol.pm line 431 > BEGIN failed--compilation aborted at try_HtmlUnit.pl line 5, <GEN6> > line 3. > [webitext@iitm50ws1397 HtmlUnit]$ > --- > > So it looks like > this was able to get passed the initial error. So it does seem like > there is a problem with the WWW::HtmlUnit installer for v0.18. > Is this something that can be fixed? Again, thank you for your help > in resolving this issue. > > Best regards, > > Alain Désilets
There were two problems - one was that I missed a spot to use the windows separator, and second that I didn't update MANIFEST. I've fixed them both in v0.19 which I just uploaded. Thanks for the report! --Brock