2016-06-27 9 views
0

Kamon 버전 0.6.1 및 akka 2.4.6 및 scala 2.11.8을 사용하고 있습니다. 내 application.conf에서 필요한 구성을 완료하고 javaagent를 사용하여 응용 프로그램을 시작합니다. java.lang.VerifyError를 얻습니다.kamon akka 2.4에서 java.lang.VerifyError를 throw합니다.

java -jar -Djava.library.path=./lib/hyperic-sigar-1.6.4/sigar-bin/lib -javaagent:./lib/aspectjweaver-1.8.9.jar <jar> 

나는 : 여기

의 pom.xml

<properties> 
     <akka.version>2.4.6</akka.version> 
     <slf4j.version>1.7.6</slf4j.version> 
     <log4j.version>2.0-rc1</log4j.version> 
     <slf4j.api.version>1.7.7</slf4j.api.version> 
    </properties> 
    <dependencies> 
     <dependency> 
      <groupId>com.typesafe.akka</groupId> 
      <artifactId>akka-cluster_2.11</artifactId> 
      <version>${akka.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>com.typesafe.akka</groupId> 
      <artifactId>akka-actor_2.11</artifactId> 
      <version>${akka.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>com.typesafe.akka</groupId> 
      <artifactId>akka-cluster-metrics_2.11</artifactId> 
      <version>${akka.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>com.typesafe.akka</groupId> 
      <artifactId>akka-cluster-tools_2.11</artifactId> 
      <version>${akka.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.12</version> 
     </dependency> 

     <dependency> 
      <groupId>org.slf4j</groupId> 
      <artifactId>slf4j-api</artifactId> 
      <version>${slf4j.api.version}</version> 
     </dependency> 

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

     <dependency> 
      <groupId>com.typesafe.akka</groupId> 
      <artifactId>akka-testkit_2.11</artifactId> 
      <version>${akka.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>com.typesafe.akka</groupId> 
      <artifactId>akka-protobuf_2.11</artifactId> 
      <version>${akka.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>io.kamon</groupId> 
      <artifactId>sigar-loader</artifactId> 
      <version>1.6.6-rev002</version> 
     </dependency> 

     <dependency> 
      <groupId>io.kamon</groupId> 
      <artifactId>kamon-akka-remote_akka-2.4_2.11</artifactId> 
      <version>0.6.1</version> 
     </dependency> 

     <dependency> 
      <groupId>io.kamon</groupId> 
      <artifactId>kamon-akka_2.11</artifactId> 
      <version>0.6.1</version> 
     </dependency> 

     <!-- Check if this is needed --> 
     <dependency> 
      <groupId>io.kamon</groupId> 
      <artifactId>kamon-core_2.11</artifactId> 
      <version>0.6.1</version> 
     </dependency> 

     <dependency> 
      <groupId>io.kamon</groupId> 
      <artifactId>kamon-log-reporter_2.11</artifactId> 
      <version>0.6.1</version> 
     </dependency> 

     <dependency> 
      <groupId>com.google.guava</groupId> 
      <artifactId>guava</artifactId> 
      <version>19.0</version> 
     </dependency> 
     <dependency> 
      <groupId>io.kamon</groupId> 
      <artifactId>kamon-system-metrics_2.11</artifactId> 
      <version>0.6.1</version> 
     </dependency> 
     <dependency> 
      <groupId>org.aspectj</groupId> 
      <artifactId>aspectjweaver</artifactId> 
      <version>1.8.9</version> 
     </dependency> 

    </dependencies> 

다음과 같이 내 응용 프로그램을 시작하고

akka { 
    actor { 
    provider = "akka.cluster.ClusterActorRefProvider" 
    serializers { 
    java = "akka.serialization.JavaSerializer" 
    } 
    serialization-bindings { 
    "java.lang.String" = java 
    } 
    } 
    remote { 
    log-remote-lifecycle-events = off 
    netty.tcp { 
     hostname = "127.0.0.1" 
     port = 0 
    } 
    } 

    cluster { 
    seed-nodes = [ 
     "akka.tcp://[email protected]:2551", 
     "akka.tcp://[email protected]:2552"] 

    # auto downing is NOT safe for production deployments. 
    # you may want to use it during development, read more about it in the docs. 
    # 
    auto-down-unreachable-after = 10s 
    } 
} 
akka.cluster.metrics.enabled=true 
akka.extensions=["akka.cluster.pubsub.DistributedPubSub","akka.cluster.client.ClusterClientReceptionist","kamon.akka.AkkaExtension"] 

kamon { 

    metric { 

    # Time interval for collecting all metrics and send the snapshots to all subscribed actors. 
    tick-interval = 10 seconds 

    # Disables a big error message that will be typically logged if your application wasn't started 
    # with the -javaagent:/path-to-aspectj-weaver.jar option. If you are only using KamonStandalone 
    # it might be ok for you to turn this error off. 
    disable-aspectj-weaver-missing-error = false 

    # Specify if entities that do not match any include/exclude filter should be tracked. 
    track-unmatched-entities = yes 

    filters { 
     akka-actor { 
     includes = ["*/user/*"] 
     excludes = [ "*/system/**", "*/user/IO-**", "*kamon*" ] 
     } 

     akka-router { 
     includes = ["*/user/*"] 
     excludes = [] 
     } 

     akka-dispatcher { 
     includes = ["*/user/*"] 
     excludes = [] 
     } 

     trace { 
     includes = [ "**" ] 
     excludes = [ ] 
     } 
    } 

    modules { 
    kamon-akka.auto-start = yes 
    kamon-akka-remote.auto-start = yes 
    kamon-log-reporter.auto-start = yes 
    kamon-system-metrics.auto-start = yes 

    kamon-log-reporter { 
     requires-aspectj = no 
     auto-start = yes 
     extensions = ["kamon.logreporter.LogReporter"] 
    } 
} 
    } 

    # Controls whether the AspectJ Weaver missing warning should be displayed if any Kamon module requiring AspectJ is 
    # found in the classpath but the application is started without the AspectJ Weaver. 
    show-aspectj-missing-warning = yes 
    } 

내 application.conf 내 세부 사항입니다 f를 얻는 것 응용 프로그램을 실행하는 동안 나는 aspectJweaver 항아리를 폐기

2016-06-27 20:30:49 INFO com.sample.Main:66 - Using Actor System ClusterSystem 
[INFO] [06/27/2016 20:30:50.213] [main] [akka.remote.Remoting] Starting remoting 
Uncaught error from thread [ClusterSystem-akka.remote.default-remote-dispatcher-7] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[ClusterSystem] 
java.lang.VerifyError: Bad type on operand stack 
Exception Details: 
    Location: 
    akka/util/ByteString.apply(I)Ljava/lang/Object; @5: areturn 
    Reason: 
    Type integer (current frame, stack[0]) is not assignable to reference type 
    Current Frame: 
    bci: @5 
    flags: { } 
    locals: { 'akka/util/ByteString', integer } 
    stack: { integer } 
    Bytecode: 
    0x0000000: 2a1b b603 99b0       

    at akka.util.ByteString$ByteString1C$.apply(ByteString.scala:106) 
    at akka.remote.transport.AkkaPduProtobufCodec$.constructControlMessagePdu(AkkaPduCodec.scala:235) 
    at akka.remote.transport.AkkaPduProtobufCodec$.<init>(AkkaPduCodec.scala:153) 
    at akka.remote.transport.AkkaPduProtobufCodec$.<clinit>(AkkaPduCodec.scala:1) 
    at akka.remote.EndpointManager$$anonfun$9.apply(Remoting.scala:775) 
    at akka.remote.EndpointManager$$anonfun$9.apply(Remoting.scala:745) 
    at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:683) 
    at scala.collection.Iterator$class.foreach(Iterator.scala:893) 
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1336) 
    at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) 
    at scala.collection.AbstractIterable.foreach(Iterable.scala:54) 
    at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:682) 
    at akka.remote.EndpointManager.akka$remote$EndpointManager$$listens(Remoting.scala:745) 
    at akka.remote.EndpointManager$$anonfun$receive$2.applyOrElse(Remoting.scala:504)[ERROR] [06/27/2016 20:30:50.745] [ClusterSystem-akka.remote.default-remote-dispatcher-7] [akka.actor.ActorSystemImpl(ClusterSystem)] Uncaught error from thread [ClusterSystem-akka.remote.default-remote-dispatcher-7] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled 
java.lang.VerifyError: Bad type on operand stack 
Exception Details: 
    Location: 
    akka/util/ByteString.apply(I)Ljava/lang/Object; @5: areturn 
    Reason: 
    Type integer (current frame, stack[0]) is not assignable to reference type 
    Current Frame: 
    bci: @5 
    flags: { } 
    locals: { 'akka/util/ByteString', integer } 
    stack: { integer } 
    Bytecode: 
    0x0000000: 2a1b b603 99b0       

    at akka.util.ByteString$ByteString1C$.apply(ByteString.scala:106) 
    at akka.remote.transport.AkkaPduProtobufCodec$.constructControlMessagePdu(AkkaPduCodec.scala:235) 
    at akka.remote.transport.AkkaPduProtobufCodec$.<init>(AkkaPduCodec.scala:153) 
    at akka.remote.transport.AkkaPduProtobufCodec$.<clinit>(AkkaPduCodec.scala:1) 
    at akka.remote.EndpointManager$$anonfun$9.apply(Remoting.scala:775) 
    at akka.remote.EndpointManager$$anonfun$9.apply(Remoting.scala:745) 
    at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:683) 
    at scala.collection.Iterator$class.foreach(Iterator.scala:893) 
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1336) 
    at scala.collection.IterableLike$class.foreach(IterableLike.scala:72) 
    at scala.collection.AbstractIterable.foreach(Iterable.scala:54) 
    at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:682) 
    at akka.remote.EndpointManager.akka$remote$EndpointManager$$listens(Remoting.scala:745) 
    at akka.remote.EndpointManager$$anonfun$receive$2.applyOrElse(Remoting.scala:504) 
    at akka.actor.Actor$class.aroundReceive(Actor.scala:482) 
    at akka.remote.EndpointManager.aroundReceive(Remoting.scala:403) 
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526) 
    at akka.actor.ActorCell.invoke(ActorCell.scala:495) 
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257) 
    at akka.dispatch.Mailbox.run(Mailbox.scala:224) 
    at akka.dispatch.Mailbox.exec(Mailbox.scala:234) 
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) 
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) 
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) 
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) 


    at akka.actor.Actor$class.aroundReceive(Actor.scala:482) 
    at akka.remote.EndpointManager.aroundReceive(Remoting.scala:403) 
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526) 
    at akka.actor.ActorCell.invoke(ActorCell.scala:495) 
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257) 
    at akka.dispatch.Mailbox.run(Mailbox.scala:224) 
    at akka.dispatch.Mailbox.exec(Mailbox.scala:234) 
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) 
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) 
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) 
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) 

