Hi Daniel.
I tried your suggestion with no luck. The same exception kept coming up.
The issue seems to be when calling the "init()" method on the proxy.

On the other hand, I was able to make it work by adding
<aop:aspectj-autoproxy proxy-target-class="true"/> to the
configuration (a suggestion I found after hours of googling around,
and which I hadn't seen much). I leave interpretations to you as I'm
not very confident on what goes on inside spring/cxf guts.

Do you still want me to upload a test code for this?, I may try to
find some time out to create a mock project if you consider it useful.
Best regards and thanks for your and Ron's help .


2011/1/3 Juan Pedro Silva Gallino (UPM) <[email protected]>
>
> Daniel, thank you very much for your answer.
> I'll give your suggestion a try first thing tomorrow.
> Tying this application to CXF wouldn't be an issue, so I'm open to use 
> anything that might work.
>
> I'm getting the feeling that this might come from Tomcat mixing different 
> versions of Spring or CXF dependencies. I don't have different versions in my 
> POM, but it wouldn't be the first time that copying the exact same code to a 
> new tomcat/eclipse workspace fixes the problem.
>
> Regards,
>               Juan Pedro
>
> 2011/1/3 Daniel Kulp <[email protected]>
>>
>> On Monday 03 January 2011 1:25:26 pm Juan Pedro Silva Gallino (UPM) wrote:
>> > I was only able to trace it up to
>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(), which is called with the
>> > a reference to the proper method (the init() method in the service)
>> > and aorg.springframework.aop.framework.JdkDynamicAopProxyas the object
>> > on which to invoke it. Afterwards, it goes into the native
>> > invoke0() method and throws the exception.
>>
>> Honestly, I have no idea.   Is there a way you can create a simple test case
>> with a modified hello world or similar?
>>
>> You could probably work around it by just not injecting it and doing:
>>
>> WebServiceContext context = new
>> org.apache.cxf.jaxws.context.WebServiceContextImpl();
>>
>> (note: no @Resource or anything)
>>
>> That would tie the implementation to CXF, but that may not be a huge issue 
>> for
>> you.
>>
>>
>> Dan
>>
>>
>> >
>> > Any ideas?.
>> > Thanks again.
>> >
>> >
>> >
>> > 2011/1/3 Ron Wheeler <[email protected]>
>> >
>> > > On 03/01/2011 7:10 AM, Juan Pedro Silva Gallino (UPM) wrote:
>> > >> Ron, I really appreciate your answer.
>> > >> With my comment I only meant to ask if you were aware that newer
>> > >> versions solved the issue, and by it being rhetorical I meant that I
>> > >> should try things before asking that much. I hope you took no offense
>> > >> on my comments
>> > >>
>> > >> :-) .
>> > >
>> > > Not at all.
>> > >
>> > >  Again, any perspective from outside helps seeing things more clearly,
>> > >  and
>> > >
>> > >> thanks to you I updated to a newer version of the CXF  framework
>> > >> (2.2.12) while keeping the rest untouch. Besides having to enforce the
>> > >> use of some saaj version, I ran into no other complications, so I thank
>> > >> you for this, as
>> > >> your suggestion might have avoided a lot of bugs.
>> > >>
>> > >>  Sorry that it didn't fix the problem.
>> > >
>> > >  Regarding the error, it is still there. Again, it only happens when
>> > >  adding
>> > >
>> > >> "global-method-security" to the equation.
>> > >> I get an "IllegalArgumentException: Object is not an instance of
>> > >> declaring class" after the invocation of
>> > >> org.apache.cxf.common.injection.ResourceInjector.invokePostConstruct(),
>> > >> both
>> > >> with and without the setter method for the @Resource WebServiceContext.
>> > >>
>> > >> Any ideas, anybody?, I can't seem to find any related info on the Web.
>> > >> Thanks everybody for your help.
>> > >> Regards,
>> > >>
>> > >>              Juan Pedro
>> > >>
>> > >> 2011/1/3 Ron Wheeler<[email protected]>
>> > >>
>> > >>  On 02/01/2011 2:18 PM, Juan Pedro Silva Gallino (UPM) wrote:
>> > >>>  Hi Ron, thanks for your answer.
>> > >>>
>> > >>>> Regarding the version in use, well, this is sort of a legacy code into
>> > >>>> which
>> > >>>> I'm adding new authorization functionality, so I was trying to get
>> > >>>> away without changing versions just to avoid adding another grade of
>> > >>>> uncertainty
>> > >>>> from where new errors might come from. Just that.
>> > >>>>
>> > >>>> Even more, I've never found in the different posts on the topic any
>> > >>>> reference to a bug or a functionality that was to be added in future
>> > >>>> versions, so I assumed that there was a particular way in which to do
>> > >>>> things
>> > >>>> to make it work that I was not aware of, not that this was a problem
>> > >>>> that
>> > >>>> had been addressed in newer versions.
>> > >>>>
>> > >>>> With that said, I may upgrade to newer versions of the CXF framework.
>> > >>>> However, will just doing this solve the WebServiceContext injection
>> > >>>> issue?,
>> > >>>> I don't get that clearly from your answer and I didn't find anything
>> > >>>> online
>> > >>>> that would lead me to have such an impression. Anyhow, it is sort of a
>> > >>>> rhetorical question, I'll try this first thing in the morning.
>> > >>>>
>> > >>>>  It was only a general comment that should be easy to test and if it
>> > >>>>
>> > >>>> works
>> > >>>
>> > >>> might lead to a more complete explanation and a workaround for the old
>> > >>> version.
>> > >>> It also keeps the discussion active which is sometimes helpful on
>> > >>> weekends
>> > >>> and holidays when the real experts may be otherwise occupied and not
>> > >>> see your question.
>> > >>>
>> > >>>
>> > >>> Ron
>> > >>>
>> > >>>  Thanks again,
>> > >>>
>> > >>>>                      Juan Pedro
>> > >>>>
>> > >>>> 2011/1/1 Ron Wheeler<[email protected]>
>> > >>>>
>> > >>>>  On 28/12/2010 5:37 PM, Juan Pedro Silva Gallino (UPM) wrote:
>> > >>>>>  Hi, I've been trying to wire my WSS4J interceptors into Spring
>> > >>>>>
>> > >>>>> security,
>> > >>>>>
>> > >>>>>> which I was able to do following Freeman's suggestions.
>> > >>>>>> However, I'm facing the (whats looks to be a) common problem with
>> > >>>>>> WebServiceContext when trying to enable method security.
>> > >>>>>>
>> > >>>>>> Before adding the global-method-security line everything works well.
>> > >>>>>> When I add it, I get an IllegalArgumentException which complaints
>> > >>>>>> that it
>> > >>>>>> cannot set the WebServiceContext field to a "$Proxy131" (sorry, I'm
>> > >>>>>> not
>> > >>>>>> able
>> > >>>>>> to copy the stack trace from here).
>> > >>>>>>
>> > >>>>>> I found some posts on the subject, mostly answered by Sergei and
>> > >>>>>> jax-RS
>> > >>>>>> related. I learned thatthe issue is related to spring AOP and to
>> > >>>>>> CGLIB proxies and suggesting to add a setter in the service
>> > >>>>>> interface to solve
>> > >>>>>> te
>> > >>>>>> issue. However, I added a setWebServiceContext(WebServiceContext
>> > >>>>>> wsc) to
>> > >>>>>> the
>> > >>>>>> service interface, and still have no luck, it fails with identical
>> > >>>>>> exception
>> > >>>>>> and message.
>> > >>>>>>
>> > >>>>>> I'm using CXF 2.1.1, Spring 2.5, Spring-ws 1.5.9 and Spring-security
>> > >>>>>> 2.0.5.RELEASE.
>> > >>>>>>
>> > >>>>>>  Any reason why you are using such old versions?
>> > >>>>>
>> > >>>>> I would try to upgrade to newer versions before chasing bugs
>> > >>>>>
>> > >>>>> Ron
>> > >>>>>
>> > >>>>>  Which steps should I take to be able to use method security?
>> > >>>>>
>> > >>>>>  Thanks again for all the help.
>>
>> --
>> Daniel Kulp
>> [email protected]
>> http://dankulp.com/blog
>

Reply via email to