Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Weid problem with javax.naming.InitialContext

No, it is not a bug - it is an enhancement request.  We have not
allowed weaving of those types to prevent users causing themself harm
by accidentally weaving java.lang.String or somesuch - so it was
designed this way.  However, enough people want it as an enhancement
that I have added an option to enable people to cause themselves harm
:)

-Xset is for temporary things that may get promoted to real options if
they prove worthy.

Andy.

On 23/01/2008, Hermod Opstvedt <hermod@xxxxxxxxxxxx> wrote:
> So it IS a bug!?
>
> I'll download latest dev build and check.
>
> Hermod
>
> -----Opprinnelig melding-----
> Fra: aspectj-users-bounces@xxxxxxxxxxx
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] På vegne av Andy Clement
> Sendt: 23. januar 2008 18:18
> Til: aspectj-users@xxxxxxxxxxx
> Emne: Re: [aspectj-users] Weid problem with javax.naming.InitialContext
>
> I think you are possibly being affected by the code we have that prevents
> LTW of anything beginning java.* or javax.* :)  See this bugzilla entry from
> a while back
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=149261 : "Allow weaving
> javax..* types"
>
> In which case, you need to download a recent dev build of AspectJ from the
> downloads page and use the option:
>
> <weaver options="-Xset:weaveJavaxPackages=true"/>
>
> Andy.
>
> On 23/01/2008, hermod.opstvedt@xxxxxxxxx <hermod.opstvedt@xxxxxxxxx> wrote:
> >
> >
> >
> > Hi
> >
> > This really has me stomped. I am absolutely unable to loadtime weave
> > the InitialContext class. The exact syntax is applied to 2 different
> > classes - one works and the other does not. I do not see anyt weaving
> > output that states that it is weaving anything within the javax.naming
> > package
> >
> > Hermod
> >
> > Below is the verification test
> >
> > aop.xml:
> > <aspectj>
> >         <weaver
> >                 options="-proceedOnError
> > -Xlintfile:META-INF/Xlint.properties -showWeaveInfo -verbose -debug">
> >                 <include within="com.ibm.websphere.naming..*" />
> >                 <include
> > within="com.ibm.ws.naming.util.WsnInitCtx+" />
> >                 <include within="javax.naming..*" />
> >                 <include within="com.acme.test..*" />
> >         <aspects>
> >                 <aspect
> > name="com.acme.aspect.NamingServiceAspect" />
> >         </aspects>
> > </aspectj>
> >
> > package com.acme.aspect;
> > public aspect NamingServiceAspect {
> >
> >         pointcut initialContextInit() : call(*
> > javax.naming.InitialContext+.init(..));
> >
> >         void around() : initialContextInit()
> >         {
> >                 System.out.println("In around initialContextInit");
> >                 proceed();
> >         }
> >
> >         pointcut testDoit() : call(*
> > no.dnbnor.it01.aspects.test.Test+.doIt(..));
> >
> >         void around() : testDoit()
> >         {
> >                 System.out.println("In around testDoit");
> >                 proceed();
> >         }
> > }
> >
> > And a test class:
> >
> > package com.acme.test;
> > public class Test {
> >
> >         public static void main(String[] args) throws Exception {
> >                 Hashtable env = new Hashtable();
> >                 env.put(Context.INITIAL_CONTEXT_FACTORY,
> >
> > "com.ibm.websphere.naming.WsnInitialContextFactory");
> >                 env
> >                                 .put(Context.PROVIDER_URL,
> >                                                 "iiop://localhost:2809");
> >                 Context initialContext = new InitialContext(env);
> >                 Test me=new Test();
> >                 me.doIt();
> >                 }
> >
> >         public void doIt()
> >         {
> >             System.out.println("In doIt");
> >         }
> > } * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> > * * *
> > *
> >
> > This email with attachments is solely for the use of the individual or
> > entity to whom it is addressed. Please also be aware that the DnB NOR
> > Group cannot accept any payment orders or other legally binding
> > correspondence with customers as a part of an email.
> >
> > This email message has been virus checked by the anti virus programs
> > used in the DnB NOR Group.
> >
> > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> > * * *
> >
> >
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
> >
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top