Thanks Igor!

That helped me.

I wrote this in our internal documentation and I'm including it in case
someone searches for this problem:

A change which is normally done in the conf file catalina.policy is needed.
Ubuntu prefers to split that file into different parts and merge it before
starting the service. If we would edit catalina.policy our changes would be
lost next time the server starts and would never come in effect as that's
when the file is read. Instead we edit
"/etc/tomcat5.5/policy.d/04webapps.policy" and add the following three lines
to it at the end (webcarrot is the web project directory name):

grant codeBase "file:/var/lib/tomcat5.5/webapps/webcarrot/-" {
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};

On Mon, Jan 19, 2009 at 9:43 PM, Igor Vaynberg <[email protected]>wrote:

> you have to disable the security manager that your servlet container
> is using because it is blocking wicket's reflection calls.
>
> -igor
>
> On Mon, Jan 19, 2009 at 12:30 PM, Kent Larsson 
> <[email protected]<https://mail.google.com/mail?view=cm&tf=0&[email protected]>>
> wrote:
> > Hi,
> >
> > I've tried to solve this for several hours now, without success, but then
> > again I'm not that experienced. :-)
> >
> > I have an application with Spring beans which I want to use from Wicket,
> > using @SpringBean. To see that Spring works fine I've tried using my bean
> > without the @SpringBean annotation. By having
> >
> >    @Override
> >    protected void init() {
> >        super.init();
> >        ctx = new
> ClassPathXmlApplicationContext("applicationContext.xml");
> >    }
> >
> >    public UserRegistrationService getUserRegistrationService() {
> >        return (UserRegistrationService) BeanFactoryUtils.beanOfType(ctx,
> > UserRegistrationService.class);
> >    }
> >
> > In my class which extends WebApplication (my Application class). It works
> > fine that way! So it must have something to do with how I try to use the
> > @SpringBean annotation.
> >
> > First I have
> >
> >    @Override
> >    protected void init() {
> >        super.init();
> >        addComponentInstantiationListener(new
> > SpringComponentInjector(this));
> >    }
> >
> > In my Application class and in my web.xml I have added
> >
> >    <context-param>
> >        <param-name>contextConfigLocation</param-name>
> >        <param-value>classpath:applicationContext.xml</param-value>
> >    </context-param>
> >
> >    <listener>
> >
> >
> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
> >    </listener>
> >
> > and in my Page where I try to use the UserRegistrationService I have
> >
> >    @SpringBean
> >    UserRegistrationService userRegistrationService;
> >
> >    /**
> >     * Constructor...
> >     */
> >    public UserRegistrationPage(final PageParameters parameters) {
> >        add(new Label("message",
> > userRegistrationService.takeSomeString("hello service") ));
> >    }
> >
> > But when I try this I get
> >
> > " WicketMessage: Can't instantiate page using constructor public
> >
> net.mycompany.webcarrot.presentation.pages.UserRegistrationPage(org.apache.wicket.PageParameters)
> > and argument "
> >
> > I have a complete stack trace at pastebin (to not pollute the mail with
> it)
> > http://pastebin.com/f7c12d56c
> >
> > I hope someone more experienced with Wicket than me knows what's going on
> > here. I've tried to solve it for a couple of hours, but I can't find any
> > faults in it (I'm trying to follow the instructions in Wicket in Action).
> >
> > Thank you for your time reading! Any help is HIGHLY appreciated! Have a
> nice
> > day!
> >
> > Best regards, Kent
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> [email protected]<https://mail.google.com/mail?view=cm&tf=0&[email protected]>
> For additional commands, e-mail: 
> [email protected]<https://mail.google.com/mail?view=cm&tf=0&[email protected]>
>
>

Reply via email to