Re: As of Wicket 6.something, info messages now wiped out during redirect?

2017-03-26 Thread Trejkaz
On Mon, Mar 27, 2017 at 4:42 PM, Sebastien  wrote:
> Hi,
>
> Yes, the message is lost. For such a use case, you have to use
> Session.get().info(), so your message remains available after the redirect.

I see... so looking at the info() method itself, on v1.5, info() goes
into the session. But in v6, it goes into the component... which seems
like it would always be lost.

Is there some way to rewire such that info() still stores it in the session?

TX

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: As of Wicket 6.something, info messages now wiped out during redirect?

2017-03-26 Thread Sebastien
Hi,

Yes, the message is lost. For such a use case, you have to use
Session.get().info(), so your message remains available after the redirect.

Best regards,
Sebastien

On Mar 27, 2017 03:19, "Trejkaz"  wrote:

> Hi all.
>
> Next problem in the list. :(
>
> Most of our forms finish up their work like this:
>
> info("Successfully did something")
> setResponsePage(SomePage.class);
>
> And in the tests we check it like this:
>
> tester.assertRenderedPage(SomePage.class);
> tester.assertInfoMessages("Successfully did something");
>
> After updating to Wicket 6.26.0, this test now fails because there are
> supposedly no info messages.
> I tried 6.13.0 and got the same result there.
>
> Investigation:
> * This time the real application does exhibit the issue.
> * A breakpoint in the IFeedbackMessageFilter verifies that it does get
> called and that every single call returns false.
>
> At this point I can't figure out why the messages are being deleted so
> again, asking here whether we're doing something wrong, or whether
> this is a bug.
>
> Demo code here: https://github.com/trejkaz/wicket-feedback-problems
>
> TX
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


As of Wicket 6.something, info messages now wiped out during redirect?

2017-03-26 Thread Trejkaz
Hi all.

Next problem in the list. :(

Most of our forms finish up their work like this:

info("Successfully did something")
setResponsePage(SomePage.class);

And in the tests we check it like this:

tester.assertRenderedPage(SomePage.class);
tester.assertInfoMessages("Successfully did something");

After updating to Wicket 6.26.0, this test now fails because there are
supposedly no info messages.
I tried 6.13.0 and got the same result there.

Investigation:
* This time the real application does exhibit the issue.
* A breakpoint in the IFeedbackMessageFilter verifies that it does get
called and that every single call returns false.

At this point I can't figure out why the messages are being deleted so
again, asking here whether we're doing something wrong, or whether
this is a bug.

Demo code here: https://github.com/trejkaz/wicket-feedback-problems

TX

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: WicketMessage: Can't instantiate page using constructor 'public com.mycompany.StartPage()'. An exception has been thrown during construction!

2017-03-26 Thread Sokab
Thank You very much!! :)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketMessage-Can-t-instantiate-page-using-constructor-public-com-mycompany-StartPage-An-exception-h-tp4677445p4677447.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: WicketMessage: Can't instantiate page using constructor 'public com.mycompany.StartPage()'. An exception has been thrown during construction!

2017-03-26 Thread Sven Meier

Hi,

apparently your injection isn't set up correctly, thus managerLocal is null.

Please take a look how the CDI example does it in wicket-examples, e.g. 
the following is missing at least:


new CdiConfiguration().configure(this);

Have fun
Sven


On 26.03.2017 17:53, Sokab wrote:

Hi Everyone! I am new and I want to learn to Wicket. When I create new simple
project with Wicket everything is ok but when I try add EJB class to Wicket
(WebPage) always i have this same error:

"WicketMessage: Can't instantiate page using constructor 'public
com.mycompany.StartPage()'. An exception has been thrown during
construction!"

It is my Wicket class:

import javax.ejb.EJB;
import org.apache.wicket.markup.html.WebPage;
public class StartPage extends WebPage{
 @EJB
 PersonManagerLocal managerLocal;

 public StartPage() {
 managerLocal.addPerson();
 }
}
//***
EJB class:

@Stateless
public class PersonManager implements PersonManagerLocal{

 @Override
 public void addPerson() {
 System.out.println("HELLO I AM EJB");
 }
//***
Interface:
//@Local
public interface PersonManagerLocal {
 public void addPerson();
}
//***
WEB.xml:

http://xmlns.jcp.org/xml/ns/javaee;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd;
 version="3.1">
 
 
 30
 
 
 
 

 WicketSampleEterprise-war

org.apache.wicket.protocol.http.WicketFilter

 
 applicationClassName
 com.mycompany.WicketApplication
 
 

 
 WicketSampleEterprise-war
 /*
 

//***
Wicket initialization class:

public class WicketApplication extends WebApplication{

 @Override
 public Class getHomePage()
 {
 return StartPage.class;
 }
 
 @Override

 protected void init(){
 super.init();
 }
}

I use: Netbeans 8.2, Wicket 7, EJB3.1, wildfly 10
Maybe someone knows what's wrong? Thank you for any advice.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketMessage-Can-t-instantiate-page-using-constructor-public-com-mycompany-StartPage-An-exception-h-tp4677445.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





WicketMessage: Can't instantiate page using constructor 'public com.mycompany.StartPage()'. An exception has been thrown during construction!

2017-03-26 Thread Sokab
Hi Everyone! I am new and I want to learn to Wicket. When I create new simple
project with Wicket everything is ok but when I try add EJB class to Wicket
(WebPage) always i have this same error:

"WicketMessage: Can't instantiate page using constructor 'public
com.mycompany.StartPage()'. An exception has been thrown during
construction!"

It is my Wicket class:

import javax.ejb.EJB;
import org.apache.wicket.markup.html.WebPage;
public class StartPage extends WebPage{
@EJB
PersonManagerLocal managerLocal;

public StartPage() {
managerLocal.addPerson();
}
}
//***
EJB class:

@Stateless
public class PersonManager implements PersonManagerLocal{

@Override
public void addPerson() {
System.out.println("HELLO I AM EJB");
}
//***
Interface:
//@Local
public interface PersonManagerLocal {
public void addPerson();
}
//***
WEB.xml:

http://xmlns.jcp.org/xml/ns/javaee;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd;
 version="3.1">


30




WicketSampleEterprise-war
   
org.apache.wicket.protocol.http.WicketFilter

applicationClassName
com.mycompany.WicketApplication




WicketSampleEterprise-war
/*


//***
Wicket initialization class:

public class WicketApplication extends WebApplication{

@Override
public Class getHomePage() 
{
return StartPage.class;
}

@Override
protected void init(){
super.init();
}
}

I use: Netbeans 8.2, Wicket 7, EJB3.1, wildfly 10
Maybe someone knows what's wrong? Thank you for any advice.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketMessage-Can-t-instantiate-page-using-constructor-public-com-mycompany-StartPage-An-exception-h-tp4677445.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org