Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded storm-core to 0.10.0 version #220

Closed
wants to merge 1 commit into from

Conversation

goldenlink
Copy link

To make it work on 0.10.0, I had to migrate guava dependencies to com.google.guava instead of org.apache.storm.guava. This library has been removed from Storm in 0.10.0 version.

To make it work, I migrated guava dependencies to com.google.common instead of org.apache.storm.guava.
@jnioche
Copy link
Contributor

jnioche commented Nov 25, 2015

Hi, this should already be covered in branch [https://github.com/DigitalPebble/storm-crawler/tree/storm-0.10]. Can you please test it?

@goldenlink
Copy link
Author

Sorry, I did not notice this branch, I'll test with it and let you know about it.

@goldenlink
Copy link
Author

I don't really understand while trying to use the 0.10.0 option, I get an error while deploying :
on import org.apache.storm.shade.com.google.common.collect.Iterables;

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The import org.apache.storm.shade cannot be resolved
Iterables cannot be resolved
Iterables cannot be resolved

at com.digitalpebble.storm.crawler.bolt.FetcherBolt.<init>(FetcherBolt.java:40)

Is this normal ? an issue in my pom.xml maybe ?

@jnioche
Copy link
Contributor

jnioche commented Nov 25, 2015

do you get this when running in local mode or only when deploying to a Storm cluster?
Definitely not normal. How does your pom differ from the example one in the 0.10 branch?

@goldenlink
Copy link
Author

Well, I'm running in distributed mode. I took storm-0.10 branch HEAD. This happens while integrating the storm-crawler in my own application as a maven dependency :

 <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>1.4</version>
        <configuration>
          <createDependencyReducedPom>true</createDependencyReducedPom>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"
                >
                  <resource>core-site.xml</resource>
                  <file>src/main/resources/core-site.xml</file>
                </transformer>
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"
                >
                  <resource>hdfs-site.xml</resource>
                  <file>src/main/resources/hdfs-site.xml</file>
                </transformer>
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"
                >
                  <resource>my-parsefilters.json</resource>
                  <file>src/main/resources/my-parsefilters.json</file>
                </transformer>
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"
                >
                  <resource>my-urlfilters.json</resource>
                  <file>src/main/resources/my-urlfilters.json</file>
                </transformer>
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                <transformer
                  implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"
                >
                  <mainClass>com....</mainClass>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>

And here the dependency :

<!-- Storm -->
    <dependency>
      <groupId>org.apache.storm</groupId>
      <artifactId>storm-core</artifactId>
      <version>${storm.version}</version>
      <scope>provided</scope>
    </dependency>
<dependency>
      <groupId>org.apache.storm</groupId>
      <artifactId>storm-kafka</artifactId>
      <version>${storm.version}</version>
    </dependency>
<dependency>
      <artifactId>guava</artifactId>
      <groupId>com.google.guava</groupId>
      <version>16.0.1</version>
    </dependency>
<dependency>
      <groupId>com.digitalpebble</groupId>
      <artifactId>storm-crawler-core</artifactId>
      <version>${storm-crawler.version}</version>
      <exclusions>
        <exclusion>
          <artifactId>guava</artifactId>
          <groupId>com.google.guava</groupId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.storm</groupId>
          <artifactId>storm-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.digitalpebble</groupId>
      <artifactId>storm-crawler-elasticsearch</artifactId>
      <version>${storm-crawler.version}</version>
    </dependency>
...

It used to work perfectly with 0.9.5 altogether.

@goldenlink
Copy link
Author

Ok, I simply changed the dependency to com.google.common directly to make it deploy.

@jnioche
Copy link
Contributor

jnioche commented Nov 25, 2015

great, let's leave this issue open - I'll investigate it later. Thanks @goldenlink

@jnioche
Copy link
Contributor

jnioche commented Jan 15, 2016

For some reason we get the shaded dependency when compiling but not at runtime. Will merge your PR, thanks @goldenlink

jnioche added a commit that referenced this pull request Jan 15, 2016
@jnioche jnioche closed this Jan 15, 2016
@jnioche jnioche mentioned this pull request Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants