Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] broken resources?

Now that *is* odd.  It's a very low level failure... (native method).
Are you weaving xerces.jar itself? (ie. is xerces.jar on the inpath?).
If not, what's on the stack leading up to the call to  
AbstractStackParser.parse() ?

On 16/08/05, Torsten Curdt <tcurdt@xxxxxxxxxx> wrote:
> I am trying to come up with a logging aspect.
> But somehow my aspect breaks the code.
> It is running just fine without it.
> 
> It's very strange ...I am getting a
> 
> java.io.IOException: Bad file descriptor
>          at java.io.FileInputStream.read(Native Method)
>          at org.apache.xerces.impl.XMLEntityManager
> $RewindableInputStream.read(Unknown Source)
>          at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity
> (Unknown Source)
>          at
> org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
> Source)
>          at org.apache.xerces.parsers.XML11Configuration.parse
> (Unknown Source)
>          at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
> Source)
>          at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>          at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
> 
> when parsing a xml configuration file read
> via getResourceAsInputStream() when the aspect
> is applied.
> 
> Can anyone spot a problem in this little aspect?
> 
> cheers
> --
> Torsten
> 
> ----
> import org.aspectj.lang.JoinPoint;
> import org.aspectj.lang.Signature;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> 
> public aspect LogAspect
> {
>      declare precedence : LogAspect, *;
> 
>      private Log getLog(final Signature pSignature) {
>          return LogFactory.getLog(pSignature.getDeclaringType());
>      }
> 
>      pointcut returnCalls() :
>          !within(LogAspect) &&
>          (
>            execution(* org.whatever..*(..))
>            || execution(* org.whatever..*())
>          ) && (
>            (execution(public static * *.*(..)) && !execution(public
> static void *.*(..)))
>            || (execution(public static * *.*()) && !execution(public
> static void *.*()))
>            || (execution(public * *.*(..)) && !execution(public void
> *.*(..)))
>            || (execution(public * *.*()) && !execution(public void *.*
> ()))
>          );
> 
>      pointcut voidCalls() :
>          !within(LogAspect) &&
>          (
>            execution(* org.whatever..*(..))
>            || execution(* org.whatever..*())
>          ) && (
>            execution(public static void *.*(..))
>            || execution(public static void *.*())
>            || execution(public void *.*(..))
>            || execution(public void *.*())
>            || execution(new(..))
>            || execution(new())
>          );
> 
>      after() throwing(Throwable pThrowable) : voidCalls() ||
> returnCalls()
>      {
>      }
> 
>      Object around() : voidCalls()
>      {
>          final Object result = proceed();
>          return result;
>      }
> 
>      Object around() : returnCalls()
>      {
>          final Object result = proceed();
>          return proceed();
>      }
> }
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> 
> 
> 


-- 
-- Adrian
adrian.colyer@xxxxxxxxx


Back to the top