Vaadin with EJB module problem


While I am trying to run my vaadin project in combination with EJB module. I got this kind of problem (after deploy successfully to GlassFish 3.1) when I run the enterprise application project.

HTTP Status 500 -

type Exception report


descriptionThe server encountered an internal error () that prevented it from fulfilling this request.


javax.servlet.ServletException: Failed to load application class: com.example.vaadin.MyApplication
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.2 logs.

GlassFish Server Open Source Edition 3.1.2

Please kindly help.



Show your code that causes the error.

My suspicion: Vaadin JAR is loaded with a different classloader than the application and cannot find the application class by reflection.

If that is the case, you could either use a custom servlet class (subclass of AbstractApplicationServlet with two one-line methods creating the application instance explicitly, then update web.xml to point to your servlet) or somehow make the Vaadin JAR load with your application classloader.

What does the log say? It’s in glassfish3/glassfish/domains/domain1/logs probably.

I’ve had no trouble using EJBs in a Vaadin application. With GlassFish 3.X, you don’t even need an ear file – just put the EJBs in the app in your war file. Here’s
one fairly simple example
that injects EJBs into the Vaadin servlet to pass to the Vaadin application object.


Sorry that I have just came back to this post now. :slight_smile:

I have solved it by just having an EJB module and Web module without having an Enterprise application as an umbrella of my EJB and Web module.

That works fine for me till now.

Thanks everyone for your kind response.
Good luck all,