Running helloworld-rs from JBoss quickstarts in eclipse - 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.

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

Eclipse + Tomcat: Web app checks for TLD, how to stop?

I've got a Maven project the gives me a war file.
If I deploy this was direct to Tomcat7.0.33 it seems to work fine.
If I start tomcat from inside eclipse, then I get errors to do with looking up TLD's
i.e. JSTL tld missing and "http://www.springframework.org/security/tags cannot be resolved in either web.xml or the jar files deployed with this application"
Can anyone give me a clue as to why?
It almost like the property '
< constant name="struts.devMode" value="false" />' has been set to true.
Any ideas would be great!
Thanks
Jeff Porter
Edit: The wars were the same. Checked via BeyondCompare.
If I find a solution, I will post it.
Are you using the same instance of tomcat in both cases (standalone/ eclipse)?
Are you sure are you deploying exactly the same jars set in both cases?
Check in eclipse what is deployment assembly ( Click on Web-Project -> Choose properties for the web project -> click Deployment Assembly ) for your web project, there can you see what is deployed when using eclipse)?
It is hard to say exactly what is wrong, but if you have the same tomcat instances in both cases should be a problem only in deployed jars (not all is deployed in eclipse, or in wrong version is deployed, or too much is deployed and some jars conflict tomcat jars).
I had similar problem but long time ago. As I remember there was a library version problem. This what I deployed was in conflict with some tomcat jars.

Eclipse JBoss hot code replace

I am using Eclipse 4.2 and JBoss 7.
I have Build automatically checked in Eclipse.
Even then I have to build and redeploy the EAR file to JBOSS to test any code changes I make in Eclipse debug mode.
Am I missing something here?
THanks,
What the "Build automatically" option in eclipse do is that when you modify the source code of a class, this one will be automatically compiled, which doesn't mean that all the whole project that contains the class (i.e. war, jar, ear ...) is redeployed in the server. But of course it helps in the speed of deployment, because the classes you've been modifying are already compiled when you manually build or deploy the project.
On the other hand, to avoid problems with redeployments, you'd better set up JBoss to delete the files related to the application keeps in the work directory, when the application is undeployed / redeployed. Look at this stackoverflow thread for more information.
Concerning the "Build automatically" option:
In order for the Deployment Scanner in JBoss to work, you have to have it turned on in JBoss.
Also, you need to add your project to the JBoss server in the Servers window. Look for the "Add or Remove..." option.
Once your project is added, any changes you make to your code will get detected and your module will be redeployed automatically in the background. Failing that and assuming your project doesn't have a snag, you can use mvn install & mvn jboss-as:deploy to manual update your module.
Beware, sometimes mvn doesn't pick up the latest java code. This seems to be a project configuration issue more than anything. Re-creating the project seems to correct the issue.
Also, keep an eye out for duplicate persistence.xml files.
You only need one.

Can't run app engine project with maven layout

Having created maven project under Eclipse I configured app engine settings and set my WAR directory to target/Site-0.0.1-Snapshot (I'm using app engine plugin). Deploying the project to app engine works just fine however I can't get the project running locally. When I start it just copies the entire contents of target/Site-0.0.1-Snapshot to target/Site-0.0.1-Snapshot/WEB-INF remaining the lib directory empty and throwing ClassNotFoundException. What can cause such strange behavior? May be I'm having something misconfigured?
Answering my own question.
The problem has been solved checking the "Launch and deploy from this directory" option.

Eclipse Helios Deployment Issue

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