경우 내 응용 프로그램 시작에 대한 예외를 따르게, 그것이 어떤 배우 메트릭을 인쇄하지 않고, 일반적으로 그러나 시작됩니다. 내 자신의 질문에 대답

[INFO] [06/28/2016 13:07:38.302] [kamon-akka.actor.default-dispatcher-2] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+ 
|                         | 
| CPU (ALL)                      | 
|                         | 
| User (percentage)  System (percentage) Wait (percentage) Idle (percentage)   | 
|  Min: 1      Min: 0     Min: 0    Min: 87    | 
|  Avg: 4.0     Avg: 0.0    Avg: 1.0   Avg: 92.0    | 
|  Max: 9      Max: 2     Max: 8    Max: 97    | 
|                         | 
|                         | 
+--------------------------------------------------------------------------------------------------+ 
[INFO] [06/28/2016 13:07:38.302] [kamon-akka.actor.default-dispatcher-2] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+ 
|                         | 
| Process-CPU                     | 
|                         | 
|    User-Percentage       Total-Percentage       | 
|    Min: 0         Min: 0         | 
|    Avg: 1.0         Avg: 1.0        | 
|    Max: 3         Max: 3         | 
|                         | 
+--------------------------------------------------------------------------------------------------+ 
[INFO] [06/28/2016 13:07:38.302] [kamon-akka.actor.default-dispatcher-2] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+ 
|                         | 
| Network (ALL)                     | 
|                         | 
|  Rx-Bytes (KB)    Tx-Bytes (KB)    Rx-Errors   Tx-Errors  | 
|  Min: 0      Min: 0     Total: 0    Total: 0   | 
|  Avg: 305.0    Avg: 277.0              | 
|  Max: 1776     Max: 1496              | 
|                         | 
+--------------------------------------------------------------------------------------------------+ 
[INFO] [06/28/2016 13:07:38.303] [kamon-akka.actor.default-dispatcher-2] [akka://kamon/user/kamon-log-reporter] 
+--------------------------------------------------------------------------------------------------+ 
|                         | 
| Context-Switches                    | 
|                         | 
|  Global    Per-Process-Non-Voluntary   Per-Process-Voluntary   | 
| Min: 19660800      Min: 3        Min: 2     | 
| Avg: 1.9778764E7     Avg: 3.0       Avg: 2.0    | 
| Max: 19791872      Max: 3        Max: 2     | 
|                         | 
+--------------------------------------------------------------------------------------------------+ 
[INFO] [06/28/2016 13:07:38.303] [kamon-akka.actor.default-dispatcher-2] [akka://kamon/user/kamon-log-reporter] No metrics reported 
+1

깔끔하고, 뭔가 깨진 바이트 코드가 생성되었습니다. 스택의 현재 요소는 정수 (원시'int')이지만 명령은 객체/참조 유형을'반환 '합니다. 야생 추측 : 일부 라이브러리의 버그 또는 호환되지 않는 버전의 라이브러리/컴파일러/에이전트/jvm이 사용됩니다. – zapl

+0

이것이 AspectJ와 어떤 관련이 있습니까? –

+0

명령을 실행하는 동안 aspectJweaver javaagent를 제거하면 오류가 발생하지 않습니다. 물론 예외는 아닙니다. aspectJ가 없다는 경고입니다. –

답변

0

아래와 같이 그것은

내가 내 치어

추가 종속성

<dependency> 
    <groupId>io.kamon</groupId> 
    <artifactId>kamon-autoweave_2.11</artifactId> 
    <version>0.6.1</version> 
</dependency> 

에 다음 수정 한 그리고 가문을 제거 만 시스템 메트릭을 인쇄 -akka-remote-2.4_2.11 jar

변경된 내 애플 리케이션 응용 프로그램을 시작하는 동안 autoweave jar 파일이 추가되었으므로 -javaagent 매개 변수를 제공 할 필요가 없습니다.