JIBX:从 Maven Codegen 插件生成的类:没有元素的解组器

2024-03-02

我使用 Jibx CodeGen maven 插件从 xsd 文件生成 java 源和绑定。 我想在同一应用程序中维护多个版本的 xsd,因此我计划根据 XSD 的版本生成不同的目标包。

JBix 似乎根据 xsd 文件的名称空间生成 java 包。

IE。对于命名空间http://www.example.jibx.org/generated/v30/types它生成包org.jibx.example.generated.v30.types

在 Maven 构建代码生成期间似乎可以工作并生成绑定文件,但在绑定阶段,它表示验证失败:

maven日志样本

Generating code for mapping org.jibx.example.generated.v30.bar.Bar
Generating code for mapping org.jibx.example.generated.v30.bar.SpecificBar
Generating code for mapping org.jibx.example.generated.v30.foo.Foo
Generating code for mapping org.jibx.example.generated.v30.foo.SpecificFoo
Generating code for mapping org.jibx.example.generated.v30.generic.Generic
Generating code for mapping org.jibx.example.generated.v31.bar.Bar
Generating code for mapping org.jibx.example.generated.v31.bar.SpecificBar
Generating code for mapping org.jibx.example.generated.v31.foo.Foo
Generating code for mapping org.jibx.example.generated.v31.foo.SpecificFoo
Generating code for mapping org.jibx.example.generated.v31.generic.Generic

Wrote 16 files

 org.jibx.example.generated.v30.bar.Bar output file size is 4365 bytes
Verification failure on class org.jibx.example.generated.v30.bar.Bar:
  VERIFIED_REJECTED
Repository.lookup() failed. FILE NOT FOUND?

 Found 10 methods:
  void marshal
  void JiBX_binding_v30_marshal_1_0
  org.jibx.example.generated.v30.bar.Bar JiBX_binding_v30_newinstance_1_0
  org.jibx.example.generated.v30.bar.Bar JiBX_binding_v30_unmarshal_1_0
  java.lang.String JiBX_getName
  void setSpecific
  org.jibx.example.generated.v30.bar.SpecificBar getSpecific
  void setGeneric
  org.jibx.example.generated.v30.generic.Generic getGeneric
  void unmarshal

 org.jibx.example.generated.v30.bar.SpecificBar output file size is 2056 bytes
Verification failure on class org.jibx.example.generated.v30.bar.SpecificBar:
  VERIFIED_REJECTED
Repository.lookup() failed. FILE NOT FOUND?

 Found 6 methods:
  java.lang.String getLabel
  void JiBX_binding_v30_marshal_1_0
  boolean JiBX_binding_v30_test_1_0
  org.jibx.example.generated.v30.bar.SpecificBar JiBX_binding_v30_newinstance_1_0
  org.jibx.example.generated.v30.bar.SpecificBar JiBX_binding_v30_unmarshal_1_0
  void setLabel

 org.jibx.example.generated.v30.foo.Foo output file size is 4365 bytes
Verification failure on class org.jibx.example.generated.v30.foo.Foo:
  VERIFIED_REJECTED
Repository.lookup() failed. FILE NOT FOUND?

pom.xml

<properties>
    <junit.version>4.11</junit.version>
    <jibx.version>1.2.4.3</jibx.version>
    <jibx.codegen.version>1.2.4.3</jibx.codegen.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <build-helper-maven-plugin.version>1.9.1</build-helper-maven-plugin.version>
</properties>
<repositories>
    <repository>
        <id>sonatype</id>
        <name>Sonatype Groups</name>
        <url>https://oss.sonatype.org/content/groups/public/</url>
    </repository>
