Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » Duplicate Name and Signature( java.lang.ClassFormatError: Duplicate field name&signature in class file )
Duplicate Name and Signature [message #1090119] Mon, 19 August 2013 18:38 Go to next message
Milan Shrestha is currently offline Milan ShresthaFriend
Messages: 5
Registered: July 2013
Junior Member
I am getting
"java.lang.ClassFormatError: Duplicate field name&signature in class file "
error while trying to compile and run a aspect in my web project through Maven. However, it works fine if I compile and run through eclipse IDE using ADJT. I am using AspectJ 1.7.0.

My Pom.xml has been configured as below:
<build>
<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<executions>
					<execution>
						<!-- Modifying output directory of default compile because non-weaved 
							classes must be stored in separate folder to not confuse ajc by reweaving 
							already woven classes (which leads to to ajc error message like "bad weaverState.Kind: 
							-115") -->
						<id>default-compile</id>
						<configuration>
							<compilerArguments>
								<d>WebContent/unwoven-classes</d>
							</compilerArguments>
						</configuration>
					</execution>
				</executions>
			</plugin>


			<!-- AspectJ plugin -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>aspectj-maven-plugin</artifactId>
				<version>1.4</version>
				<configuration>
					<showWeaveInfo>true</showWeaveInfo>
					<complianceLevel>1.6</complianceLevel>
					<source>1.6</source>
					<target>1.6</target>
					<weaveDirectories>
						<weaveDirectory>WebContent/unwoven-classes</weaveDirectory>
					</weaveDirectories>
					<sources>
						<source>
							<basedir>src</basedir>
							<includes>
								<include>**/QueryProfilerAspect.java</include>

							</includes>

						</source>
					</sources>

				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.aspectj</groupId>
						<artifactId>aspectjrt</artifactId>
						<version>${org.aspectj.version}</version>
					</dependency>
					<dependency>
						<groupId>org.aspectj</groupId>
						<artifactId>aspectjtools</artifactId>
						<version>${org.aspectj.version}</version>
						<scope>compile</scope>
					</dependency>
				</dependencies>

				<executions>
					<execution>
						<!-- Compile and weave aspects after all classes compiled by javac -->
						<phase>process-classes</phase>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>


	</build>



Any idea what may be going wrong in here?




Re: Duplicate Name and Signature [message #1090682 is a reply to message #1090119] Tue, 20 August 2013 13:50 Go to previous messageGo to next message
Milan Shrestha is currently offline Milan ShresthaFriend
Messages: 5
Registered: July 2013
Junior Member
Resolved the issue. Seems like 1.4 has some problems I changed it to 1.2 and its working now.
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.2</version>
Re: Duplicate Name and Signature [message #1772775 is a reply to message #1090682] Fri, 15 September 2017 06:49 Go to previous message
Eclipse UserFriend
Make sure to clean recompile the class having the error. Whatever flags you can set: Make it more clean and more forced, until it works.
Previous Topic:Java Application Launch Defaults
Next Topic:Facing Issues while importing a jar file to a OSB project in Ecilpse
Goto Forum:
  


Current Time: Thu Apr 25 22:20:42 GMT 2024

Powered by FUDForum. Page generated in 0.02728 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top