You are missing some asm libraries as well. You should indeed rely
on Maven for your dependencies. But we've had the same problem, and
we excluded cglib, and included cglib-nodep.

<dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate</artifactId>
        <version>3.2.1.ga</version>
        <exclusions>
                <exclusion>
                        <groupId>cglib</groupId>
                        <artifactId>cglib</artifactId>
                </exclusion>
        </exclusions>
</dependency>

...

<dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.1_3-USE-CGLIB-NODEP</version>
</dependency>
<dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>2.1_3</version>
</dependency>

But I think that if you only rely on spring, then Maven will include
the correct libraries for you.

Bart.

> -----Oorspronkelijk bericht-----
> Van: Igor Vaynberg [mailto:[EMAIL PROTECTED]
> Verzonden: woensdag 20 februari 2008 23:02
> Aan: users@wicket.apache.org
> Onderwerp: Re: Spring injecting beans into non-component classes
>
> why dont you use maven to manage your dependencies? from cursory look
> you are missing asm which cglib depends on and wicket-ioc.jar
>
> -igor
>
>
> On Wed, Feb 20, 2008 at 7:51 AM, Warren
> <[EMAIL PROTECTED]> wrote:
> > I am getting an NoClassDefFoundError Exception when I try to use
> >  InjectorHolder.getInjector().inject(this);. I think I am
> missing a library
> >  or two of some sort.
> >
> >  java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Callback
> >
> >  I placed cglib, which has net.sf.cglib.proxy.Callback in
> it, in my classpath
> >  and then I started getting another NoClassDefFoundError Exception.
> >
> >  java.lang.NoClassDefFoundError: org/objectweb/asm/Type
> >
> >  I thought I had everything I needed.
> >
> >  wicket-1.3.0.jar
> >  wicket-spring-1.3.0.jar
> >  wicket-spring-annot-1.3.0.jar
> >  spring.jar
> >
> >  What other dependencies am I missing?
> >
> >
> >  > -----Original Message-----
> >  > From: Bart Molenkamp [mailto:[EMAIL PROTECTED]
> >
> >
> > > Sent: Tuesday, February 19, 2008 10:52 PM
> >  > To: users@wicket.apache.org
> >  > Subject: RE: Spring injecting beans into non-component classes
> >  >
> >  >
> >  > public abstract class AbstractInjectableModel implements IModel {
> >  >
> >  >  /**
> >  >   * Applies injection to this model instance.
> >  >   */
> >  >  public AbstractInjectableModel() {
> >  >    ConfigurableInjector injector = InjectorHolder.getInjector();
> >  >    injector.inject(this);
> >  >  }
> >  >
> >  >  ...
> >  > }
> >  >
> >  > It is indeed just InjectorHolder.getInjector().inject(this);
> >  > Nothing more.
> >  >
> >  > Bart.
> >  >
> >  > > -----Oorspronkelijk bericht-----
> >  > > Van: Warren [mailto:[EMAIL PROTECTED]
> >  > > Verzonden: dinsdag 19 februari 2008 18:16
> >  > > Aan: users@wicket.apache.org
> >  > > Onderwerp: RE: Spring injecting beans into
> non-component classes
> >  > >
> >  > > Thanks Igor, the InjectorHolder.getInjector().inject(this);
> >  > > is what I was
> >  > > looking for.
> >  > >
> >  > > Bart, Could you show me an example of your
> AbstractInjectableModel?
> >  > >
> >  > > Warren
> >  > >
> >  > > > -----Original Message-----
> >  > > > From: Bart Molenkamp [mailto:[EMAIL PROTECTED]
> >  > > > Sent: Tuesday, February 19, 2008 1:50 AM
> >  > > > To: users@wicket.apache.org
> >  > > > Subject: RE: Spring injecting beans into
> non-component classes
> >  > > >
> >  > > >
> >  > > > I created an AbstractInjectableModel for this. It
> does dependency
> >  > > > injection for models, the same way as in components.
> >  > > >
> >  > > > Would this be something for in the
> wicket-spring-annot project?
> >  > > >
> >  > > > Bart.
> >  > > >
> >  > > > > -----Oorspronkelijk bericht-----
> >  > > > > Van: Igor Vaynberg [mailto:[EMAIL PROTECTED]
> >  > > > > Verzonden: dinsdag 19 februari 2008 4:41
> >  > > > > Aan: users@wicket.apache.org
> >  > > > > Onderwerp: Re: Spring injecting beans into
> non-component classes
> >  > > > >
> >  > > > > add this to the constructor of the class you want injected:
> >  > > > > InjectorHolder.getInjector().inject(this);
> >  > > > >
> >  > > > > -igor
> >  > > > >
> >  > > > >
> >  > > > > On Feb 18, 2008 7:37 PM, Warren
> >  > > <[EMAIL PROTECTED]> wrote:
> >  > > > > > I am using Spring to manage my Services and
> DAOs. Is there
> >  > > > > a special Wicket
> >  > > > > > way of injecting my beans into non component
> classes? I've
> >  > > > > seen the example
> >  > > > > > in Kent Ka Iok Tong's book of extending
> SpringWebApplication:
> >  > > > > >
> >  > > > > > public class MyApp extends SpringWebApplication {
> >  > > > > > ...
> >  > > > > > @Override
> >  > > > > > protected void init() {
> >  > > > > > addComponentInstantiationListener(new
> >  > > > > SpringComponentInjector(this));
> >  > > > > > }
> >  > > > > > ...
> >  > > > > >
> >  > > > > > and then in my components:
> >  > > > > >
> >  > > > > > @SpringBean
> >  > > > > > private MyService myService;
> >  > > > > >
> >  > > > > > I am assuming that this will only work for
> components. I am
> >  > > > > currently
> >  > > > > > injecting my beans the following way thru the constructor
> >  > > > > of my classes:
> >  > > > > >
> >  > > > > > ...
> >  > > > > >
> >  > > > > > private MyService myService;
> >  > > > > >
> >  > > > > >         public MyClass()
> >  > > > > >         {
> >  > > > > >                 myService =
> >  > > > > >
> >  > >
> (MyService)SpringInit.getApplicationContext().getBean("myService");
> >  > > > > >         }
> >  > > > > >
> >  > > > > > Where SpringInit is my class that implements
> >  > > > > ServletContextListener. This
> >  > > > > > way works, but is there a special way of doing this in
> >  > > > > Wicket with the
> >  > > > > > @SpringBean annotation? Also, will the example at the top
> >  > > > > of the page work
> >  > > > > > within a model?
> >  > > > > >
> >  > > > > > Thanks,
> >  > > > > >
> >  > > > > > Warren Bell
> >  > > > > >
> >  > > > > >
> >  > > > > >
> >  > > > >
> >  > >
> ---------------------------------------------------------------------
> >  > > > > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> >  > > > > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >  > > > > >
> >  > > > > >
> >  > > > >
> >  > > > >
> >  > >
> ---------------------------------------------------------------------
> >  > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  > > > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >  > > > >
> >  > > > >
> >  > > >
> >  > > >
> >  > >
> ---------------------------------------------------------------------
> >  > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  > > > For additional commands, e-mail: [EMAIL PROTECTED]
> >  > > >
> >  > > >
> >  > >
> >  > >
> >  > >
> ---------------------------------------------------------------------
> >  > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  > > For additional commands, e-mail: [EMAIL PROTECTED]
> >  > >
> >  > >
> >  >
> >  >
> ---------------------------------------------------------------------
> >  > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  > For additional commands, e-mail: [EMAIL PROTECTED]
> >  >
> >  >
> >
> >
> >
> ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to