warrencohn / wogwt

Automatically exported from code.google.com/p/wogwt
0 stars 0 forks source link

Deploy on servlet ! #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
My question may sounds crazy.

I have an Wonder/wogwt/gwt app deployed on standard WO javamonitor.

I will have to migrate to servlet container. Do you think that can be done ?
What would be the modification to the web.xml generated for a WO servlet 
deployment ?

Thanks in advance

Pierre  

Original issue reported on code.google.com by pierregi...@gmail.com on 2 Apr 2015 at 9:08

GoogleCodeExporter commented 8 years ago
More info about my problem.

from the servlet, the component seems to be correct 
1) script :

WOGWT = {} 
...
is present and seems ok
2) link to the nocache.js is ok
3) your_app_gwt_Application.onInjectionDone('your.app.gwt.Application')

but the gwt module is not started

The only error I can find in the log is :

INFO: 
validateJarFile(/home/pierre/soft/apache-tomcat-6.0.43/webapps/TestWonder/WEB-IN
F/lib/gwt-dev.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. 
Offending class: javax/servlet/Servlet.class
2 avr. 2015 15:00:05 org.apache.catalina.loader.WebappClassLoader 
validateJarFile
INFO: 
validateJarFile(/home/pierre/soft/apache-tomcat-6.0.43/webapps/TestWonder/WEB-IN
F/lib/gwt-user.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. 
Offending class: javax/servlet/Servlet.class
2 avr. 2015 15:00:05 org.apache.catalina.loader.WebappClassLoader 
validateJarFile
INFO: 
validateJarFile(/home/pierre/soft/apache-tomcat-6.0.43/webapps/TestWonder/WEB-IN
F/lib/javaxml.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. 
Offending class: javax/servlet/Servlet.class

Any idea ?

Pierre

Original comment by pierregi...@gmail.com on 2 Apr 2015 at 1:36

GoogleCodeExporter commented 8 years ago
Deploying to a servlet container shouldn't be any different.  You are talking 
about deployment, not development, right?

You need to check that:

1) Is the WAR is actually starting up?  Test by running requests that are 
simple and don't touch GWT, etc.  This can be tough because WO usually swallows 
the specific error and just prints a generic one to standard error.

2) Are the static javascript files available?  Test that you can retrieve them 
by url directly (both the nocache.js file and one of the cache.js files).  Are 
you setting the baseUrl in the app to match the location of the web server 
resources?

For a servlet deployment the easiest thing to do is to include the web server 
resources in the static folder and have tomcat serve them rather than apache.  
If you do that, you need to set the base url.  I posted about this a few weeks 
ago on the webobjects list.

Original comment by johnth...@gmail.com on 2 Apr 2015 at 2:56

GoogleCodeExporter commented 8 years ago
Thanks John

Yes only deployment, the app is already developped and deployed in javamonitor.

1) the war is loaded and the Main wo component is accessible.
2) with WOAppMode=Deployment, the nocache is not found !
I guess I have to set the baseUrl correctly but I didnot find your instructions.
I look in http://lists.apple.com/archives/webobjects-dev/2015
Where did you post ?

Pierre

Original comment by pierregi...@gmail.com on 7 Apr 2015 at 10:13

GoogleCodeExporter commented 8 years ago
2) The url for for nocache.js is wrong
http://127.0.0.1:8080/WebObjects/TestWonder.woa/Contents/WebServerResources/your
.app.gwt.Application/your.app.gwt.Application.nocache.js

GWT.resourceUrl (/WebObjects/TestWonder.woa/Contents/WebServerResources/) has 
to be modified ?

Original comment by pierregi...@gmail.com on 7 Apr 2015 at 11:07

GoogleCodeExporter commented 8 years ago
I found a way to make it work :

1) add a static content for apache named "WebObjects" 
in server.xml :
     <Context docBase="/home/user/WebObjects" path="/WebObjects" />

2) copy TestWonder.woa/Contents/WebServerResources/* in this docBase.

Need to be tomcat admin to do that. Is there a way to do the equivalent at app 
level ?

Original comment by pierregi...@gmail.com on 7 Apr 2015 at 12:46

GoogleCodeExporter commented 8 years ago
Put your web server resources in the WEB-INF/static folder and set the base url 
for them.  Tomcat and Jetty will both serve them directly from there.

https://www.dropbox.com/s/bfgmzkrz6cyw1xe/buid.xml?dl=1

https://www.dropbox.com/s/56cojqgulc7sezj/Application.java?dl=1

There's a note in the build file -- due to WO bug don't use tomcat 8 unless you 
replace WOJavaServletAdapter or whatever its called.  Use tomcat 7.

Original comment by johnth...@gmail.com on 7 Apr 2015 at 2:20

GoogleCodeExporter commented 8 years ago
Great, Thanks very much !

Pierre

NB : I had to prepend with my app name :
        setApplicationBaseURL("/TestWonder/static/"); // for Tomcat deployment
        setFrameworksBaseURL("/TestWonder/static/Frameworks/");

Original comment by pierregi...@gmail.com on 8 Apr 2015 at 7:43