tronprotocol / event-plugin

Tron eventsubscribe plugin
37 stars 34 forks source link

BUILD FAILED #13

Closed alexqrid closed 3 years ago

alexqrid commented 4 years ago

I tried to build plugin according to the instructions in README but it failed. Here is the full stack trace. I need plugin for mongodb, how can I build it?

Stack trace ~~~ Note: class org.pf4j.processor.ExtensionAnnotationProcessor init /root/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/ContractLogTrigger.java:7: warning: lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run during this compilation: java.lang.IllegalArgumentException: com.sun.tools.javac.api.ClientCodeWrapper$WrappedStandardJavaFileManager extends com.sun.tools.javac.api.ClientCodeWrapper$WrappedJavaFileManager implements javax.tools.StandardJavaFileManager public class ContractLogTrigger extends ContractTrigger { ^ at lombok.javac.apt.LombokFileObjects.getCompiler(LombokFileObjects.java:130) at lombok.javac.apt.InterceptingJavaFileManager.(InterceptingJavaFileManager.java:40) at lombok.javac.apt.LombokProcessor.placePostCompileAndDontMakeForceRoundDummiesHook(LombokProcessor.java:164) at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:85) at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:87) at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:140) at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:69) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.(JavacProcessingEnvironment.java:686) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:786) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:881) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1222) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1334) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1258) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:936) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:50) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:36) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:86) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:47) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:33) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:40) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:27) at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:161) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:146) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:118) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter.execute(ResolveBuildCacheKeyExecuter.java:66) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101) at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:262) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:246) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:136) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:201) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.executeWithTask(DefaultTaskPlanExecutor.java:192) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:130) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.base/java.lang.Thread.run(Thread.java:834) /root/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/ContractLogTrigger.java:24: error: cannot find symbol setTriggerName(Trigger.CONTRACTLOG_TRIGGER_NAME); ^ symbol: method setTriggerName(String) location: class ContractLogTrigger /root/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/TransactionLogTrigger.java:10: error: method does not override or implement a method from a supertype @Override ^ /root/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/TransactionLogTrigger.java:99: error: cannot find symbol setTriggerName(Trigger.TRANSACTION_TRIGGER_NAME); ^ symbol: method setTriggerName(String) location: class TransactionLogTrigger /root/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/SolidityTrigger.java:13: error: cannot find symbol return new StringBuilder().append("triggerName: ").append(getTriggerName()) ^ symbol: method getTriggerName() location: class SolidityTrigger /root/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/SolidityTrigger.java:21: error: cannot find symbol setTriggerName(Trigger.SOLIDITY_TRIGGER_NAME); ^ symbol: method setTriggerName(String) location: class SolidityTrigger /root/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/BlockLogTrigger.java:44: error: cannot find symbol setTriggerName(Trigger.BLOCK_TRIGGER_NAME); ^ symbol: method setTriggerName(String) location: class BlockLogTrigger /root/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/BlockLogTrigger.java:49: error: cannot find symbol return new StringBuilder().append("triggerName: ").append(getTriggerName()) ^ symbol: method getTriggerName() location: class BlockLogTrigger /root/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/ContractEventTrigger.java:43: error: cannot find symbol setTriggerName(Trigger.CONTRACTEVENT_TRIGGER_NAME); ^ symbol: method setTriggerName(String) location: class ContractEventTrigger 8 errors 1 warning FAILURE: Build failed with an exception. ~~~
ProximaCentauri1989 commented 4 years ago

I have the same issue. How can I solve it?

oikos1 commented 4 years ago

Same issue here:


/root/code/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/SolidityTrigger.java:13: error: cannot find symbol
    return new StringBuilder().append("triggerName: ").append(getTriggerName())
                                                              ^
  symbol:   method getTriggerName()
  location: class SolidityTrigger
/root/code/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/SolidityTrigger.java:21: error: cannot find symbol
    setTriggerName(Trigger.SOLIDITY_TRIGGER_NAME);
    ^
  symbol:   method setTriggerName(String)
  location: class SolidityTrigger
/root/code/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/BlockLogTrigger.java:44: error: cannot find symbol
    setTriggerName(Trigger.BLOCK_TRIGGER_NAME);
    ^
  symbol:   method setTriggerName(String)
  location: class BlockLogTrigger
/root/code/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/BlockLogTrigger.java:49: error: cannot find symbol
    return new StringBuilder().append("triggerName: ").append(getTriggerName())
                                                              ^
  symbol:   method getTriggerName()
  location: class BlockLogTrigger
/root/code/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/TransactionLogTrigger.java:10: error: method does not override or implement a method from a supertype
  @Override
  ^
/root/code/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/TransactionLogTrigger.java:99: error: cannot find symbol
    setTriggerName(Trigger.TRANSACTION_TRIGGER_NAME);
    ^
  symbol:   method setTriggerName(String)
  location: class TransactionLogTrigger
/root/code/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/ContractEventTrigger.java:43: error: cannot find symbol
    setTriggerName(Trigger.CONTRACTEVENT_TRIGGER_NAME);
    ^
  symbol:   method setTriggerName(String)
  location: class ContractEventTrigger
/root/code/event-plugin/api/src/main/java/org/tron/common/logsfilter/trigger/ContractLogTrigger.java:24: error: cannot find symbol
    setTriggerName(Trigger.CONTRACTLOG_TRIGGER_NAME);
    ^
  symbol:   method setTriggerName(String)
  location: class ContractLogTrigger
8 errors
1 warning

FAILURE: Build failed with an exception.

Any hint on the solution? Thank you.

ProximaCentauri1989 commented 4 years ago

The solution is simple. Try to built it on Windows. I was not able to build the project on Ubuntu 20.04, but on Windows10 it works fine.

oikos1 commented 4 years ago

The solution is simple. Try to built it on Windows. I was not able to build the project on Ubuntu 20.04, but on Windows10 it works fine.

It worked, thank you so much. I was able to build on Windows 10 with the latest version of Gradle.

yxy commented 2 years ago

How could I solve this on Mac?

alexqrid commented 1 year ago

I've been able to build and run the plugin with the following Dockerfile:

FROM tronprotocol/java-tron:latest
WORKDIR /java-tron
RUN git clone https://github.com/tronprotocol/event-plugin.git && \
    yum install -y java-1.8.0-openjdk-devel
RUN cd event-plugin && export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.372.b07-1.el7_9.x86_64/jre/; ./gradlew build
# DOCKER_HTTP_PORT
EXPOSE 8090 
# DOCKER_SOLIDITY_PORT
EXPOSE 8091
# DOCKER_RPC_PORT
EXPOSE 50051
# DOCKER_JSONRPC_PORT
EXPOSE 18888
# DOCKER_LISTEN_PORT
EXPOSE 50545

Don't forget to change the value of useNativeQueue to false in the main_net_config.conf:

event.subscribe = {
    native = {
      useNativeQueue = false // if true, use native message queue, else use event plugin.
      bindport = 5555 // bind port
      sendqueuelength = 1000 //max length of send queue
    }
...