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