Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Maven aspectj plugin problem

I'm not sure why aspectj can't see the Log4J stuff, but the bigger question
is why are you trying to instantiate a Commons Logging Log4JLogger?  If you
are using Commons Logging, you shouldn't be directly manipulating specific
Log implementations (Log4J or otherwise).  Instead you should be calling
Commons Logging LogFactory.getLog method.

> -----Original Message-----
> From: aspectj-users-admin@xxxxxxxxxxx
> [mailto:aspectj-users-admin@xxxxxxxxxxx]On Behalf Of Cyrill Ruttimann
> Sent: Friday, September 17, 2004 5:57 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] Maven aspectj plugin problem
>
>
> Hi,
>
> I have a problem with the aspectj plugin for maven:
>
>
> project.xml
> -----------------------
>
> <dependencies>
>          <dependency>
>              <groupId>log4j</groupId>
>              <artifactId>log4j</artifactId>
>              <version>1.2.8</version>
>              <type>jar</type>
>              <url>http://logging.apache.org/log4j/docs/index.html</url>
>          </dependency>
>          <dependency>
>              <groupId>commons-logging</groupId>
>              <artifactId>commons-logging-api</artifactId>
>              <version>1.0.4</version>
>              <type>jar</type>
>              <url>http://jakarta.apache.org/commons/index.html</url>
>          </dependency>
>          <dependency>
>              <groupId>springframework</groupId>
>              <artifactId>spring</artifactId>
>              <version>1.1</version>
>              <type>jar</type>
>              <url>http://www.springframework.org</url>
>          </dependency>
>      </dependencies>
> <build>
>          <nagEmailAddress>xxx</nagEmailAddress>
>          <sourceDirectory>${basedir}/src/java</sourceDirectory>
>
> <unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory>
>
> <aspectSourceDirectory>${basedir}/src/aspect</aspectSourceDirectory>
>          <unitTest>
>              <includes>
>                  <include>**/*Test.java</include>
>              </includes>
>          </unitTest>
>      </build>
>
>
>
> maven.xml
> ----------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns:j="jelly:core" default="site:deploy">
>      <preGoal name="java:compile">
>          <attainGoal name="aspectj:compile" />
>          <attainGoal name="jar:install" />
>      </preGoal>
> </project>
>
>
>
> Output
> ---------------------
>
> arenal:~/Documents/eclipse/innovateit/AspectLogging cyrill$ maven
>   __  __
> |  \/  |__ _Apache__ ___
> | |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
> |_|  |_\__,_|\_/\___|_||_|  v. 1.0
>
> warning couldn't find aspectjrt.jar on classpath, checked:
>
> compiling
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/java/ch/
> innovate/tools/logging/ExceptionSender.java
>
> compiling
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj
>
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:12 error The import
> org.apache.commons.logging.impl.Log4JLogger cannot be resolved
> import org.apache.commons.logging.impl.Log4JLogger;
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:27 error Log4JLogger
> cannot be resolved (or is not a valid type) for the field
> LoggingAspect.exceptionlogger
> Log4JLogger exceptionlogger = new Log4JLogger("exception");
> ^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:27 error Log4JLogger
> cannot be resolved or is not a type
> Log4JLogger exceptionlogger = new Log4JLogger("exception");
>                                    ^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:28 error Log4JLogger
> cannot be resolved (or is not a valid type) for the field
> LoggingAspect.tracingLogger
> Log4JLogger tracingLogger = new Log4JLogger("tracing");
> ^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:28 error Log4JLogger
> cannot be resolved or is not a type
> Log4JLogger tracingLogger = new Log4JLogger("tracing");
>                                  ^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:38 error exceptionlogger
> cannot be resolved
> exceptionlogger.error(getMethodInformation(thisJoinPointStaticPart) + "
> - " + exception);
> ^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:46 error tracingLogger
> cannot be resolved
> tracingLogger.debug(
> ^^^^
> MessageHolder:  (2 info)  (1 warning)  (7 error)
> [error   0]: error at import
> org.apache.commons.logging.impl.Log4JLogger;
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:12:0 The import
> org.apache.commons.logging.impl.Log4JLogger cannot be resolved
> [error   1]: error at Log4JLogger exceptionlogger = new
> Log4JLogger("exception");
> ^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:27:0 Log4JLogger cannot
> be resolved (or is not a valid type) for the field
> LoggingAspect.exceptionlogger
> [error   2]: error at Log4JLogger exceptionlogger = new
> Log4JLogger("exception");
>                                    ^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:27:0 Log4JLogger cannot
> be resolved or is not a type
> [error   3]: error at Log4JLogger tracingLogger = new
> Log4JLogger("tracing");
> ^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:28:0 Log4JLogger cannot
> be resolved (or is not a valid type) for the field
> LoggingAspect.tracingLogger
> [error   4]: error at Log4JLogger tracingLogger = new
> Log4JLogger("tracing");
>                                  ^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:28:0 Log4JLogger cannot
> be resolved or is not a type
> [error   5]: error at
> exceptionlogger.error(getMethodInformation(thisJoinPointStaticPart) + "
> - " + exception);
> ^^^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:38:0 exceptionlogger
> cannot be resolved
> [error   6]: error at tracingLogger.debug(
> ^^^^
> /Users/cyrill/Documents/eclipse/innovateit/AspectLogging/src/aspect/ch/
> innovate/tools/logging/aspect/LoggingAspect.aj:46:0 tracingLogger
> cannot be resolved
>
>
> The Project just compiles without problems inside of Eclipse (AJDT). I
> have no glue why this happens.
>
> I have another Project with coding policies - I have no dependencies to
> other libraries. There, the aspectj plugin does the job.
>
>
> Anyone?
>
>
> Regards,
>
> Cyrill
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top