Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

RuntimeException: org/zeromq/ZMQ

Scott Walter July 2, 2015

I'm trying to use a library that includes the jzmq library. IntelliJ doesn't notice any problems with my usages of that library and the code builds fine with "atlas-run". However, when the hook plugin that includes this code is run, I get a run time exception referencing zeromq. Here's the stack trace:

java.lang.RuntimeException: org/zeromq/ZMQ
    at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) ~[atlassian-event-2.3.5.jar:na]
    at com.atlassian.stash.internal.event.AsyncBatchingInvokersTransformer$AsyncInvokerBatch.invoke(AsyncBatchingInvokersTransformer.java:100) ~[stash-platform-3.10.2.jar:na]
    at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) [atlassian-event-2.3.5.jar:na]
    at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:38) [sal-core-2.13.4.jar:na]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
    ... 1 frame trimmed
Caused by: java.lang.NoClassDefFoundError: org/zeromq/ZMQ
    at org.fedoraproject.fedmsg.FedmsgConnection.connect(FedmsgConnection.java:36) ~[na:na]
    at com.atlassian.stash.plugin.fedmsghook.hook.FedmsgPostReceiveHook.postReceive(FedmsgPostReceiveHook.java:29) ~[na:na]
    at com.atlassian.stash.internal.hook.repository.AsyncPostReceiveRepositoryHookAdapter$1.visit(AsyncPostReceiveRepositoryHookAdapter.java:49) ~[stash-service-impl-3.10.2.jar:na]
    at com.atlassian.stash.internal.hook.repository.AsyncPostReceiveRepositoryHookAdapter$1.visit(AsyncPostReceiveRepositoryHookAdapter.java:45) ~[stash-service-impl-3.10.2.jar:na]
    at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService$RepositoryHookPagedTransactionCallback.doInTransaction(DefaultRepositoryHookService.java:611) ~[stash-service-impl-3.10.2.jar:na]
    at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService$RepositoryHookPagedTransactionCallback.doInTransaction(DefaultRepositoryHookService.java:587) ~[stash-service-impl-3.10.2.jar:na]
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) ~[spring-tx-4.1.6.RELEASE.jar:4.1.6.RELEASE]
    at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.visitEnabledHooks(DefaultRepositoryHookService.java:304) ~[stash-service-impl-3.10.2.jar:na]
    at com.atlassian.stash.internal.hook.repository.AsyncPostReceiveRepositoryHookAdapter.postReceive(AsyncPostReceiveRepositoryHookAdapter.java:45) ~[stash-service-impl-3.10.2.jar:na]
    at com.atlassian.stash.internal.hook.repository.AsyncPostReceiveRepositoryHookAdapter.onRefsChangedEvent(AsyncPostReceiveRepositoryHookAdapter.java:40) ~[stash-service-impl-3.10.2.jar:na]
    at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) ~[atlassian-event-2.3.5.jar:na]
    ... 6 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.zeromq.ZMQ not found by com.atlassian.stash.plugin.fedmsghook.fedmsghook-plugin [53]
    at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:812) ~[org.apache.felix.framework-3.2.2.jar:na]
    ... 17 common frames omitted

It seems that the atlassian SDK is incapable of finding the zeromq libraries, so I tried to add the the location of the libraries to my PATH variable, but that didn't seem to make a difference. Any ideas?

Thanks!

3 answers

1 accepted

0 votes
Answer accepted
Scott Walter July 6, 2015

I defined my dependencies like this and then it worked:

<dependency>
    <groupId>org.zeromq</groupId>
    <artifactId>jeromq</artifactId>
    <version>0.3.3</version>
    <scope>runtime</scope>
</dependency>
<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.3.0</version>
    <scope>runtime</scope>
</dependency>
<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-core</artifactId>
    <version>2.3.0</version>
    <scope>runtime</scope>
</dependency>
<dependency>
    <groupId>org.bouncycastle</groupId>
    <artifactId>bcpkix-jdk15on</artifactId>
    <version>1.50</version>
    <scope>runtime</scope>
</dependency>
<dependency>
    <groupId>org.functionaljava</groupId>
    <artifactId>functionaljava</artifactId>
    <version>3.1</version>
    <scope>runtime</scope>
</dependency>

The key was stating the scope as runtime.

0 votes
Scott Walter July 6, 2015

I don't think I defined it at all. Here's what I did exactly: 1. I cloned this: https://github.com/fedora-infra/fedmsg-java 2. I built it to generate a .jar for source, doc, and classes. 3. I imported all of those .jars into IntelliJ, and all of my references to the classes that I was using from that library worked. 4. Built it with atlassian-sdk 5. Runtime exception I'll look into defining dependencies in the pom.xml

0 votes
Stefan Saasen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 5, 2015

Hi Scott,

 

how did you define the dependency on the ZeroMQ library in your pom?

Cheers,

Stefan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events