Skip to content

Commit

Permalink
Fix reference bean create proxy with javassist in native
Browse files Browse the repository at this point in the history
Signed-off-by: crazyhzm <crazyhzm@gmail.com>
  • Loading branch information
CrazyHZM committed Dec 15, 2023
1 parent ad803e1 commit cfe2463
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.dubbo.config.spring;

import org.apache.dubbo.common.aot.NativeDetector;
import org.apache.dubbo.common.bytecode.Proxy;
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
Expand Down Expand Up @@ -364,7 +365,12 @@ private void createLazyProxy() {
}
}

if (StringUtils.isEmpty(this.proxy) || CommonConstants.DEFAULT_PROXY.equalsIgnoreCase(this.proxy)) {
if (NativeDetector.inNativeImage()) {
generateFromJdk(interfaces);
}

if (this.lazyProxy == null
&& (StringUtils.isEmpty(this.proxy) || CommonConstants.DEFAULT_PROXY.equalsIgnoreCase(this.proxy))) {
generateFromJavassistFirst(interfaces);
}

Expand Down

0 comments on commit cfe2463

Please sign in to comment.