Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.8-SNAPSHOT

Operating System version: xxx

Java version: xxx

Steps to reproduce this issue

Do not start zookeeper server, which is used as a metadata center

start a provider

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

The app exit normally

Actual Result

The app exit with a NPE

If there is an exception, please attach the exception trace:

Exception in thread "DubboShutdownHook" java.lang.RuntimeException: java.lang.NullPointerException
at org.apache.dubbo.common.function.ThrowableAction.execute(ThrowableAction.java:48)
at org.apache.dubbo.common.lang.ShutdownHookCallbacks.lambda$callback$0(ShutdownHookCallbacks.java:70)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.apache.dubbo.common.lang.ShutdownHookCallbacks.callback(ShutdownHookCallbacks.java:70)
at org.apache.dubbo.config.DubboShutdownHook.callback(DubboShutdownHook.java:85)
at org.apache.dubbo.config.DubboShutdownHook.run(DubboShutdownHook.java:73)
Caused by: java.lang.NullPointerException
at org.apache.dubbo.config.bootstrap.DubboBootstrap.unexportMetadataService(DubboBootstrap.java:1009)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.destroy(DubboBootstrap.java:1188)
at org.apache.dubbo.config.bootstrap.DubboBootstrap$1.callback(DubboBootstrap.java:198)
at org.apache.dubbo.common.function.ThrowableAction.execute(ThrowableAction.java:46)
... 5 more

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: v2.7.3

Operating System version: OSX

Java version: javac 1.8.0_202

Kotlin version: 1.3.40

Steps to reproduce this issue

data class Data(var list: MutableList<CustomizeDateTime> = mutableListOf()) : Serializable {}

// Get the correct result when time has no default value or is null
// CustomizeDateTime(var time: LocalTime) or CustomizeDateTime(var time: LocalTime? = null)
data class CustomizeDateTime(var time: LocalTime = LocalTime.parse("12:00:00")) : Serializable {}

private var byteArrayOutputStream: ByteArrayOutputStream? = null
private var protostuffObjectOutput: ProtostuffObjectOutput? = null
private var protostuffObjectInput: ProtostuffObjectInput? = null
private var byteArrayInputStream: ByteArrayInputStream? = null

@Throws(IOException::class)
private fun flushToInput() {
this.protostuffObjectOutput?.flushBuffer()
this.byteArrayInputStream = ByteArrayInputStream(byteArrayOutputStream?.toByteArray())
this.protostuffObjectInput = ProtostuffObjectInput(byteArrayInputStream)
}

@Before
@Throws(Exception::class)
fun setUp() {
this.byteArrayOutputStream = ByteArrayOutputStream()
this.protostuffObjectOutput = ProtostuffObjectOutput(byteArrayOutputStream)
}

@Test
fun `Test List LocalTime`() {
val times = mutableListOf(
CustomizeDateTime(LocalTime.parse("08:00:00")),
CustomizeDateTime(LocalTime.parse("12:00:00")),
CustomizeDateTime(LocalTime.parse("19:01:10")))
val data = Data(times)
this.protostuffObjectOutput?.writeObject(data)
this.flushToInput()

val serializedTime = protostuffObjectInput?.readObject()
println(serializedTime)
}

Expected Result

Data(list=[CustomizeDateTime(time=08:00), CustomizeDateTime(time=12:00), CustomizeDateTime(time=19:01:10)])

Actual Result

Data(list=[CustomizeDateTime(time=19:01:10), CustomizeDateTime(time=19:01:10), CustomizeDateTime(time=19:01:10)])

If there is an exception, please attach the exception trace:

Just put your stack trace here!