Not sure if this  helps or not but you cannot use the Spring

<context:annotation-config />

markup in your GAE Spring applications ...

This will of course work locally but because the
CommonAnnotationBeanPostProcessor attempts to load
javax.annotation.Resource (and fails) then no annotation processing
will occur ...

there are 2 workarounds to this:

1) use the init-method="..." attribute of the <bean ... /> element

or ...

2) directly load the appropriate annotation processing beans like so:


        <bean
class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"
 /
>

        <bean
class="org.springframework.context.annotation.ConfigurationClassPostProcessor" /
>

        <bean
class="org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor">
                <property name="initAnnotationType"
value="javax.annotation.PostConstruct" />
                <property name="destroyAnnotationType"
value="javax.annotation.PreDestroy" />
        </bean>

This avoids the attempt to load the @Resource class ...



On Jan 22, 2:21 am, Vijay Bansal <vijaybansal3...@gmail.com> wrote:
> This is of some help to those who are trying for CXF-RS apps on 
> GAEhttp://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-eng...
>
> On Jan 14, 12:43 am, "Jason (Google)" <apija...@google.com> wrote:
>
>
>
> > Hi Ralf. We may be able to add support for this annotation in a forthcoming
> > release. Please star the issue in your post if you want to be notified of
> > any status changes.
>
> > - Jason
>
> > On Sat, Jan 2, 2010 at 3:27 AM, Ralf Sigmund <ralf.sigm...@gmail.com> wrote:
> > > Hi,
> > > i am a newbie to App Engine. So I tried to do some of my Spring
> > > 3.0.0.RELEASE demo stuff.
>
> > > When using my favourite JAX-RS Implementation (Apache CXF 2.3.0-
> > > SNAPSHOT) I ran into the following Problem:
>
> > > CXF uses @Resource Annotations for Declarative Dependency Injection.
>
> > > But javax.annotation.Resource is not on the Whitelist.
> > > Only
>
> > > javax.annotation.Generated
> > > javax.annotation.PostConstruct
> > > javax.annotation.PreDestroy
>
> > > can be found on
> > >http://code.google.com/intl/de-DE/appengine/docs/java/jrewhitelist.html
> > > .
>
> > > Consequentely I get the StackTrace: java.lang.NoClassDefFoundError:
> > > javax.annotation.Resource is a restricted class. Please see the
> > > Google  App Engine developer's guide for more details.
>
> > > Well - I did not find a clear explanation what is wrong with @Resource
> > > and why it is excluded from the Whitelist.
>
> > > There is also an issue
> > >http://code.google.com/p/googleappengine/issues/detail?id=2564
> > > on this topic. But without any comment.
>
> > > Maybe there is a simple explanation / workaround to this situation and
> > > some kind soul could respond?
>
> > > Best Regards
> > > Ralf
>
> > > --
>
> > > You received this message because you are subscribed to the Google Groups
> > > "Google App Engine for Java" group.
> > > To post to this group, send email to
> > > google-appengine-j...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2b­unsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.- Hide quoted 
> > >text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to