Support Migration Notice: To update migrated JIRA cases click here to open a new case use www.vmware.com/go/sr | vFabric Hyperic 5.7.0 is Now Available

Hyperic HQ

Agent plugins are being built with JDK 1.6.0_21 when they should still being built with 1.5 compatible version.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 4.5, 4.5.2.1
  • Fix Version/s: 4.x
  • Component/s: Plugins
  • Environment:
    Saw it on linux - ubuntu, customer sees it on redhat
  • Case Links:
    none
  • Regression:
    No
  • Tags:

Description

After investigation into an issue with another plugin, it appears the plugins are being compiled with JDK1.6.0_21. Even though the pom.xml specifies a different configuration.
I have checked the manifests for the plugins since moving to Hyperic 4.5, they are all compiled with 1.6.0_21. This is a problem, since we tell customers that they should be able to run with 1.5.

It appears the JDK1.5 maven configuration is not be used when building.

Issue Links

Activity

Hide
Greg Turnquist added a comment -

It appears the only way to properly compile something against an older version, we need to specify the bootclasspath with rt.jar. It is the only way to guarantee link compatibility.

Show
Greg Turnquist added a comment - It appears the only way to properly compile something against an older version, we need to specify the bootclasspath with rt.jar. It is the only way to guarantee link compatibility.
Hide
Ryan Morgan added a comment -

Doing some digging into the generated classes shows that our plugin classes are being correctly targeted for java 1.5.

~/hyperic/hq-4.5/hq/hq-plugin/jboss-plugin/target/classes/org/hyperic/hq/plugin/jboss(4.5.2.x) $ javap -verbose MBeanUtil | grep version
minor version: 0
major version: 49

Major version 49 is Java 1.5.

Greg is also correct in that specifying target and version will not catch API violations at compile time. Since we have a pretty strict requirement on the agent and plugins maybe we should investigate adding the Animal Sniffer maven plugin.

http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

Show
Ryan Morgan added a comment - Doing some digging into the generated classes shows that our plugin classes are being correctly targeted for java 1.5. ~/hyperic/hq-4.5/hq/hq-plugin/jboss-plugin/target/classes/org/hyperic/hq/plugin/jboss(4.5.2.x) $ javap -verbose MBeanUtil | grep version minor version: 0 major version: 49 Major version 49 is Java 1.5. Greg is also correct in that specifying target and version will not catch API violations at compile time. Since we have a pretty strict requirement on the agent and plugins maybe we should investigate adding the Animal Sniffer maven plugin. http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
Hide
Greg Turnquist added a comment -

rt.jar is kind of tricky to put into the build process. For example, on mac osx, it isn't called rt.jar. Instead, it is called classes.jar. I could experiment with using one rt.jar file (java 5) and trying to build from multiple platforms.

Show
Greg Turnquist added a comment - rt.jar is kind of tricky to put into the build process. For example, on mac osx, it isn't called rt.jar. Instead, it is called classes.jar. I could experiment with using one rt.jar file (java 5) and trying to build from multiple platforms.
Hide
Greg Turnquist added a comment -

Setting <source> and <target> to 1.5 and also setting <compilerArguments><bootclasspath>rt1_5.jar</bootclasspath></compilerArguments> seems to work. It appears that rt.jar is just class files, so it should be cross platform compatible. I need to confirm this on linux.

Show
Greg Turnquist added a comment - Setting <source> and <target> to 1.5 and also setting <compilerArguments><bootclasspath>rt1_5.jar</bootclasspath></compilerArguments> seems to work. It appears that rt.jar is just class files, so it should be cross platform compatible. I need to confirm this on linux.
Hide
Greg Turnquist added a comment -

I was able to get things to build using the <bootclasspath> settings combined with rt.jar, javaee.jar, and jsse.jar (versions from 1.5).

Show
Greg Turnquist added a comment - I was able to get things to build using the <bootclasspath> settings combined with rt.jar, javaee.jar, and jsse.jar (versions from 1.5).
Hide
Greg Turnquist added a comment -

