Mule Cloud Connector does not compile with Mule Devkit 3.4 and JDK7

I built my own cloud connector with Mule 3.3.0 and JDK7, and everything works fine. When upgrading to Mule 3.4.0, I ran into a problem with passing parameters to @Processor functions List .

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

This compiles fine, but it

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

produces 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 1.6, this works fine. I tried using the maven-compiler-plugin, but to no avail.

+4
source share
2 answers

This is a well-known DevKit limitation: now you must use JDK6 to compile your project.

I'm not sure that you can view the JIRA for him: http://www.mulesoft.org/jira/browse/DEVKIT-261 , but if so, please vote!

+4
source

I managed to get this to work on OS X using mish-mash from various versions of the Mule components, including devkit 3.4.3. This can lead to problems for other people, but I was able to successfully create, package, and deploy the Anypoint connector using the Mule 3.4.0 CE and JDK ™ 7 runtimes with the pom declarations below.

This worked for both the current version of Anypoint Studio and 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> 
+1
source

Source: https://habr.com/ru/post/1482210/


All Articles