Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] issues using advice with a web service method call.

I'm a bit confused why the log messages refer to LogFormattingAspect
but your attached code and aop.xml talk about LogViewer - are they the
same thing? (did you do some renaming?)

I don't see any weave info messages in your output - that suggests
your pointcut did not match.  The clue may be in the warning:

> [GenericClassLoader@1a0fd6d] warning at com\app\test\aspect\log\LogFormattingAspect.java::0 no match for this type
> name: com.gcp.gdb.contact.v1.ContactObjectSoapHttpPortImpl [Xlint:invalidAbsoluteTypeName]

If you are expecting it to weave into

> [GenericClassLoader@1a0fd6d] debug weaving
> 'com.gcp.gdb.geoaddr.v1.GeographicAddressObjectSoapHttpPortImpl'

then it will be trying to load ContactObjectSoapHttpPortImpl (parent
of Geo*?) to determine the relationship with the Geographic* type.  Is
that type available on the classpath?

cheers,
Andy



On 14 November 2012 11:41, Smrutiranjan Samantara
<smruti.photo@xxxxxxxxx> wrote:
> Hi,
>  I am trying to use around advice for a particular webservice method. I have
> written a aspect class with advice with point cut.
> even I have written an aop.xml file specifying aspect and weaver elements.
> Kept this available to webservice's class path.
> while running I can see the message of weaving the calss, but not able to
> get the the message which I want to be printed during advice execution.
>
> My code is as follow
>
>
> /////////////aspect class///////////////////////
> public aspect LogViewer
> {
>     before(): execution(public *
> com.gcp.gdb.contact..ContactObjectSoapHttpPortImpl.*(..) ) //this is my web
> service call
>     {
>               System.err.println("About to call " +
> thisJoinPoint.getSignature().toShortString() + ", args:" +
> Arrays.toString(thisJoinPoint.getArgs()) );
>     }
>
>      Object around() : execution( *
> com.att.gcp.gdb.contact..ContactObjectSoapHttpPortImpl.echo(..))
>      {
>          final long startTimeMs = System.currentTimeMillis();
>          Object result = proceed();
>          final long endTimeMs = System.currentTimeMillis();
>          final long execTimeMs = endTimeMs - startTimeMs;
>          System.out.println(getClass().getName() + ": time taken is :"
> +execTimeMs );
>          return result;
>
>      }
>
> }
> ////////////////////aop.xml/////////////////////////
>
> <aspectj>
>
>     <aspects options="-verbose">
>
>         <aspect name="com.gcp.aspectj.LogViewer" />
>     </aspects>
>
>     <weaver options="-verbose, -showWeaveInfo">
>
>         <include within="com.gcp.gdb.contact.v1.*" />
>
>
>        <include within="com.gcp.aspectj.LogViewer"/>
>     </weaver>
>
> </aspectj>
>
>
> ///////////////////webservice console log//////
>
> [ChangeAwareClassLoader@129d101] debug weaving
> 'com.att.gcp.gdb.geoaddr.v1.GeographicAddressObjectSoapHttpPortImpl'
> [GenericClassLoader@1a0fd6d] info AspectJ Weaver Version 1.6.8 built on
> Friday Jan 8, 2010 at 21:53:37 GMT
> [GenericClassLoader@1a0fd6d] info register classloader
> weblogic.utils.classloaders.GenericClassLoader@1a0fd6d
> [GenericClassLoader@1a0fd6d] info using configuration
> C:/bea/user_projects/domains/aspectjtest/servers/AdminServer/tmp/.appmergegen_1352907090515/gcp_gdb.ear/yfkpbj/WEB-I
> NF/lib/gdbAspectLog.jar!/META-INF/aop.xml
> [GenericClassLoader@1a0fd6d] info register aspect
> com.app.test.aspect.log.LogFormattingAspect
> [GenericClassLoader@1a0fd6d] warning at
> com\app\test\aspect\log\LogFormattingAspect.java::0 no match for this type
> name: com.gcp.gdb.contact.v1.ContactObjectSoapHttpP
> ortImpl [Xlint:invalidAbsoluteTypeName]
> [GenericClassLoader@1a0fd6d] debug weaving
> 'com.gcp.gdb.geoaddr.v1.GeographicAddressObjectSoapHttpPortImpl'
>
>
>
>
>
> Thanks,
> Smrutiranjan
>
>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>


Back to the top