tasfe / crawler-commons

Automatically exported from code.google.com/p/crawler-commons
0 stars 1 forks source link

Older version of SLF4J being used. #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add slf4j v1.7.7 to pom.
2. Create this variable in the main method.
BaseHttpFetcher fetcher = RobotUtils.createFetcher(maxThreads: 4, userAgent: 
'Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0')
3. Run it.

What is the expected output? What do you see instead?
I wasn't expecting an exception.

What version of the product are you using? On what operating system?
I am using the latest v0.4 or crawler-commons and Groovy on Ubuntu

On http://www.slf4j.org/faq.html:
Here are the exception details.

Exception in thread "main" java.lang.IllegalAccessError: tried to access field
org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
   at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:60)

This error is caused by the static initializer of the LoggerFactory class 
attempting to directly access the SINGLETON field of 
org.slf4j.impl.StaticLoggerBinder. While this was allowed in SLF4J 1.5.5 and 
earlier, in 1.5.6 and later the SINGLETON field has been marked as private 
access. 

Original issue reported on code.google.com by rite2aa...@gmail.com on 7 Oct 2014 at 9:17

GoogleCodeExporter commented 9 years ago
Hi,

I am trying to replicate your scenario but the bug doesn't reproduce.

Here are my pom dependencies:
<dependencies>
        <dependency>
            <groupId>com.google.code.crawler-commons</groupId>
            <artifactId>crawler-commons</artifactId>
            <version>0.4</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.7</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.7</version>
        </dependency>
    </dependencies>

This is my code:
LOG.info("Hello World");

    BaseHttpFetcher fetcher = RobotUtils.createFetcher(new UserAgent("Mozilla/5.0 (Windows NT 5.1; rv:31.0)", "", "", "Gecko/20100101 Firefox/31.0"), 4);

    LOG.info("Hello World");

It runs ok - please check if my code differs than yours and I will check it out.

Original comment by avrah...@gmail.com on 23 Oct 2014 at 2:32

GoogleCodeExporter commented 9 years ago
Closed due to inactivity and no way to reproduce the bug

Original comment by avrah...@gmail.com on 21 Nov 2014 at 8:34