草庐IT

xsd-schema

全部标签

java - 是否可以从带有 JAXB 注释的类生成 XSD?

我已经编写了许多使用JAXB进行序列化的类,我想知道是否有一种方法可以根据注释为每个对象生成XSD文件。有这个工具吗?像generate-xsdcom/my/package/model/Unit.java这样的东西会是awesome。有什么可以做到这一点吗? 最佳答案 是的,您可以在JAXBContext上使用generateSchema方法:JAXBContextjaxbContext=JAXBContext.newInstance(Customer.class);SchemaOutputResolversor=newMySche

java - 如何使用 JAXB 从 xsd 生成实现 Serializable 接口(interface)的 Java 类?

我想在一个现有的Spring项目中引入缓存,该项目使用JAXB来公开WebServices。缓存将在端点级别完成。为了做到这一点,使用JAXB从XSD生成的类需要实现Serializable接口(interface)并覆盖Object的toString()方法。如何使用XSD指示xjc工具生成具有所需属性的源代码? 最佳答案 可序列化在自定义绑定(bind)文件中使用xjc:serializable将java.io.Serializable接口(interface)与serialVersionUID一起添加到您的类中:toStrin

java - Spring 如何从类路径中找到 XSD 文件

在我们的spring配置中,我们这样放置beans标签:现在spring必须从我的calsspath中找出文件的位置spring-beans.xsd&spring-context.xsd.我在这个路径找到了一些xsd文件:spring-context-4.1.5.RELEASE.jar/org/springframework/context/configspring-context-2.5.xsdspring-context-3.0.xsdspring-context-3.1.xsdspring-context-3.2.xsdspring-context-4.0.xsdspring-c

spring - 无法找到 XML 模式命名空间的 Spring NamespaceHandler [http ://www. springframework.org/schema/tx]

我正在尝试ro运行spring项目(列出了哪些配置文件here,但我在eclipse控制台中收到以下错误:Grave:Allocateexceptionforservletsdnextorg.springframework.beans.factory.parsing.BeanDefinitionParsingException:Configurationproblem:UnabletolocateSpringNamespaceHandlerforXMLschemanamespace[http://www.springframework.org/schema/tx]Offendingre

spring - 找不到 XML 模式命名空间的 Spring NamespaceHandler [http ://www. springframework.org/schema/batch]

情况我正在使用SpringBatch为我们的数据仓库构建一个累积快照,但我遇到了一个我无法弄清楚的配置障碍。我使用Spring模板项目创建了一个带有STS(SpringSourceToolSuite2.8.1)的简单SpringBatch项目。这是我创建的两个xml配置文件:launch-context.xml和module-context.xmlExamplejobtogetyoustarted.Itprovidesaskeletonforatypicalbatchapplication.问题我运行以下命令来编译和打包项目:mvncleancompileinstall然后我这样做:c

java - Spring security3 "You cannot use a spring-security-2.0.xsd schema"

我一直在...org.springframework.beans.factory.parsing.BeanDefinitionParsingException:Configurationproblem:Youcannotuseaspring-security-2.0.xsdschemawithSpringSecurity3.0.Pleaseupdateyourschemadeclarationstothe3.0schema.Offendingresource:ServletContextresource[/WEB-INF/spring/root-context.xml]我的root-c

spring - schema_reference.4 : Failed to read schema document 'http://www. springframework.org/schema/beans/spring-beans-4.1.5.xsd

我在Eclipse中的spring-dispatcher.xml中遇到错误,如下所示。schema_reference.4:Failedtoreadschemadocument'http://www.springframework.org/schema/beans/spring-beans-4.1.5.xsd',because1)couldnotfindthedocument;2)thedocumentcouldnotberead;3)therootelementofthedocumentisnot.我有最新的spring库...spring-beans-4.1.5.RELEASE.j

spring - Apache Camel Spring 配置错误 - 无法找到 XML 模式命名空间的 Spring NamespaceHandler [http ://camel. apache.org/schema/spring]

我已经发布了我的spring.xml文件的摘录和我得到的堆栈跟踪。com.testdomain.testpackage...抛出此异常:SEVERE:Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.parsing.BeanDefinitionParsingException:Configurationproblem:Unabletolo

java - : org. apache.ws.commons.schema.XmlSchemaCollection.read(InputSource) 发生了什么?

我有一个包含Spring3.0.2和XmlSchema.jar1.4.7的java项目项目的pom.xml包含作为依赖项:org.apache.ws.commons.schemaXmlSchema1.4.7项目编译正常,但在点击上下文页面时报告以下错误:SEVERE:StandardWrapper.Throwableorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'schemaCollection'definedinclasspathresource[application

java - 为什么 Spring Boot 2.0 应用程序不运行 schema.sql?

当我使用SpringBoot1.5时,在应用程序启动时,当设置了适当的配置时,Hibernate会执行位于/resources文件夹中的schema.sql文件。在SpringBoot2.0发布后,此功能不再起作用。我在文档中找不到有关此更改的任何信息。这是我的application.properties文件内容:spring.datasource.url=...spring.datasource.username=...spring.datasource.password=...#spring.jpa.hibernate.ddl-auto=create-dropspring.jpa.