Java JAXB";“未知位置”;使用目录时

Java JAXB";“未知位置”;使用目录时,java,xsd,jaxb,Java,Xsd,Jaxb,当引用导入模式中的类型时,我在使用JAXB2.2生成Java类时遇到困难。我相信目录是用来完成我想要的 我有两个XSD文件: ProductsCommonTypes.xsd 不确定这是否重要,但Eclipse会正确验证所有文件 我的两个XSD文件都已添加到EclipseXML目录中,使用名称空间名称作为键类型,使用名称空间作为键类型 是什么导致输出中出现未知位置消息?配置似乎工作正常。上面是真正的XSD吗?无论如何,是否存在一些错误?是否尝试使用-d命令指定提取文件的位置?例如:C:\JAVA

当引用导入模式中的类型时,我在使用JAXB2.2生成Java类时遇到困难。我相信目录是用来完成我想要的

我有两个XSD文件:


ProductsCommonTypes.xsd 不确定这是否重要,但Eclipse会正确验证所有文件

我的两个XSD文件都已添加到EclipseXML目录中,使用名称空间名称作为键类型,使用名称空间作为键类型


是什么导致输出中出现未知位置消息?

配置似乎工作正常。上面是真正的XSD吗?无论如何,是否存在一些错误?是否尝试使用-d命令指定提取文件的位置?例如:C:\JAVA\u HOME\bin>xjc-d C:\directory\Path\Outside\JavaHome(例如在桌面上)yourAwesome.xsd我遇到了类似的问题,解决方案是使用命令“-d”并在JAVA\u HOME外部创建一个名为“generated”的文件夹。有关更多信息,请查看
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/ProductsCommonTypes"
   xmlns="http://www.example.com/ProductsCommonTypes" elementFormDefault="qualified">
   <xs:simpleType name="nonEmptyString">
      <xs:annotation>
         <xs:documentation>A type that will require a non-empty string value be present
         </xs:documentation>
      </xs:annotation>
      <xs:restriction base="xs:string">
         <xs:pattern value="(\s*[^\s]\s*)+"></xs:pattern>
      </xs:restriction>
   </xs:simpleType>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:p="http://www.example.com/Products"
   targetNamespace="http://www.example.com/Products" xmlns:common="http://www.example.com/ProductsCommonTypes"
   elementFormDefault="qualified">
   <xs:import schemaLocation="http://www.example.com/ProductsCommonTypes" namespace="http://www.example.com/ProductsCommonTypes"/>
   <xs:element name="products">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="name" type="common:nonEmptyString" minOccurs="1" maxOccurs="unbounded"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>
<!DOCTYPE catalog
    PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
           "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    <public publicId="http://www.example.com/ProductsCommonTypes" uri="ProductsCommonTypes.xsd"/>
</catalog>
parsing a schema...
compiling a schema...
[INFO] generating code
unknown location

com\example\xml\products\ObjectFactory.java
com\example\xml\products\Products.java
com\example\xml\products\package-info.java