Eclipse Helios Deployment Issue - eclipse

I am using Helios Version of Eclipse. I am having an issue using that. I have created a Dynamic Web project there. I have some .jar files under WebRoot/WEB-INF/lib folder. With all other .jar files I have a .jar file called iText-2.1.5.jar. I am using GlassFish server as a Application Server. Now issue is, when I am trying to add this project to the server only previously mentioned .jar file adding seperately into the server . When I am trying to publish any change into the server it is showing an error message like 'Publish failed using Ant publisher Could not delete [.JAR] file....' . To avoid this problem everytime I have to stop the server and manually delete the .jar file from the specific location and then restart the server. This is very time consuming process. Can you guys please solve this problem?
Thanks is advance.
Somnath Guha

Related

Can't get past Welcome to Jboss page Openshift

I'm trying to use Openshift to host my java webapps. The problem I am running into is every time I go to my application "http://omniticketmvc-leviliester.rhcloud.com/" it takes me to a "Welcome to your JBossEWS (Apache/Tomcat) application on OpenShift".
I thought maybe it was because my project had some sort of default .war that was being deployed instead of the one I wanted. To try to confirm that I followed this guide made by to deploy a pre-compiled War file. https://www.openshift.com/kb/kb-e1088-how-to-deploy-pre-compiled-java-applications-war-and-ear-files-onto-your-openshift-gear .
As you can imagine that did not work. The guide implies that I should be able to find my webapp running at app-domain.rhcloud.com/mywebsite with "mywebsite" being the name of the war file my project created. In this scenario my Application war file is name "OmniTicket". I can find that war file on the server using ssh but the directory hierarchy is confusing to me.
I also tried looking in logs on the server but I don't see any errors to indicate a malfunction in spring or database connections. Any help would be appreciated. Specifically when I deploy my application to the Jboss Server without any obvious errors, why can't I get to the application root?
I should also mention it is a SpringMVC restful service application that works locally.
Try following steps:
Rename your war name to ROOT.war
Delete the src and pom.xml. If pom.xml is present then OpenShift would try to build the maven project
Place the war in deployments folder under your application root folder
Commit the war and push changes to application Git repository.
Check the logs using rhc tail command

Running helloworld-rs from JBoss quickstarts in eclipse

I am trying to learn JAX-RS using JBoss quickstarts.
When I deployed the application "helloworld-rs" through command-line, it ran successfully. Then I created a maven project in Eclipse, copied files from "helloworld-rs" at proper locations and it worked fine. Then I went ahead to add a form to the existing index.html file and something went wrong. Instead off deploying "jboss-as-helloworld-rs", Eclipse started deploying "jboss-as-helloworld-osgi" for some unknown reasons. Obviously, it produced error when I tried to access "localhost:8080/jboss-as-helloworld-rs/index.html"
So I created a new Maven project in Eclipse with following details:
Group Id:org.jboss.as.quickstarts.rshelloworld
Artifact Id: jboss-hello
I have also made changes in pom.xml as follows:
<artifactId>jboss-hello</artifactId>
Still I am facing the same problem. I have made a copy of "helloworld-rs", made same changes in the pom.xml and deployed and ran it successfully through command-line using
http://localhost:8080/jboss-hello/index.html
Strangely, this very link does not work in eclipse!!!
I have zeroed-in that there is some problem in deploying th app in Eclipse. Can anybody please help me solve this? Thank you!!!
I went to the 'jboss-as-7.1.1.Final\standalone\deployments' folder, deleted all the deployed war files. Then in Eclipse, right-click on servers -> clean . Then, I started the JBoss server and everything went fine.

Automate Tomcat adding to Eclipse

