Undeployment fails for GWT application in tomcat 7 - gwt

I am using the cargo-maven2-plugin:1.2.0 to do redeployments of my GWT 2.4.0 based web application to Apache Tomcat 7.0.25 1.6.0_30-b12 Sun Microsystems Inc. Windows Server 2008 R2 6.1 amd64).
The initial deployment works fine. I immediately try to undeploy the application using the tomcat manager when I receive the following error message:
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unable to delete [C:\apache-tomcat7\webapps\mywebapp]. The continued presence of this file may cause problems.
From tomcat the war file and most of the unzipped web application files have been successfully removed. But it fails to delete two libraries from mywebapp\WEB-INF\lib:
gwt-user-2.4.0
servlet-api-2.3
When I now wait half a minute and trigger the undeploy again, it works.
Did anybody experience the same or a similar behavior?
I already tried to debug using PSI Probe for Tomcat but that didn't really give me any insights. What could I try next?

Both files shouldn't be deployed in the first palce. First gwt-user-2.4.0 is the complete gwt jar file. For deployment only the server specific version needs to be deployed: gwt-servlet-2.4.0.jar. The servlet-api-2.3 is already available in the tomcat lib directory. So you should set both files to provided and if you not yet have the gwt-servlet jar file, add that file to you dependencies.

Related

Issue exporting war with eclipse for weblogic 10.3.6

I am using eclipse to build a web app to be deployed on weblogic 10.3.6.Performing a export as war and depolying the war on weblogic fails at a point where I am performing a file move opertation using java.nio.file.Files.move method.
The error I receive is following :-
java.nio.file.NoSuchFileException: /export/home/tppp3/asdsslon/infiles/Wert_Frameon_20160514.csv
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:403)
However this is not reported when I perform a deployment to weblogic using eclipse available option Run as-> Run on Server .
I am noticing Using above method, generates a _wl_cls_gen.jar with source code files compiled and package as class.
Any help will be appreciated.
I am looking for option to either generate _wl_cls_gen.jar for war export or find a option to make the move operation work. The same war works flawlessly on Tomcat.
Thanks

Rebooting JBoss / Wildfly causes webstart to load all jar files again

We are developing a software that runs on a client pc and is loaded via webstart (JNLP) from an app server. As app server our customers have the choice between weblogic and jboss ( wildfly). All the jars, the webstart client loads via webstart, are packed within a WAR file deployed in the app server.
The war file does not contain any other things than the jars.
We currently encounter the following issue:
Every time we reboot the jboss, the webstart clients load all the jar files again afterwards although they did not change.
With weblogic we do not have this issue.
Any idea what causes that and how to stop that behaviour?
I'm not sure why it would be different between Weblogic and JBoss but you should do the following in your JNLP file:
Specify a version for every jar like:
<jar href="my.jar" main="true" version="1.0"/>
Specify JNLP version enabled
<property name="jnlp.versionEnabled" value="true"/>
This should ensure that the versions are checked and only downloaded as needed. You can see more in the Oracle docs here.
Check to see if your server returns the correct HTTP code.
Webstart (and browsers) send HTTP request to see if a resource is modified. If it is not modified the server should return code "304 Not Modified".
You can use this chrome plugin to monitor HTTP requests and responses:
https://chrome.google.com/webstore/detail/live-http-headers/iaiioopjkcekapmldfgbebdclcnpgnlo?utm_source=chrome-app-launcher-info-dialog

Eclipse STS connecting to Tomcat

In Spring Tool Suite IDE, have added Tomcat server and started it. Console output says : INFO: Server startup in 19182 ms
But on trying url http://localhost:8080/, gives HTTP error 404
STS version - 3.6.2.
If server is started outside Eclipse, Tomcat homepage is accessible as usual.
Try http://localhost:9087/ and see if that works. You may need to check your configurations for other port numbers, but 9087 should work.
Got it working!
Wile running tomcat in eclipse, not all files are copied in the new deployment location in the eclipse workspace. But after manually copying index.jsp and related images, the home page came.

Step through debugging of web app code in Eclipse maven app running on tomcat

I am trying to set up eclipse so that I can work on a maven web application which packages as a war file without building the war file and deploying to tomcat webapps manually.
This would also allow me to step through the code. I have installed tomcat 7 and my app deploys there ok and I have pointed eclipse at the installation of tomcat but it does not seem to deploy properly even though the manual deployment works fine.
The issue I get when deploying is that eclipse informs me that tomcat was not able to start.
To deploy my app I am going "servers >> add and remove" and then deploying my application from the available list by moving it into the configured list. After doing this and starting the tomcat server I get the error message.
Can anybody help me with running the app from within eclipse based on the compiled code and not on whats in the war file as ideally my end result would be to be able to step through code I am working on without building the war file first.
Thanks
I finally sorted this out after a few hours of messing around reading numerous posts, so hopefully this answer may help someone else who gets the error message:
"Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds"
Below are the steps I took:
1) Backed up my projects in my work space and then deleted the workspace
2) Recreated the workspace and imported my projects back into it
3) (this bit was crucial for me) - Added a connector to my server.xml on port 8080 as my app was set up to only run with SSL, it seems that eclipse tries to verify your app started by hitting the root of the web app and it couldnt do this due to the SSL connector.
I hope this helps someone out.

WTP deployments without publishing fails

I'm currently on Tomcat 7.0.21, JDK1.6.29, and WTP 3.3.1 (running on Eclipse Indigo.) I'm not sure which version of M2E I'm running. My Project builds and deploys fine when I either do a mvn install and run Tomcat outside of Eclipse, or deploy to the server via WTP with the "Serve Modules without publishing" unchecked.
However, when I start the server via WTP with the no-publish box checked, Tomcat won't start successfully, failing with:
Dec 29, 2011 4:09:39 PM org.apache.catalina.startup.ContextConfig processAnnotationsJndi
SEVERE: Unable to process JNDI URL [jndi:/localhost/plutom-ws/WEB-INF/classes] for annotations
java.io.FileNotFoundException: jndi:/localhost/plutom-ws/WEB-INF/classes
at
org.apache.naming.resources.DirContextURLConnection.list(DirContextURLConnection.java:463)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1901)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1905)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1828)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1295)
If I manually create the classes directory, it then complains about classes/com It seems like there's a conflict between a classloader and a file path resolve somewhere?
This is unfortunately a known bug between Eclipse WTP and Tomcat 7. Here are the relevant Bugzilla entries:
Tomcat 7 + Serve Modules without publishing fails to find classpath resources
Really fix "Serve modules without publishing" with tomcat 7 by using the new VirtualDirContext of tomcat >=7.0.24
Apparently the fix is known, it just hasn't been applied yet. I guess it isn't a common use-case, because otherwise more people would be requesting it to be fixed. Its too bad, its a very useful feature.