1
lxk11153 2020-02-14 01:03:05 +08:00 1
不知道,试试如下:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd "> </beans> |
2
PUGE OP @lxk11153 还是这个提示,NamespaceHandler 这个好像是解析自定义标签,看样子是标签解析不成功
Caused by: org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.apache.dubbo.config.spring.schema.DubboNamespaceHandler] for namespace [http://code.alibabatech.com/schema/dubbo]: problem with handler class file or dependent class; nested exception is java.lang.VerifyError: class org.apache.dubbo.config.spring.schema.DubboNamespaceHandler overrides final method parse.(Lorg/w3c/dom/Element;Lorg/springframework/beans/factory/xml/ParserContext;)Lorg/springframework/beans/factory/config/BeanDefinition; at org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve(DefaultNamespaceHandlerResolver.java:138) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1292) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398) ... 32 more Caused by: java.lang.VerifyError: class org.apache.dubbo.config.spring.schema.DubboNamespaceHandler overrides final method parse.(Lorg/w3c/dom/Element;Lorg/springframework/beans/factory/xml/ParserContext;)Lorg/springframework/beans/factory/config/BeanDefinition; |
3
lxk11153 2020-02-14 11:31:02 +08:00
由 dubbo-*.*.*.jar 下 /META-INF/spring.schemas 可知 (/META-INF/spring.handlers)
http\://dubbo.apache.org/schema/dubbo/dubbo.xsd=META-INF/dubbo.xsd http\://code.alibabatech.com/schema/dubbo/dubbo.xsd=META-INF/compat/dubbo.xsd 配置 dubbo.apache.org 和 code.alibabatech.com (for compat)是一样的 |
5
lxk11153 2020-02-14 11:45:03 +08:00
是不是 java 版本问题? dubbo-*.*.*.jar 是几版本(/java 几编译的),由 java 几运行?
|
7
PUGE OP @lxk11153 看了下报错在 package org.springframework.beans.factory.xml ,catch 了 LinkageError 可能是兼容的问题,我在研究下
public NamespaceHandler resolve(String namespaceUri) { Map handlerMappings = this.getHandlerMappings(); Object handlerOrClassName = handlerMappings.get(namespaceUri); if (handlerOrClassName == null) { return null; } else if (handlerOrClassName instanceof NamespaceHandler) { return (NamespaceHandler)handlerOrClassName; } else { String className = (String)handlerOrClassName; try { Class handlerClass = ClassUtils.forName(className, this.classLoader); if (!NamespaceHandler.class.isAssignableFrom(handlerClass)) { throw new FatalBeanException("Class [" + className + "] for namespace [" + namespaceUri + "] does not implement the [" + NamespaceHandler.class.getName() + "] interface"); } else { NamespaceHandler namespaceHandler = (NamespaceHandler)BeanUtils.instantiateClass(handlerClass); namespaceHandler.init(); handlerMappings.put(namespaceUri, namespaceHandler); return namespaceHandler; } } catch (ClassNotFoundException var7) { throw new FatalBeanException("NamespaceHandler class [" + className + "] for namespace [" + namespaceUri + "] not found", var7); } catch (LinkageError var8) { throw new FatalBeanException("Invalid NamespaceHandler class [" + className + "] for namespace [" + namespaceUri + "]: problem with handler class file or dependent class", var8); } } } |
9
lxk11153 2020-02-14 12:00:27 +08:00
Java 8 and Spring 2.5 好像是不兼容的,网上一搜就有
|
10
lxk11153 2020-02-14 12:02:23 +08:00 1
比如覆盖 org.springframework.core.JdkVersion 可以解决
https://gist.github.com/xluer/e48633afa658bd794d754d5508a864c4 |
13
bbao 2020-02-14 12:26:07 +08:00
现在用 dubbo 的多还是 dubbox 的多?
|
17
lxk11153 2020-02-14 12:52:50 +08:00
|
18
KnightYoung 2020-02-14 19:46:36 +08:00
撞头像了老铁
|