How to create War file after complied GWT project?

638 views
Skip to first unread message

Tom

unread,
May 9, 2014, 1:31:30 AM5/9/14
to google-we...@googlegroups.com
I am quite confused about this area.

Ok, I finished my app in eclipse so I clicked "GWT Compile Project"

...
   Compiling permutation 4...
   Compiling permutation 5...
   Compile of permutations succeeded
Linking into C:\Users\myP\war\myApp
   Link succeeded
   Compilation succeeded -- 289.644s

Now seem C:\Users\myP\war has many files like .log & folders like myApp, images, WEB-INF, myP.css, myP.html, style.css

Then how to create war file from C:\Users\myP\war folder?

Davide Micheletti

unread,
May 9, 2014, 2:50:54 AM5/9/14
to google-we...@googlegroups.com
zip the war folder and load it into the server and change the extension to .war.. ;) 
or use maven plugin.. 
if you use Eclipse:
right click on your project -> Export -> War File



--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Davide Micheletti

unread,
May 9, 2014, 2:51:22 AM5/9/14
to google-we...@googlegroups.com
before change the extension and after load it into your server..

Tom

unread,
May 9, 2014, 4:08:57 AM5/9/14
to google-we...@googlegroups.com
when using Eclipse, it say Module name is invalid


On Friday, May 9, 2014 4:50:54 PM UTC+10, Davide Micheletti wrote:
zip the war folder and load it into the server and change the extension to .war.. ;) 
or use maven plugin.. 
if you use Eclipse:
right click on your project -> Export -> War File

On Fri, May 9, 2014 at 7:31 AM, Tom <Henr...@gmail.com> wrote:
I am quite confused about this area.

Ok, I finished my app in eclipse so I clicked "GWT Compile Project"

...
   Compiling permutation 4...
   Compiling permutation 5...
   Compile of permutations succeeded
Linking into C:\Users\myP\war\myApp
   Link succeeded
   Compilation succeeded -- 289.644s

Now seem C:\Users\myP\war has many files like .log & folders like myApp, images, WEB-INF, myP.css, myP.html, style.css

Then how to create war file from C:\Users\myP\war folder?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsub...@googlegroups.com.

Davide Micheletti

unread,
May 9, 2014, 4:18:24 AM5/9/14
to google-we...@googlegroups.com
is your project a Web Project?? 
Best way is to create a new Web project and copy data from old project into web project.

if not works see this:


To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.

Tom

unread,
May 9, 2014, 5:21:34 AM5/9/14
to google-we...@googlegroups.com
i used 2nd option, zip it as war.zip, then copy war.zip into webapps folder then change to myApp.war

Now i entered
http:/localhost:8080/myApp 

but i got error 404

What does it mean? how to fix?
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.

Davide Micheletti

unread,
May 9, 2014, 5:27:48 AM5/9/14
to google-we...@googlegroups.com
first zip
second rename to myApp.war
third load into webserver
fourth run

if you use a tomcat server use his webapp manager and deploy your proj


To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.

Tom

unread,
May 9, 2014, 5:56:21 AM5/9/14
to google-we...@googlegroups.com
Message:  

FAIL - Deploy Upload Failed, Exception: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (96180777) exceeds the configured maximum (52428800)

Desployed failed do u know how to chenge the max config?

Davide Micheletti

unread,
May 9, 2014, 6:15:56 AM5/9/14
to google-we...@googlegroups.com
Go to the web.xml of the manager application (for instance it could be under /tomcatX/webapps/manager/WEB-INF/web.xml.
Increase the max-file-size and max-request-size

   <multipart-config>
      <!-- 50MB max -->
      <max-file-size>52428800</max-file-size>
      <max-request-size>52428800</max-request-size>
      <file-size-threshold>0</file-size-threshold>
    </multipart-config>



To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.

Tom

unread,
May 9, 2014, 6:20:35 AM5/9/14
to google-we...@googlegroups.com
Ok, thank you very much for your help.

Thomas Broyer

unread,
May 9, 2014, 6:21:40 AM5/9/14
to google-we...@googlegroups.com


On Friday, May 9, 2014 11:56:21 AM UTC+2, Tom wrote:
Message:  

FAIL - Deploy Upload Failed, Exception: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (96180777) exceeds the configured maximum (52428800)

92Mb?! and without using any build tool or dependency management?

Maybe pass "-deploy <some folder>" to the GWT compiler when compiling your app and clean-up the WEB-INF/deploy folder.
Also make sure you're not bundling gwt-user and/or gwt-dev.

Davide Micheletti

unread,
May 9, 2014, 6:24:09 AM5/9/14
to google-we...@googlegroups.com
However 92 MB is really really BIG.. try to clean your project..


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.

Davide Micheletti

unread,
May 9, 2014, 6:26:21 AM5/9/14
to google-we...@googlegroups.com
i've a project with 50k (client + server) code's rows and it is 30Mb.. 

Tom

unread,
May 9, 2014, 8:22:44 AM5/9/14
to google-we...@googlegroups.com
Now I got other error:

FAIL - Application at context path /myApp could not be started
FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myApp]]


tomcat8/conf/tomcat-users.xml like this:

 <?xml version='1.0' encoding='utf-8'?>
<tomcat-users>

  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <role rolename="manager-jmx"/>
  <role rolename="manager-status"/>
  <role rolename="admin"/>
  <user username="admin" password="admin" roles="admin,manager-gui,manager-script"/>

</tomcat-users>


