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

unknown actor creator [class eventstore.WriteResult] #1

Open
JacobAMason opened this issue May 12, 2019 · 2 comments

Comments

@JacobAMason
Copy link

commented May 12, 2019

The Getting Started guide documentation for JVM states that these lines should be used to publish an event using akka

    final ActorRef writeResult = system.actorOf(Props.create(WriteResult.class));

    final EventData event = new EventDataBuilder("event-type")
            .eventId(UUID.randomUUID())
            .jsonData("{\"a\": \"1\"}")
            .build();

    final WriteEvents writeEvents = new WriteEventsBuilder("newstream")
            .addEvent(event)
            .expectAnyVersion()
            .build();

    connection.tell(writeEvents, writeResult);
}

The EventStore JVM client includes a WriteResult class, but when this class is used, the following error occurs

unknown actor creator [class eventstore.WriteResult]

However, when I implement my own WriteResult extending UntypedActor as in https://github.com/EventStore/EventStore.Samples.Java/blob/master/src/main/java/org/eventstore/sample/WriteEventExample.java#L39-L54, or by extending AbstractActor (as UntypedActor is deprecated), the error above described does not occur.

Here are my gradle deps. Note, I am using Kotlin.

dependencies {
    implementation(kotlin("stdlib-jdk8"))
    implementation(kotlin("reflect"))
    implementation(kotlin("serialization"))
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.10.0")
    implementation("io.github.microutils:kotlin-logging:1.6.24")
    implementation("com.geteventstore:eventstore-client_2.12:6.0.0")

    runtime("org.slf4j:slf4j-simple:1.7.+")

    testImplementation(kotlin("test-junit5"))
    testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.+")
    testRuntime("org.junit.jupiter:junit-jupiter-engine:5.+")
}
@ChrisChinchilla

This comment has been minimized.

Copy link
Member

commented May 14, 2019

@JacobAMason Hmm, thanks! I am pretty sure that there were some changes to the JVM client recently, so maybe I need to check these examples again. Leave it with me, unless you found a solution yourself, in which case please create a PR :)

@ChrisChinchilla ChrisChinchilla self-assigned this May 14, 2019

@JacobAMason

This comment has been minimized.

Copy link
Author

commented May 14, 2019

@ChrisChinchilla I probably won't take a look until this weekend, so when you probably beat me to it, I recommend migrating the samples from extending UntypedActor to extending AbstractActor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.