Hari,

Thanks!

You are right, I put one private MyApp.java into flume-ng-sdk test directory 
(so that Eclipse will build pass along with those test code). After remove that 
file to other place, issue goes away.

I am following http://flume.apache.org/FlumeDeveloperGuide.html to build one 
client application. But I don’t know how to build it or properly set the 
pom.xml. what development environment and setting should I set?

I try to build it with javac -cp ‘path for flume-mg-sdk.jar’ MyApp.java, but 
failed.


import org.apache.flume.Event;
import org.apache.flume.EventDeliveryException;
import org.apache.flume.api.RpcClient;
import org.apache.flume.api.RpcClientFactory;
import org.apache.flume.event.EventBuilder;
import java.nio.charset.Charset;

public class MyApp {
  public static void main(String[] args) {
    MyRpcClientFacade client = new MyRpcClientFacade();
    // Initialize client with the remote Flume agent's host and port
    client.init("host.example.org", 41414);

    // Send 10 events to the remote Flume agent. That agent should be
    // configured to listen with an AvroSource.
    String sampleData = "Hello Flume!";
    for (int i = 0; i < 10; i++) {
      client.sendDataToFlume(sampleData);
    }

    client.cleanUp();
  }
}

class MyRpcClientFacade {
  private RpcClient client;
  private String hostname;
  private int port;

  public void init(String hostname, int port) {
    // Setup the RPC connection
    this.hostname = hostname;
    this.port = port;
    this.client = RpcClientFactory.getDefaultInstance(hostname, port);
    // Use the following method to create a thrift client (instead of the above 
line):
    // this.client = RpcClientFactory.getThriftInstance(hostname, port);
  }

  public void sendDataToFlume(String data) {
    // Create a Flume Event object that encapsulates the sample data
    Event event = EventBuilder.withBody(data, Charset.forName("UTF-8"));

    // Send the event
    try {
      client.append(event);
    } catch (EventDeliveryException e) {
      // clean up and recreate the client
      client.close();
      client = null;
      client = RpcClientFactory.getDefaultInstance(hostname, port);
      // Use the following method to create a thrift client (instead of the 
above line):
      // this.client = RpcClientFactory.getThriftInstance(hostname, port);
    }
  }

  public void cleanUp() {
    // Close the RPC connection
    client.close();
  }

}
On Feb 7, 2014, at 8:32 PM, Hari Shreedharan <hshreedha...@cloudera.com> wrote:


