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
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
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.
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.