Tried using this setting:

<plugin>
			    <groupId>org.codehaus.mojo</groupId>
			    <artifactId>animal-sniffer-maven-plugin</artifactId>
			    <version>1.6</version>
			    <configuration>
			        <signature>
			            <groupId>org.codehaus.mojo.signature</groupId>
			            <artifactId>java15</artifactId>
			            <version>1.0</version>
			        </signature>
			    </configuration>
			    <executions>
			        <execution>
			            <id>animal-sniffer</id>
			            <phase>verify</phase>
			            <goals>
			                <goal>check</goal>
			            </goals>
			        </execution>
			    </executions>
			</plugin>

Found it works perfectly. Created a method that used a Java 6 Properties API, and it was detected causing a failure in the mvn build cycle. Applying it to all pom.xml files that have source 1.5 declared.

Show
Greg Turnquist added a comment - Tried using this setting:
<plugin>
			    <groupId>org.codehaus.mojo</groupId>
			    <artifactId>animal-sniffer-maven-plugin</artifactId>
			    <version>1.6</version>
			    <configuration>
			        <signature>
			            <groupId>org.codehaus.mojo.signature</groupId>
			            <artifactId>java15</artifactId>
			            <version>1.0</version>
			        </signature>
			    </configuration>
			    <executions>
			        <execution>
			            <id>animal-sniffer</id>
			            <phase>verify</phase>
			            <goals>
			                <goal>check</goal>
			            </goals>
			        </execution>
			    </executions>
			</plugin>
Found it works perfectly. Created a method that used a Java 6 Properties API, and it was detected causing a failure in the mvn build cycle. Applying it to all pom.xml files that have source 1.5 declared.
Hide
Greg Turnquist added a comment -

Implemented this in all the agent-side code. This works during maven's verify phase, which precedes the install phase. mvn compile won't cause this to occur, nor will it interfere with any automated testing, but it will prevent an artifact from being built without adhering to Java 5 APIs. vim-plugin, vsphere-plugin, and websphere-plugin had to be excluded since they are somehow violating the Java 5 requirement. It is possible that this is in 3rd party libraries. The output is inadequate to pin down where the exact violation occurs, but it doesn't appear to be our own code, since this would have caused an error message inside STS, being linked to Java 1.5 JRE libraries.

Show
Greg Turnquist added a comment - Implemented this in all the agent-side code. This works during maven's verify phase, which precedes the install phase. mvn compile won't cause this to occur, nor will it interfere with any automated testing, but it will prevent an artifact from being built without adhering to Java 5 APIs. vim-plugin, vsphere-plugin, and websphere-plugin had to be excluded since they are somehow violating the Java 5 requirement. It is possible that this is in 3rd party libraries. The output is inadequate to pin down where the exact violation occurs, but it doesn't appear to be our own code, since this would have caused an error message inside STS, being linked to Java 1.5 JRE libraries.
Hide
Greg Turnquist added a comment -

I have pushed this work to origin under the branch name "HHQ-5190". It is branched off of master, so should be easy to merge into master.

Show
Greg Turnquist added a comment - I have pushed this work to origin under the branch name "HHQ-5190". It is branched off of master, so should be easy to merge into master.
Hide
Greg Turnquist added a comment -

Linked to this ticket is one that was opened to track the issues of not being to use the animal-sniffer-maven-plugin in vim-plugin, vsphere-plugin, and websphere-plugin.

Show
Greg Turnquist added a comment - Linked to this ticket is one that was opened to track the issues of not being to use the animal-sniffer-maven-plugin in vim-plugin, vsphere-plugin, and websphere-plugin.
Hide
Greg Turnquist added a comment -

This code has been pushed to a branch on origin. It should be ready for merging into master.

Show
Greg Turnquist added a comment - This code has been pushed to a branch on origin. It should be ready for merging into master.
Hide
Yoav Epelman added a comment -

Bulk change to new components

Show
Yoav Epelman added a comment - Bulk change to new components

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved:
    Last comment:
    1 year, 9 weeks, 1 day ago