CDI Vaadin and inheritance problem

Hello i use Vaadin in jboss as7 and CDI

and i have got problem i define inheritance and i have got Servlet:



@SessionScoped
public class ShopWebServlet extends ShopMasterServlet
{

	private static final long serialVersionUID = 1L;
	private WebConf webConf;
	

	@EJB
	WebConfBeanRemoteHandler webConfBeanRemoteHandler;
	
	
	@Override
	public void init() {
	
		System.out.println("TEST EJB :D");
		webConf = new WebConf();
		webConf.setDefaultTitle("TEST APP	1");
		
		System.out.println("WEB CONF: " + webConf.toString());
		Label label  = new Label(webConfBeanRemoteHandler.getName("Luk"));

		webConfBeanRemoteHandler.insertWebConf(webConf);
		Window main = new Window("Main");
		main.addComponent(label);
		setMainWindow(main);
		
	}
	
}

and [quote]

public class VaadinAppServlet extends AbstractApplicationServlet {

private static final long serialVersionUID = 1L;

@Inject	Instance<ShopWebServlet> application;

@Override
protected Class<? extends Application> getApplicationClass() throws
		ClassNotFoundException {
	return ShopWebServlet.class;
}

@Override
protected Application getNewApplication(HttpServletRequest request) throws
		ServletException {
	ShopWebServlet app = application.get();
	
	return app;
}

}

[/quote]

and line:

webConfBeanRemoteHandler.insertWebConf(webConf); do his job fine
but if i try use this in ShopMasterServlet the same code its not working ??
so what i must change to use CDI in parent servlet (ShopMasterServlet)?? i think its problem with VaadinAppServlet but i not know how configure it :confused:

and my another problem is with widget i add add-on and before i have got in descriptor web.xml :

and its working wery well but i must change it (because i use CDI) into :

and i have got alert in browser:

i try to use init param :

but its not working :confused: (my widget compile i se it in console ) and i have got the same error in browser ? how can i configure my widget with CDI and use CDI with inheritance ??

Hi Lukas.

I see no actual mistakes in you application code that should keep it from working. If you’d add some stacktrace lines it would really help solving the issue.

The problem might be in ShopMasterServlet. It’s contents were not included in your post. Also noticed a slight naming issue with ShopWebServlet and ShopMasterServlet: You might want to name them ShopWebApplication and ShopMasterApplication since they should not be servlets but Vaadin Applications. I assume your current implementation of ShopMasterServlet still extends com.vaadin.Application. It should.

Make sure you have the (empty) beans.xml file in WebContent/WEB-INF directory.

To avoid further problems you should also kill the session in you application class after the application closes or else you’ll get the same application instance from VaadinAppServlet every time while the same session is active. Example in
http://dev.vaadin.com/browser/incubator/cdiutils/src/org/vaadin/virkki/cdiutils/application/AbstractCdiApplication.java

If you have a file called CustomWidgetSet.gwt.xml in package widget and a folder widget.CustomWidgetSet (the compiled widgetset) under WebContent/VAADIN/widgetsets/ then your widgetset init parameter is correctly set.

Tomi