SGTM

On Fri, Apr 21, 2023 at 1:56 PM Daniele Segato <[email protected]>
wrote:

> Hi,
>
> It's part of a product of my company, I cannot disclose the code. I'll see
> if I can manage to create a small project on GitHub to reproduce it.
>
> But I won't be able to do it until the end of next week.
>
> I'll update here.
>
> Thank you!
> Daniele
>
> On Thu, Apr 20, 2023, 17:31 'Jerry Berg' via Protocol Buffers <
> [email protected]> wrote:
>
>> Hi Daniele,
>>
>> I'm having difficulty reproducing this issue. Do you have a project on
>> GitHub or some other location where I can clone it and try it out?
>>
>> Thanks,
>> Jerry
>>
>> On Tuesday, April 18, 2023 at 1:29:11 AM UTC-6 Daniele Segato wrote:
>>
>>> anyone?
>>>
>>> On Thursday, March 2, 2023 at 11:35:54 AM UTC+1 Daniele Segato wrote:
>>>
>>>> Hi,
>>>>
>>>> I get runtime errors when I try to use
>>>> the com.google.protobuf:protobuf-java-util to convert a long to a 
>>>> Timestamp.
>>>>
>>>> I believe the issue is that the protobuf-java-util does not support
>>>> kotlin
>>>>
>>>> Here's the stacktrace, followed by my build.gradle.kts for the project
>>>>
>>>>     'com.google.protobuf.Timestamp
>>>> com.google.protobuf.Timestamp$Builder.build()'
>>>> java.lang.NoSuchMethodError: 'com.google.protobuf.Timestamp
>>>> com.google.protobuf.Timestamp$Builder.build()'
>>>>     at com.google.protobuf.util.Timestamps.<clinit>(Timestamps.java:73)
>>>>     at
>>>> nhc.protobuf.util.TimestampsKtKt.toProtoTimestamp(TimestampsKt.kt:7)
>>>>     at
>>>> nhc.protobuf.util.TimestampsKtTest.toTimestamp(TimestampsKtTest.kt:16)
>>>>     at
>>>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>> Method)
>>>>     at
>>>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>>>>     at
>>>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>>>>     at
>>>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
>>>>     at
>>>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>     at
>>>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
>>>>     at
>>>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>     at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
>>>>     at
>>>> org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
>>>>     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
>>>>     at
>>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
>>>>     at
>>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
>>>>     at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
>>>>     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
>>>>     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
>>>>     at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
>>>>     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
>>>>     at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
>>>>     at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:108)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:40)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:60)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:52)
>>>>     at
>>>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>> Method)
>>>>     at
>>>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>>>>     at
>>>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>>>>     at
>>>> org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
>>>>     at
>>>> org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
>>>>     at
>>>> org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
>>>>     at
>>>> org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
>>>>     at jdk.proxy1/jdk.proxy1.$Proxy2.processTestClass(Unknown Source)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
>>>>     at
>>>> org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
>>>>     at
>>>> org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113)
>>>>     at
>>>> org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
>>>>     at
>>>> worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
>>>>     at
>>>> worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
>>>>
>>>>
>>>> Could not initialize class com.google.protobuf.util.Timestamps
>>>> java.lang.NoClassDefFoundError: Could not initialize class
>>>> com.google.protobuf.util.Timestamps
>>>>     at
>>>> nhc.protobuf.util.TimestampsKtKt.toMillisTimestamp(TimestampsKt.kt:11)
>>>>     at
>>>> nhc.protobuf.util.TimestampsKtTest.toMillisTimestamp(TimestampsKtTest.kt:26)
>>>>     at
>>>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>> Method)
>>>>     at
>>>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>>>>     at
>>>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>>>>     at
>>>> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
>>>>     at
>>>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>     at
>>>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
>>>>     at
>>>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>     at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
>>>>     at
>>>> org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
>>>>     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
>>>>     at
>>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
>>>>     at
>>>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
>>>>     at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
>>>>     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
>>>>     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
>>>>     at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
>>>>     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
>>>>     at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
>>>>     at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:108)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:40)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:60)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:52)
>>>>     at
>>>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>> Method)
>>>>     at
>>>> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>>>>     at
>>>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>>>>     at
>>>> org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
>>>>     at
>>>> org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
>>>>     at
>>>> org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
>>>>     at
>>>> org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
>>>>     at jdk.proxy1/jdk.proxy1.$Proxy2.processTestClass(Unknown Source)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
>>>>     at
>>>> org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
>>>>     at
>>>> org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
>>>>     at
>>>> org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113)
>>>>     at
>>>> org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
>>>>     at
>>>> worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
>>>>     at
>>>> worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
>>>>
>>>>
>>>> My project is configured like this:
>>>>
>>>>
>>>>    import com.google.protobuf.gradle.id
>>>>
>>>>     plugins {
>>>>         id("java-library")
>>>>         id("org.jetbrains.kotlin.jvm") version "1.8.10"
>>>>         id("com.google.protobuf") version "0.9.1"
>>>>     }
>>>>
>>>>     java {
>>>>         sourceCompatibility = JavaVersion.VERSION_17
>>>>         targetCompatibility = JavaVersion.VERSION_17
>>>>     }
>>>>
>>>>     kotlin {
>>>>         jvmToolchain(17)
>>>>     }
>>>>
>>>>     tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
>>>>         kotlinOptions.jvmTarget = "17"
>>>>     }
>>>>
>>>>     protobuf {
>>>>         protoc {
>>>>             artifact = "com.google.protobuf:protoc:3.21.9"
>>>>         }
>>>>
>>>>         // Generates the java Protobuf-lite code for the Protobufs in
>>>> this project. See
>>>>         //
>>>> https://github.com/google/protobuf-gradle-plugin#customizing-protobuf-compilation
>>>>         // for more information.
>>>>         generateProtoTasks {
>>>>             // see
>>>> https://github.com/google/protobuf-gradle-plugin/issues/518
>>>>             // see
>>>> https://github.com/google/protobuf-gradle-plugin/issues/491
>>>>             ofSourceSet("main").forEach { task ->
>>>>                 task.builtins {
>>>>                     getByName("java") {
>>>>                         option("lite")
>>>>                     }
>>>>                     id("kotlin") {
>>>>                         option("lite")
>>>>                     }
>>>>                 }
>>>>             }
>>>>         }
>>>>     }
>>>>
>>>>     dependencies {
>>>>         api("com.google.protobuf:protobuf-javalite:3.21.9")
>>>>         api("com.google.protobuf:protobuf-kotlin-lite:3.21.9")
>>>>         api("com.google.protobuf:protobuf-java-util:3.21.9")
>>>>     }
>>>>
>>>> Should I open a bug or a feature request on
>>>> https://github.com/protocolbuffers/protobuf/issues/ ?
>>>>
>>>> Thanks in advance,
>>>> Daniele
>>>>
>>>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Protocol Buffers" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/protobuf/mvf2tJWrTXE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/protobuf/8f7ec431-9ac9-44d7-b29f-694709616b38n%40googlegroups.com
>> <https://groups.google.com/d/msgid/protobuf/8f7ec431-9ac9-44d7-b29f-694709616b38n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/CAND5yRvHzz%3DtW2pkvFTzbZz0kmMtrVumGV1ZSC8JO1fDA0UszA%40mail.gmail.com
> <https://groups.google.com/d/msgid/protobuf/CAND5yRvHzz%3DtW2pkvFTzbZz0kmMtrVumGV1ZSC8JO1fDA0UszA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Jerry Berg | Software Engineer | [email protected] | 720-808-1188

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CAHLB6RfzxK_MOd59KXmGhGSZ2DaZSK%3Dbf%3DTSGaDa65XphNTVsw%40mail.gmail.com.

Reply via email to