我想创建一个简单的webapp
关于数据库,我想
所以我创建了一个maven项目:
的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.my.tracker</groupId>
<artifactId>tracker-webapp</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<hibernate.version>4.3.8.Final</hibernate.version>
<h2.version>1.4.185</h2.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
</configuration>
</plugin>
<!-- Set a compiler level -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Servlet API -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- JPA Provider (Hibernate) -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!-- Database …Run Code Online (Sandbox Code Playgroud) 我正在使用 Jacob 在软件中调用 VBA COM 接口。我需要调用一个具有输出参数的 Sub,该输出参数不是规范类型(int、String 等),而是该软件附带的 .tlb 中声明的一些专用接口。这里是
Sub GetMaterialOnBody (Body iBody, Material oMaterial)
Run Code Online (Sandbox Code Playgroud)
因此,我在调用中尝试了许多输出参数材料的声明和初始化,我收到各种错误,并且似乎找不到正确的方法。
Variant material = new Variant (null, false);
Dispatch.invoke(materialManager.getDispatch(), "GetMaterialOnBody", Dispatch.Method, new Object[] {hybridBody, material}, new int[1]);
Run Code Online (Sandbox Code Playgroud)
但得到了
com.jacob.com.ComFailException: A COM exception has been encountered:
At Invoke of: GetMaterialOnBody
Description: Type mismatch.
Run Code Online (Sandbox Code Playgroud)
然后我尝试在材质上调用 .getDispatch()
Variant material = new Variant (null, false);
Dispatch.invoke(materialManager.getDispatch(), "GetMaterialOnBody", Dispatch.Method, new Object[] {hybridBody, material.getDispatch()}, new int[1]);
Run Code Online (Sandbox Code Playgroud)
但得到了
java.lang.IllegalStateException: getDispatch() only legal on Variants of type VariantDispatch, not …Run Code Online (Sandbox Code Playgroud)