I'm trying to write a script (Perl) that will automate the adding of Tomcat server for a Java project under Eclipse.
The project is checked out via SVN, and I want, once the project is downloaded via SVN, to run a script that will automatically configure the remaining bits of the project. In this context, I need to find how can I edit which Eclipse's configuration files to automate the adding of a Tomcat server. Actually the script will also modify other configuration files, but I'm facing a hard time trying to find which files to edit and how to add Tomcat.
Any insights will be welcome, thanks in advance.
There is a plugin for eclipse called Escripts. You can create xml like scripts to automate actions like doing wizard actions. I tried to check the documentation, but the homepage of the Escripts is giving back http 500 for me (http://escripts.sf.net). I have written a mail to the author, if he answers, I will let you know. The update site looks like working (uncheck the categorize by groups to see the uncategorized plugin): http://escripts.sf.net/updates .
Some examples you can found at http://escripts.svn.sourceforge.net/viewvc/escripts/trunk/net.sf.escripts.tests/src/net/sf/escripts/tests/
What you should enter in the script is a wizard with id org.eclipse.wst.server.ui.new.server. The plugin, that is containing it is org.eclipse.wst.server.ui. Take a look at the plugin.xml in that plugin. Without the documentation, this is what I can remember of.
Have you tried the following files in the Eclipse workspace?
.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jdt.core.prefs
.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jdt.launching.prefs
.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.wst.server.core.prefs
.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jst.server.tomcat.core.prefs
I took the following files and dropped them into a new instance of eclipse and it created the Tomcat server under Server->Runtime Environment.
http://dl.dropbox.com/u/9591144/StackOverflow/org.eclipse.jdt.core.prefs
http://dl.dropbox.com/u/9591144/StackOverflow/org.eclipse.jdt.launching.prefs
http://dl.dropbox.com/u/9591144/StackOverflow/org.eclipse.jst.server.tomcat.core.prefs
http://dl.dropbox.com/u/9591144/StackOverflow/org.eclipse.wst.server.core.prefs

.war file not getting deployed on tomcat server 7.0

I have two queries which I am detailing below:
I installed tomcat 7.0 on my ubuntu machine 11.04.
1. .war file not deployed
When I start tomcat through terminal it works fine and I am able to see the tomcat webpage at http://localhost::8080/. After that I try to deploy a war file ps.war which I copy into the webapps folder inside the tomcat installation directory. And then I restart the server but get the same 404 error even when the .war has been extracted to a ps folder by tomcat.
2. Not running through eclipse
when I open it through eclipse then it shows in eclipse console that the server is started and synchronized but does not run any service and give HTTP 404 eroor. Also in this case, When I open a browser window then I get same 404 error at http://localhost::8080//
Please help me put as I am quite stuck at this moment and not able to run the web services any further. Thanks in advance.
#ezile i can understand for the first query that .war file was faulty thats why you were unable to get it through the browser..
but for second query solution how can i accept that making a correct .war file made http://localhost:8080 running in eclipse...
I am asking this question as i am having the same (first and second) difficulty !!
Did you mean to have two colons in your URL before the port number? It's supposed to just be one. http://localhost:8080
Next, in your tomcat installation directory there is a directory called logs which contains a few log files which will provide more information than just the 404 message you see in your browser.
One other thing to check which we've ran into before is case. I have seen a problem with WebContent\WEB-INF being the wrong case (i.e. lower case) and Tomcat not wanting to pick up the war artifacts.
Thanks all for your responses. I solved the problem. For first part there was some problems with my .war file and thats why it was not getting deployed.
For second, after I corrected my war, it automatically started working for eclipse too.
In my case it was because the WAR required a full path.
I had specified localhost:8080/WarFileName
Which didn't work. It was only when I specified
localhost:8080/WarFileName/src/homepage
Which was how the packages were created in the war file, that it worked.

Tomcat reporting IncompatibleClassChangeError - classpath problem?

I'm trying to deploy an application to Tomcat 7 on a Windows server. I have a local copy set up and have tested with Eclipse without any trouble, but on the production server I get IncompatibleClassChangeError messages.
This had been a problem on the local server when there were problems with the classpath, but I configured the correct classpath in the server properties inside Eclipse and everything ran fine.
I'm new to Tomcat and from what I understand it should be reading jar files from my my WEB_INFO/classes directory, but when my jars are there the app doesn't want to load at all. When I move them to the $CATALINA_HOME/lib (I realize that's not where they should go) the app loads fine but reports the IncompatibleClassChangeError.
Why aren't my jars being read from WEB-INF/classes? Is there some configuration I should look at to fix this?
Webapp-specific JAR files should go in Webapp/WEB-INF/lib, not in Webapp/WEB-INF/classes. The Tomcat/lib should only be used for appserver specific libraries and optionally also JAR files which should be shared among the deployed webapplications.
There might be more into the IncompatibleClassChangeError, this can have an entirely different cause. But first try getting the JAR's in the right place. If in vain, then please update your question to include the detail message. This at least smells that you're putting JAR files of a different appserver make/version in the classpath.