> Looks like there is a file without the asf header. Can you check 
> flume-ng-sdk/target/rat.txt?                 
> 
> 
> Thanks,
> Hari
> 
> On Friday, February 7, 2014 at 8:10 PM, Xiaobo Liu wrote:
> 
>> Hello,
>> 
>> I am new to Flume. I try to build flume on mac os x, but project 
>> flume-ng-sdk failed with error "[ERROR] Failed to execute goal 
>> org.apache.rat:apache-rat-plugin:0.7:check (verify.rat) on project 
>> flume-ng-sdk: Too many unapproved licenses”. Any suggestion ?
>> 
>> MacBook-Pro:flume l$ java -version
>> java version "1.6.0_65"
>> Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
>> Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
>> MacBook-Pro:flume $ mvn -version
>> Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 
>> 08:22:22-0700)
>> Maven home: /Users/lxb/work_soft/apache-maven-3.1.1
>> Java version: 1.6.0_65, vendor: Apple Inc.
>> Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
>> Default locale: en_US, platform encoding: MacRoman
>> OS name: "mac os x", version: "10.9.1", arch: "x86_64", family: "mac"
>> MacBook-Pro:flume $ cat .git/config
>> [core]
>>      repositoryformatversion = 0
>>      filemode = true
>>      bare = false
>>      logallrefupdates = true
>>      ignorecase = true
>>      precomposeunicode = false
>> [remote "origin"]
>>      url = https://git-wip-us.apache.org/repos/asf/flume.git
>>      fetch = +refs/heads/*:refs/remotes/origin/*
>> [branch "trunk"]
>>      remote = origin
>>      merge = refs/heads/trunk
>> MacBook-Pro:flume $ git pull
>> Already up-to-date.
>> 
>> MacBook-Pro:flume $ mvn install -DskipTests -X
>> ...
>> DEBUG]   (f) numUnapprovedLicenses = 0
>> [DEBUG]   (f) project = MavenProject: 
>> org.apache.flume:flume-ng-sdk:1.5.0-SNAPSHOT @ 
>> /Users/lxb/work_soft/axxiominc/flume/flume-ng-sdk/pom.xml
>> [DEBUG]   (f) reportFile = 
>> /Users/lxb/work_soft/axxiominc/flume/flume-ng-sdk/target/rat.txt
>> [DEBUG]   (f) reportStyle = plain
>> [DEBUG]   (f) useDefaultExcludes = true
>> [DEBUG]   (f) useEclipseDefaultExcludes = true
>> [DEBUG]   (f) useIdeaDefaultExcludes = true
>> [DEBUG]   (f) useMavenDefaultExcludes = true
>> [DEBUG] -- end configuration --
>> [INFO] Exclude: **/.idea/
>> [INFO] Exclude: **/*.iml
>> [INFO] Exclude: **/nb-configuration.xml
>> [INFO] Exclude: .git/
>> [INFO] Exclude: patchprocess/
>> [INFO] Exclude: .gitignore
>> [INFO] Exclude: .repository/
>> [INFO] Exclude: **/*.diff
>> [INFO] Exclude: **/*.patch
>> [INFO] Exclude: **/*.avsc
>> [INFO] Exclude: **/*.avro
>> [INFO] Exclude: **/docs/**
>> [INFO] Exclude: **/test/resources/**
>> [INFO] Exclude: **/.settings/*
>> [INFO] Exclude: **/.classpath
>> [INFO] Exclude: **/.project
>> [INFO] Exclude: **/target/**
>> [INFO] 
>> ------------------------------------------------------------------------
>> [INFO] Reactor Summary:
>> [INFO]
>> [INFO] Apache Flume ...................................... SUCCESS [1.136s]
>> [INFO] Flume NG SDK ...................................... FAILURE [2.149s]
>> [INFO] Flume NG Configuration ............................ SKIPPED
>> [INFO] Flume NG Core ..................................... SKIPPED
>> [INFO] Flume NG Sinks .................................... SKIPPED
>> [INFO] Flume NG HDFS Sink ................................ SKIPPED
>> [INFO] Flume NG IRC Sink ................................. SKIPPED
>> [INFO] Flume NG Channels ................................. SKIPPED
>> [INFO] Flume NG JDBC channel ............................. SKIPPED
>> [INFO] Flume NG file-based channel ....................... SKIPPED
>> [INFO] Flume NG Node ..................................... SKIPPED
>> [INFO] Flume NG Embedded Agent ........................... SKIPPED
>> [INFO] Flume NG HBase Sink ............................... SKIPPED
>> [INFO] Flume NG ElasticSearch Sink ....................... SKIPPED
>> [INFO] Flume NG Morphline Solr Sink ...................... SKIPPED
>> [INFO] Flume Sources ..................................... SKIPPED
>> [INFO] Flume Scribe Source ............................... SKIPPED
>> [INFO] Flume JMS Source .................................. SKIPPED
>> [INFO] Flume Twitter Source .............................. SKIPPED
>> [INFO] Flume legacy Sources .............................. SKIPPED
>> [INFO] Flume legacy Avro source .......................... SKIPPED
>> [INFO] Flume legacy Thrift Source ........................ SKIPPED
>> [INFO] Flume NG Clients .................................. SKIPPED
>> [INFO] Flume NG Log4j Appender ........................... SKIPPED
>> [INFO] Flume NG Tools .................................... SKIPPED
>> [INFO] Flume NG distribution ............................. SKIPPED
>> [INFO] Flume NG Integration Tests ........................ SKIPPED
>> [INFO] 
>> ------------------------------------------------------------------------
>> [INFO] BUILD FAILURE
>> [INFO] 
>> ------------------------------------------------------------------------
>> [INFO] Total time: 3.708s
>> [INFO] Finished at: Fri Feb 07 20:00:43 PST 2014
>> [INFO] Final Memory: 23M/81M
>> [INFO] 
>> ------------------------------------------------------------------------
>> [ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.7:check 
>> (verify.rat) on project flume-ng-sdk: Too many unapproved licenses: 1 -> 
>> [Help 1]
>> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 
>> goal org.apache.rat:apache-rat-plugin:0.7:check (verify.rat) on project 
>> flume-ng-sdk: Too many unapproved licenses: 1
>>      at 
>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
>>      at 
>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
>>      at 
>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
>>      at 
>> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
>>      at 
>> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
>>      at 
>> org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
>>      at 
>> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
>>      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
>>      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
>>      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
>>      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
>>      at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
>>      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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
>>      at 
>> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
>>      at 
>> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
>>      at 
>> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
>> Caused by: org.apache.rat.mp.RatCheckException: Too many unapproved 
>> licenses: 1
>>      at org.apache.rat.mp.RatCheckMojo.check(RatCheckMojo.java:167)
>>      at org.apache.rat.mp.RatCheckMojo.execute(RatCheckMojo.java:159)
>>      at 
>> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
>>      at 
>> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
>>      ... 19 more
>> [ERROR]
>> [ERROR]
>> [ERROR] For more information about the errors and possible solutions, please 
>> read the following articles:
>> [ERROR] [Help 1] 
>> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>> [ERROR]
>> [ERROR] After correcting the problems, you can resume the build with the 
>> command
>> [ERROR]   mvn <goals> -rf :flume-ng-sdk
> 

Reply via email to