4

I built a custom cloud connector with Mule 3.3.0 and JDK7, and everything was working fine. When updating to Mule 3.4.0 I ran into an issue with passing @Processor functions List parameters.

@Processor
public String myProcessor(String content)
{
    return content;
}

This compiles fine, but this

@Processor
public String myProcessor(List<String> content)
{
    return "content";
}

throws the following error:

[ERROR] Failed to execute goal org.mule.tools.devkit:mule-devkit-maven-plugin:3.4.0:generate-sources (default-generate-sources) on project enterprise-message-adapter: java.lang.InstantiationError: com.sun.tools.javac.util.Name$Table -> [Help 1]

If I change my JAVA_HOME to point at 1.6 this works fine. I've tried using the maven-compiler-plugin, but to no avail.

4

2 回答 2

4

这是 DevKit 的一个众所周知的限制:现在您必须使用 JDK6 来编译您的项目。

我不确定您是否可以查看 JIRA:http: //www.mulesoft.org/jira/browse/DEVKIT-261但如果可以,请投票!

于 2013-05-22T16:36:53.563 回答
1

我能够使用不同 Mule 组件版本(包括 devkit 3.4.3)的混搭使其在 OS X 上运行。这可能会给其他人带来问题,但我能够使用 Mule 3.4.0 CE 运行时和 JDK™ 7 以及下面列出的 pom 声明成功地创建、打包和部署 Anypoint 连接器。

这适用于当前版本的 Anypoint Studio 和 Maven。

<dependencies>
  <dependency>
    <artifactId>core</artifactId>
    <groupId>org.osgi</groupId>
    <version>[4.3.0]</version>
    <scope>provided</scope>
  </dependency>
  <dependency>
    <artifactId>eclipse-runtime</artifactId>
    <groupId>org.eclipse</groupId>
    <version>[3.6.0.v20100505]</version>
    <scope>provided</scope>
  </dependency>
  <dependency>
    <artifactId>dom4j</artifactId>
    <groupId>dom4j</groupId>
    <version>1.6.1</version>
  </dependency>
  <dependency>
    <groupId>org.mule.common</groupId>
    <artifactId>mule-common</artifactId>
    <version>3.4.2</version>
    <scope>provided</scope>
  </dependency>
  <dependency>
    <groupId>org.mule.modules</groupId>
    <artifactId>mule-module-devkit-support</artifactId>
    <version>3.4.3-SNAPSHOT</version>
  </dependency>
  <dependency>
    <groupId>org.mule.tools.devkit</groupId>
    <artifactId>mule-devkit-annotations</artifactId>
    <version>3.4.3</version>
  </dependency>
  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
    <version>3.2.1.RELEASE</version>
  </dependency>
  <dependency>
    <groupId>org.mule.modules</groupId>
    <artifactId>mule-module-spring-config</artifactId>
    <version>3.4.0</version>
  </dependency>
  <dependency>
    <groupId>eclipse</groupId>
    <artifactId>eclipse-runtime</artifactId>
    <version>2.1.0</version>
    <scope>provided</scope>
  </dependency>
  <dependency>
    <artifactId>eclipse-workbench</artifactId>
    <groupId>org.eclipse</groupId>
    <version>[3.6.1.M20100826-1330]</version>
    <scope>provided</scope>
  </dependency>
</dependencies>
<repositories>
  <repository>
    <id>mulesoft-releases</id>
    <name>MuleSoft Releases Repository</name>
    <url>http://repository.mulesoft.org/releases/</url>
    <layout>default</layout>
  </repository>
  <repository>
    <id>mulesoft-snapshots</id>
    <name>MuleSoft Snapshots Repository</name>
    <url>http://repository.mulesoft.org/snapshots/</url>
    <layout>default</layout>
  </repository>
</repositories>
<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.mule.tools.devkit</groupId>
        <artifactId>mule-devkit-maven-plugin</artifactId>
        <version>3.4.3</version>
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <groupId>org.eclipse.m2e</groupId>
        <artifactId>lifecycle-mapping</artifactId>
        <version>1.0.0</version>
        <configuration>
          <lifecycleMappingMetadata>
            <pluginExecutions>
              <pluginExecution>
                <pluginExecutionFilter>
                  <groupId>org.mule.tools.devkit</groupId>
                  <artifactId>mule-devkit-maven-plugin</artifactId>
                  <versionRange>[2.0,)</versionRange>
                  <goals>
                    <goal>attach-test-resources</goal>
                    <goal>filter-resources</goal>
                    <goal>generate-sources</goal>
                  </goals>
                </pluginExecutionFilter>
                <action>
                  <ignore />
                </action>
              </pluginExecution>
            </pluginExecutions>
          </lifecycleMappingMetadata>
        </configuration>
      </plugin>
    </plugins>
  </pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>2.5</version>
      <executions>
        <execution>
          <id>default-compile</id>
          <configuration>
            <compilerArgument>-proc:none</compilerArgument>
            <source>1.7</source>
            <target>1.7</target>
          </configuration>
        </execution>
        <execution>
          <id>default-testCompile</id>
          <configuration>
            <compilerArgument>-proc:none</compilerArgument>
            <source>1.7</source>
            <target>1.7</target>
          </configuration>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <groupId>org.mule.tools.devkit</groupId>
      <artifactId>mule-devkit-maven-plugin</artifactId>
      <version>3.4.3</version>
    </plugin>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-enforcer-plugin</artifactId>
      <version>1.0-alpha-4</version>
      <executions>
        <execution>
          <id>enforce-maven-version</id>
          <goals>
            <goal>enforce</goal>
          </goals>
          <configuration>
            <rules>
              <requireMavenVersion>
                <version>[3.0.0,)</version>
              </requireMavenVersion>
              <requireJavaVersion>
                <version>[1.6.0,)</version>
              </requireJavaVersion>
            </rules>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
于 2014-07-25T13:21:36.710 回答