this is web.xml of myApp

    <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">

    <display-name>myApp</display-name>

    <!-- Default page to serve -->
    <welcome-file-list>
        <welcome-file>myApp.html</welcome-file>
    </welcome-file-list>


    <listener>
        <listener-class>myApp.server.guice.GuiceServletConfig</listener-class>
    </listener>

    <filter>
        <filter-name>guiceFilter</filter-name>
        <filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>guiceFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <context-param>
    <!-- max size of the upload request -->
    <param-name>maxSize</param-name>
    <param-value>5145728</param-value>
  </context-param>
  <context-param>
    <param-name>slowUploads</param-name>
    <param-value>200</param-value>
  </context-param>

  <servlet>
    <servlet-name>uploadServlet</servlet-name>
    <!-- This is the default servlet, it puts files in session -->
    <servlet-class>myApp.server.SampleUploadServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>uploadServlet</servlet-name>
    <url-pattern>*.gupld</url-pattern>
  </servlet-mapping>


  <servlet>
    <servlet-name>SimpleCaptcha</servlet-name>
    <servlet-class>
        myApp.server.ExtendedCaptchaServlet
    </servlet-class>
    <init-param>
        <param-name>width</param-name>
        <param-value>200</param-value>
    </init-param>
    <init-param>
        <param-name>height</param-name>
        <param-value>50</param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>SimpleCaptcha</servlet-name>
    <url-pattern>/SimpleCaptcha.jpg</url-pattern>
  </servlet-mapping>


</web-app>

Catalina.2014-05-09.log:

    09-May-2014 04:52:27.290 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myApp]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1134)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1780)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V" the class loader (instance of java/net/URLClassLoader) of the current class, gwtupload/server/UploadServlet, and the class loader (instance of org/apache/catalina/loader/WebappClassLoader) for interface javax/servlet/Servlet have different Class objects for the type let/ServletResponse;)V used in the signature
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.java:2397)
    at java.lang.Class.getDeclaredFields(Class.java:1806)
    at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
    at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
    at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:140)
    at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:66)
    at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:332)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5058)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 10 more

09-May-2014 04:52:27.305 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory C:\tomcat8\webapps\myApp
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myApp]]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1134)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1780)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

09-May-2014 04:52:27.321 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\tomcat8\webapps\examples
09-May-2014 04:52:28.102 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\tomcat8\webapps\host-manager
09-May-2014 04:52:28.133 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\tomcat8\webapps\manager
09-May-2014 04:52:28.274 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\tomcat8\webapps\ROOT
09-May-2014 04:52:28.336 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
09-May-2014 04:52:28.336 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
09-May-2014 04:52:28.336 INFO [main] org.apache.catalina.startup.Catalina.start Se

I am not sure which file is causing the problem
On Friday, May 9, 2014 8:26:21 PM UTC+10, Davide Micheletti wrote:
i've a project with 50k (client + server) code's rows and it is 30Mb.. 
On Fri, May 9, 2014 at 12:24 PM, Davide Micheletti <d.miche...@gmail.com> wrote:
However 92 MB is really really BIG.. try to clean your project..
On Fri, May 9, 2014 at 12:21 PM, Thomas Broyer <t.br...@gmail.com> wrote:


On Friday, May 9, 2014 11:56:21 AM UTC+2, Tom wrote:
Message:  

FAIL - Deploy Upload Failed, Exception: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (96180777) exceeds the configured maximum (52428800)

92Mb?! and without using any build tool or dependency management?

Maybe pass "-deploy <some folder>" to the GWT compiler when compiling your app and clean-up the WEB-INF/deploy folder.
Also make sure you're not bundling gwt-user and/or gwt-dev.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsub...@googlegroups.com.

Tom

unread,
May 9, 2014, 8:28:37 AM5/9/14
to google-we...@googlegroups.com
Hi Thomas, I got gwt-dev.jar & gwt-user-2.5.0.jar in myApp\war\WEB-INF\lib. The reason is that is i don't have these 2 jar files in myApp\war\WEB-INF\lib, then everytime I run myApp in Eclipse, eClipse warning that it can find class in the eclipse clathpath but not from myApp\war\WEB-INF\lib.

I remembered a few months ago, you said if we saw these kinds of warning in Eclipse then we need to include the jar file into myApp\war\WEB-INF\lib otherwise it may not work after deployed.

Now, if I remove gwt-dev.jar & gwt-user-2.5.0.jar in myApp\war\WEB-INF\lib & deploy myApp then will myApp running ok?

Thomas Broyer

unread,
May 10, 2014, 5:22:24 PM5/10/14
to google-we...@googlegroups.com


On Friday, May 9, 2014 2:28:37 PM UTC+2, Tom wrote:
Hi Thomas, I got gwt-dev.jar & gwt-user-2.5.0.jar in myApp\war\WEB-INF\lib. The reason is that is i don't have these 2 jar files in myApp\war\WEB-INF\lib, then everytime I run myApp in Eclipse, eClipse warning that it can find class in the eclipse clathpath but not from myApp\war\WEB-INF\lib.

I remembered a few months ago, you said if we saw these kinds of warning in Eclipse then we need to include the jar file into myApp\war\WEB-INF\lib otherwise it may not work after deployed.

Now, if I remove gwt-dev.jar & gwt-user-2.5.0.jar in myApp\war\WEB-INF\lib & deploy myApp then will myApp running ok?

You should not need to deploy gwt-dev or gwt-user, and you must not deploy them (for many reasons, including the exception you're seeing here).
You might need gwt-servlet.jar though.
Or if you use some third-party lib that happens to be bundled within either gwt-dev or gwt-user (e.g. ICU4J, Commons Collections) then you should grab JARs for those deps and put them in your webapp.

Tom

unread,
May 10, 2014, 9:06:48 PM5/10/14
to google-we...@googlegroups.com
Thax you very much Thomas, I understand now cos we already generate gwt Java code into Javascript so we don't need them right. Ok I got it
Reply all
Reply to author
Forward
0 new messages