GlassFish v3 and EE Application

Hello. Vaadin doesn’t work with ee application.
Glassfish v3.1
NetBeans 7.1.2
Vaadin 6.8.2

I created Java EE Application and added simple web modue with vaadin application.
In runtime getting this exception.


ARNING: StandardWrapperValve[VaadinApplication]
: PWC1382: Allocate exception for servlet VaadinApplication
javax.servlet.ServletException: Failed to load application class: com.example.vaadin.MyApplication
	at com.vaadin.terminal.gwt.server.ApplicationServlet.init(ApplicationServlet.java:71)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1445)
	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1085)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:189)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
	at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
	at java.lang.Thread.run(Thread.java:722)

Is it bug in glassfish or ?

Vaadin should work just fine with Glassfish 3.1.

First check:
Are you able to deploy the same WAR successfully to some other server?

the same exception on IntelijIdea and Jboss AS7
But my friend working with no problem from maven project and GlassFish v3. Dunno why.

What i did.
1.Create EE app
2. Create vaadin app
3. Deploy

mb i need to do some special things ?

You’re running into a simple classpath issue, but the answer depends on what your app looks like. Did you create a .ear file or .war file? Maybe you could share the output of “jar tvf filename” as a help. The GlassFish user’s list might also be a help since this issue probably isn’t related specifically to Vaadin also.

For what it’s worth, I’ve been running Java EE applications with Vaadin for a long time and they work out just fine – it’s very nice to be able to extend Vaadin’s AbstractApplicationServlet and inject EJBs into it to pass on to the Application object(s).

Cheers,
Bobby

Yes i creating ear and war
mb i’m doing something wrong.
Here is screens, how i creating simple application

Screens

jar tvf app1.ear


bellski@bellskiPC:~/data/projects/app1/dist$ jar tvf app1.ear
     0 Thu Aug 23 12:15:50 MSK 2012 META-INF/
   103 Thu Aug 23 12:15:48 MSK 2012 META-INF/MANIFEST.MF
     0 Thu Aug 23 12:15:48 MSK 2012 lib/
  3909 Thu Aug 23 12:15:48 MSK 2012 app1-war.war
5018623 Thu Aug 23 12:15:48 MSK 2012 lib/vaadin-6.8.2.jar
bellski@bellskiPC:~/data/projects/app1/dist$ 

The .ear file looks ok from what I can see. What’s in the .war file inside there? Since you say you have a friend who has an example working, you should try comparing your pom.xml and file layout to his/hers – that could be faster than waiting on the forum.

For whatever it’s worth, if you only have the web module inside the ear file, then you really don’t need the ear file. You can just build and deploy the war file instead. If you’re using Java EE 6, then you can even include EJBs inside the war file if you want to use them. I have an example of pom.xml for building a Vaadin web app in
this blog
if it helps.

Cheers,
Bobby