</repositories>
<build>
    <pluginManagement>
        <plugins>
            <!-- ### Target JDK 1.6 ### -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
    <plugins>
        <!-- #### Cleaning up generated sources #### -->
        <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.6.1</version>
            <configuration>
                <filesets>
                    <fileset>
                        <directory>src-generated/src</directory>
                        <includes>
                            <include>**/*</include>
                        </includes>
                        <followSymlinks>false</followSymlinks>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.jibx</groupId>
            <artifactId>maven-jibx-plugin</artifactId>
            <version>${jibx.codegen.version}</version>
            <configuration>
                <schemaLocation>src/main/config</schemaLocation>
                <schemaBindingDirectory>src-generated/src</schemaBindingDirectory>
                <baseBindingDirectory>src-generated/src</baseBindingDirectory>
                <targetDirectory>src-generated/src</targetDirectory>
            </configuration>
            <executions>
                <execution>
                    <!-- ### Generation of binding for versions 3.0 of XSD ### -->
                    <id>generate-java-code-from-schema-3.0</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>schema-codegen</goal>
                    </goals>
                    <configuration>
                        <schemaLocation>src/main/config</schemaLocation>
                        <schemaBindingDirectory>src-generated/src</schemaBindingDirectory>
                        <baseBindingDirectory>src-generated/src</baseBindingDirectory>
                        <targetDirectory>src-generated/src</targetDirectory>
                        <includeSchemas>
                            <includeSchema>types-3.0.xsd</includeSchema>
                            <includeSchema>generic-3.0.xsd</includeSchema>
                            <includeSchema>foo-3.0.xsd</includeSchema>
                            <includeSchema>bar-3.0.xsd</includeSchema>
                        </includeSchemas>
                        <options>
                            <binding-file-name>binding-v30.xml</binding-file-name>
                        </options>
                    </configuration>
                </execution>
                <execution>
                    <id>generate-java-code-from-schema-3.1</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>schema-codegen</goal>
                    </goals>
                    <configuration>
                        <schemaLocation>src/main/config</schemaLocation>
                        <schemaBindingDirectory>src-generated/src</schemaBindingDirectory>
                        <baseBindingDirectory>src-generated/src</baseBindingDirectory>
                        <targetDirectory>src-generated/src</targetDirectory>
                        <includeSchemas>
                            <includeSchema>types-3.1.xsd</includeSchema>
                            <includeSchema>generic-3.1.xsd</includeSchema>
                            <includeSchema>foo-3.1.xsd</includeSchema>
                            <includeSchema>bar-3.1.xsd</includeSchema>
                        </includeSchemas>
                        <options>
                            <binding-file-name>binding-v31.xml</binding-file-name>
                        </options>
                    </configuration>
                </execution>
                <execution>
                    <id>compile-binding</id>
                    <phase>process-classes</phase>
                    <goals>
                        <goal>bind</goal>
                    </goals>
                    <configuration>
                        <includes>
                            <include>binding-v30.xml</include>
                            <include>binding-v31.xml</include>
                        </includes>
                        <load>true</load>
                        <validate>true</validate>
                        <verbose>true</verbose>
                        <verify>true</verify>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>${build-helper-maven-plugin.version}</version>
            <executions>
                <execution>
                    <id>add-source</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>add-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>src-generated/src</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

foo-3.0.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    targetNamespace="http://www.example.jibx.org/generated/v30/foo"
    xmlns="http://www.example.jibx.org/generated/v30/foo" 
    xmlns:dgr="http://www.example.jibx.org/generated/v30/generic" 
    xmlns:tdr="http://www.example.jibx.org/generated/v30/types"
    elementFormDefault="unqualified" attributeFormDefault="unqualified">
    <xs:import namespace="http://www.example.jibx.org/generated/v30/generic"
        schemaLocation="generic-3.0.xsd" />
    <xs:import namespace="http://www.example.jibx.org/generated/v30/types"
        schemaLocation="types-3.0.xsd" />
    <xs:element name="foo">
        <xs:complexType>
            <xs:annotation>
                <xs:documentation><![CDATA[ Documentation with french accentuation : éàç]]></xs:documentation>
            </xs:annotation>
            <xs:sequence>
                <xs:element name="generic" type="dgr:generic" />
                <xs:element name="specific" type="specificFoo" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="specificFoo">
        <xs:sequence>
            <xs:element name="label" type="label">
             <xs:annotation>
              <xs:documentation>Label for Foo</xs:documentation>
               </xs:annotation>
            </xs:element>
            <xs:element name="dateFoo" type="tdr:dateDDMMYYYY" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>Date of Foo</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <xs:simpleType name="label">
        <xs:restriction base="xs:string">
            <xs:minLength value="2" />
            <xs:maxLength value="255" />
        </xs:restriction>
    </xs:simpleType> 
</xs:schema>

通用-3.0.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.example.jibx.org/generated/v30/generic"
    xmlns="http://www.example.jibx.org/generated/v30/generic"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:tdr="http://www.example.jibx.org/generated/v30/types" elementFormDefault="unqualified"
    attributeFormDefault="unqualified">
    <xs:import namespace="http://www.example.jibx.org/generated/v30/types"
        schemaLocation="types-3.0.xsd" />
    <xs:complexType name="generic">
        <xs:annotation>
            <xs:documentation>Generic data</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="type" type="tdr:typeCode">
                <xs:annotation>
                    <xs:documentation>Type for code</xs:documentation>
                </xs:annotation>
            </xs:element>        
            <xs:element name="isValid" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>Flag that tells generic data is valid</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>     
</xs:schema>

类型-3.0.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tdr="http://www.example.jibx.org/generated/v30/types"
    targetNamespace="http://www.example.jibx.org/generated/v30/types" elementFormDefault="unqualified"
    attributeFormDefault="unqualified">
    <xs:simpleType name="text">
        <xs:annotation>
            <xs:documentation>Text</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string" />
    </xs:simpleType>
    <xs:simpleType name="typeCode">
        <xs:annotation>
            <xs:documentation>Text</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string" />
    </xs:simpleType>
    <xs:simpleType name="dateDDMMYYYY">
        <xs:annotation>
            <xs:documentation>Date au with format : DD/MM/YYYY</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:length value="10" />
            <xs:pattern value="[0-3][0-9]/[0-1][0-9]/(19|20)[0-9]{2}" />
        </xs:restriction>
    </xs:simpleType>     
</xs:schema>

这是生成的绑定(binding-v30.xml)

<binding xmlns:ns1="http://www.example.jibx.org/generated/v30/bar" xmlns:ns2="http://www.example.jibx.org/generated/v30/foo" xmlns:dgr="http://www.example.jibx.org/generated/v30/generic" name="binding_v30" package="org.jibx.example.generated.v30" trim-whitespace="true">
  <namespace uri="http://www.example.jibx.org/generated/v30/bar" prefix="ns1"/>
  <namespace uri="http://www.example.jibx.org/generated/v30/foo" prefix="ns2"/>
  <mapping class="org.jibx.example.generated.v30.bar.Bar" name="bar" ns="http://www.example.jibx.org/generated/v30/bar">
    <structure map-as="dgr:generic" get-method="getGeneric" set-method="setGeneric" name="generic"/>
    <structure map-as="ns1:specificBar" get-method="getSpecific" set-method="setSpecific" name="specific"/>
  </mapping>
  <mapping abstract="true" type-name="ns1:specificBar" class="org.jibx.example.generated.v30.bar.SpecificBar">
    <value style="element" name="label" get-method="getLabel" set-method="setLabel"/>
  </mapping>
  <mapping class="org.jibx.example.generated.v30.foo.Foo" name="foo" ns="http://www.example.jibx.org/generated/v30/foo">
    <structure map-as="dgr:generic" get-method="getGeneric" set-method="setGeneric" name="generic"/>
    <structure map-as="ns2:specificFoo" get-method="getSpecific" set-method="setSpecific" name="specific"/>
  </mapping>
  <mapping abstract="true" type-name="ns2:specificFoo" class="org.jibx.example.generated.v30.foo.SpecificFoo">
    <value style="element" name="label" get-method="getLabel" set-method="setLabel"/>
    <value style="element" name="dateFoo" get-method="getDateFoo" set-method="setDateFoo" usage="optional"/>
  </mapping>
  <mapping abstract="true" type-name="dgr:generic" class="org.jibx.example.generated.v30.generic.Generic">
    <value style="element" name="type" get-method="getType" set-method="setType"/>
    <value style="element" name="isValid" get-method="isIsValid" set-method="setIsValid"/>
  </mapping>
</binding>

我编写了一个 Junit 测试,以确保 jibx 可以实例化我的绑定对象的工厂并针对它解组 xml 文件。

Junit 单元测试:FooTest.java

@Test
public void testFoo1()
{  
    IBindingFactory foo30Factory = null;
    try
    {
        foo30Factory = BindingDirectory.getFactory("binding_v30", Foo.class);
    }
    catch (JiBXException e)
    {
        String l_msg = "Cannot create factory ";
        LOGGER.error(l_msg, e);
        Assert.fail(l_msg + e.getMessage());
    }

    IUnmarshallingContext unmarshmallingContext = null;
    try
    {
        unmarshmallingContext = foo30Factory.createUnmarshallingContext();
    }
    catch (JiBXException e)
    {
        String l_msg = "Cannot create unmarshmalling context ";
        LOGGER.error(l_msg, e);
        Assert.fail(l_msg + e.getMessage());
    }

    String l_xmlFileToTest = "/xml/foo1.xml";
    LOGGER.info("Loading file : " + l_xmlFileToTest);
    InputStream in = this.getClass().getResourceAsStream(l_xmlFileToTest);
    BufferedReader buffer = new BufferedReader(new InputStreamReader(in));
    Foo l_fooObtained = null;
    try
    {
        l_fooObtained = (Foo) unmarshmallingContext.unmarshalDocument(buffer);
    }
    catch (JiBXException e)
    {
        String l_msg = "Cannot instanciate object for class " + Foo.class;
        LOGGER.error(l_msg, e);
        Assert.fail(l_msg + e.getMessage());
    }

    Assert.assertNotNull("l_coeaObtenu ne doit pas etre null", l_fooObtained);
    }

foo1.xml

<?xml version="1.0" encoding="UTF-8" ?>
    <foo>
        <generic>
            <type>12345</type>
            <isValid>1</isValid>
        </generic>
        <specific>
            <label>Label example</label>
            <dateFoo>01/01/2015</dateFoo>
        </specific>
    </foo>

当我运行它时,我得到了这个堆栈跟踪:No unmarshaller for element "generic"

ERROR FooTest - Cannot instanciate object for class class org.jibx.example.generated.v30.foo.Foo
org.jibx.runtime.JiBXException: No unmarshaller for element "generic" (line 5, col 14)
        at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2754)
        at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2914)
        at org.jibx.example.generated.v30.bar.FooTest.testFoo1(FooTest.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Marc,

查看 JiBX 模式库中的示例以了解

Opentravel 模式库 http://jibx.org/schema-library/site.html#opentravel.org

这与您的问题非常相似许多具有相同名称空间的模式需要绑定到不同的java包。

另外,我建议您使用较新版本的 JiBX,例如 1.2.6

Cheers!

Don

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

JIBX:从 Maven Codegen 插件生成的类:没有元素的解组器 的相关文章

  • SAML 服务提供商 Spring Security

    当使用预先配置的服务提供者元数据时 在 Spring Security 中 是否应该有 2 个用于扩展元数据委托的 bean 定义 一份用于 IDP 元数据 一份用于 SP 元数据
  • org.apache.sling.api.resource,version=[2.3,3) -- 无法解析

    您好 我无法访问我的项目内容 我已经上传了从 CQ 访问内容所需的所有包 我唯一能看到的是 org apache sling api resource version 2 3 3 无法解析 这是否是异常的原因 如果是 请告诉我如何解决 中Q
  • OpenCV 中的 Gabor 内核参数

    我必须在我的应用程序中使用 Gabor 过滤器 但我不知道这个 OpenCV 方法参数值 我想对虹膜进行编码 启动 Gabor 过滤器并获取特征 我想对 12 组 Gabor 参数值执行此操作 然后我想计算 Hamming Dystans
  • Android在排序列表时忽略大小写

    我有一个名为路径的列表 我目前正在使用以下代码对字符串进行排序 java util Collections sort path 这工作正常 它对我的 列表进行排序 但是它以不同的方式处理第一个字母的情况 即它用大写字母对列表进行排序 然后用
  • java中如何连接字符串

    这是我的字符串连接代码 StringSecret java public class StringSecret public static void main String args String s new String abc s co
  • 运行具有外部依赖项的 Scala 脚本

    我在 Users joe scala lib 下有以下 jar commons codec 1 4 jar httpclient 4 1 1 jar httpcore 4 1 jar commons logging 1 1 1 jar ht
  • 按第一列排序二维数组,然后按第二列排序

    int arrs 1 100 11 22 1 11 2 12 Arrays sort arrs a b gt a 0 b 0 上面的数组已排序为 1 100 1 11 2 12 11 22 我希望它们按以下方式排序a 0 b 0 首先 如果
  • 当从服务类中调用时,Spring @Transactional 不适用于带注释的方法

    在下面的代码中 当方法内部 是从内部调用的方法外部 应该在交易范围内 但事实并非如此 但当方法内部 直接从调用我的控制器class 它受到事务的约束 有什么解释吗 这是控制器类 Controller public class MyContr
  • Java 8 流 - 合并共享相同 ID 的对象集合

    我有一系列发票 class Invoice int month BigDecimal amount 我想合并这些发票 这样我每个月都会收到一张发票 金额是本月发票金额的总和 例如 invoice 1 month 1 amount 1000
  • 自动生成/删除詹金斯工作

    我正在寻找一种自动创建一组詹金斯作业的方法 通常在创建新的 git 分支之后 我已经为maven尝试过这个插件 http evgeny goldin com wiki Maven jenkins plugin http evgeny gol
  • Javafx过滤表视图

    我正在尝试使用文本字段来过滤表视图 我想要一个文本字段 txtSearch 来搜索 nhs 号码 名字 姓氏 和 分类类别 我尝试过在线实施各种解决方案 但没有运气 我对这一切仍然很陌生 所以如果问得不好 我深表歉意 任何帮助将不胜感激 我
  • 有没有一种快速方法可以从 Jar/war 中删除文件,而无需提取 jar 并重新创建它?

    所以我需要从 jar war 文件中删除一个文件 我希望有类似 jar d myjar jar file I donot need txt 的内容 但现在我能看到从 Linux 命令行执行此操作的唯一方法 不使用 WinRAR Winzip
  • 多模块项目的 Maven 阶段顺序?

    对不起 我是 Maven 的菜鸟 这是我的maven项目目录 project pom xml moduleA moduleB sub moduleA sub moduleB sub moduleC moduleC 当然 每个模块和子模块内都
  • 如何知道抛出了哪个异常

    我正在对我们的代码库进行审查 有很多这样的陈述 try doSomething catch Exception e 但我想要一种方法来知道 doSomething 抛出了哪个异常 在 doSomething 的实现中没有 throw 语句
  • 在 Spring 中重构这个的最佳方法?

    private final ExecutorService executorParsers Executors newFixedThreadPool 10 public void parse List
  • 我可以创建自定义 java.* 包吗?

    我可以创建一个与预定义包同名的自己的包吗在Java中 比如java lang 如果是这样 结果会怎样 这难道不能让我访问该包的受保护的成员 如果不是 是什么阻止我这样做 No java lang被禁止 安全管理器不允许 自定义 类java
  • 将 Azure AD 高级自定义角色与 Spring Security 结合使用以进行基于角色的访问

    我创建了一个演示 Spring Boot 应用程序 我想在其中使用 AD 身份验证和授权 并使用 AD 和 Spring Security 查看 Azure 文档 我执行了以下操作 package com myapp contactdb c
  • Java中的Object类是什么?

    什么是或什么类型private Object obj Object http download oracle com javase 6 docs api java lang Object html是Java继承层次结构中每个类的最终祖先 从
  • 为什么C++代码执行速度比java慢?

    我最近用 Java 编写了一个计算密集型算法 然后将其翻译为 C 令我惊讶的是 C 的执行速度要慢得多 我现在已经编写了一个更短的 Java 测试程序和一个相应的 C 程序 见下文 我的原始代码具有大量数组访问功能 测试代码也是如此 C 的
  • 如何在Eclipse Oxygen 1a Release (4.7.1a)中使用maven与Java9.0.1和pom打包?

    下面给出的 Maven 项目示例显示错误模块信息 java在日食氧气中 log4j api cannot be resolved to a module 如果我删除该行

随机推荐