Unable to deploy a JSF project with Eclipse Mars - eclipse

I've been using Eclipse Kepler with Java 1.7, Glassfish 4 and JSF 2.2 successfully for a while. I've just installed Eclipse Mars, the latest version, and installed Java 1.8_66, and got a simple "Hello World" test to run in the console mode. After downloading Glassfish 4.1.1, the latest version, I set up a simple "Hello World JSF" project, but I'm unable to associate it with the server. On right clicking on the Glassfish server in the server window and selecting "Add and Remove", I keep getting the message:
"There are no resources that can be added or removed from the server."
On right clicking on the project then selecting Properties > Project Facets, everything appears to be in order, and have the following selected:
Dynamic Web Module 3.1,
Glassfish Web Extensions 4.0,
Java 1.8,
JavaScript 1.0, and
JavaServer Faces 2.2,
which is identical to the setup I had with Eclipse Kepler, except for the version of Java, and as far as I know, there is no Glassfish Web Extensions 4.1. What is going wrong, and how to I associate the project with the server?
Glassfish is running normally, and get the greeting page at localhost:8080 when I start it manually using asadmin start-domain in the console. However, if I start it from Eclipse, I get the following text in the Eclipse console:
Starting preview server on port 8080
2015-12-25 19:01:41.539:INFO::main: Logging initialized #1285ms
2015-12-25 19:01:41.793:INFO:oejs.Server:main: jetty-9.2.13.v20150730
2015-12-25 19:01:42.173:INFO:oejs.ServerConnector:main: Started ServerConnector#3bcacab5{HTTP/1.1}{0.0.0.0:8080}
2015-12-25 19:01:42.177:INFO:oejs.Server:main: Started #1931ms
with the last four lines in red. When I go to localhost:8080 I get the message:
Error 404 - Not Found
No context on this server matched or handled this request.
Contexts known to this server are:
so the server is obviously running, but doesn't pick up the HTML in the default page. This is presumably related in some way to why I cannot get anything linked with Glassfish in Eclipse.
Some ideas on what is happening and how to fix this would be very welcomed indeed, as I really want to upgrade to the latest versions of Eclipse, Java and Glassfish.

Related

GlassFish server fails to launch from eclipse [duplicate]

I am trying to test my web application in GlassFish 4 from eclipse. When I am starting GlassFish 4 with a file (startserv.bat), it works fine, but when I am trying to run it from Eclipse, it starts loading, but then the startup process gets stuck at 69%, on a message Launching Delegate...
After several minutes in that condition, it gives me an error message:
After a few re-tries, I got this message:
Even though nothing is running on the port 8080 (GlassFish's port) and 4848 (GlassFIsh's admin port)
It worked fine for me before, but now for some reason, it just doesn't, I haven't done anything to it's settings or anything. How can I resolve this problem?
Here is my startup console log: http://pastebin.com/XL0Lh5zw (using pastebin to avoid making the post to big)
I had the same problem, with the same messages.
After a long search, I gave up and I removed the server.
And I removed the Server Runtime Environment
The Glassfish files were not removed only the eclipse configurations, and then I re-created the Server Runtime and the Server using the existent glassfish server and the problem was fixed :D.
I got the same issue. I'm using Eclipse Luna.
I downgraded my GlassFish Tools to 7.2 and I got the server started back again.
http://download.oracle.com/otn_software/oepe/12.1.3.1/luna/repository
I didn't see any errors in the log, just some warnings about Hibernate stuff, which shouldn't crash the launch. It could be that it is taking too long to initialize with all of the eclipse overhead, but most likely it could be a locking issue, which could cause the timeout, since eclipse would be left infinitely waiting for a resource it could never obtain. Are you sure the server is only being accessed by eclipse, and is not already running or owned by another process?
I was also getting this issue all the week. But in our team we finally fixed it. It seems that Glassfish needs JDK 8 (not JRE 8 default given entry in Eclipse Luna) so you have to firstly install JDK 8 from Oracle web site and after configure Eclipse to point on it in Windows -> Preference -> Java -> Installed JREs Click on "Add" choose "Standard VM" click on "Next" and use "Directory" button to point on your -freshly installed- JDK8 directory if you didn't change any thing during the installation , on windows it would be "C:\Program Files\Java\jdk1.8.0_20".
Just because Glassfish and Glassfish Tools for Luna need JDK8 to perfectly work.
I had the very same issue with GF 3.1.
When looking into the problem I noticed that in the Eclipse console Glassfish appeared to be still running. I deleted the application using the web console and then I quit Eclipse. I then checked the active Java process (i.e. ps -e | grep java) and noticed an zombie Glassfish process.
Sometimes it happens that Eclipse is not able to startup / shutdown Glassfish correctly, "loosing" a process doing so. Usually killing the zombie process fixes Glassfish and related integration with Eclipse.
Another thing to try in this case is to remove the applications from the Server and remove the server from Servers panel in Eclipse, then adding the server and applications again.
I'm using Eclipse Glassfish 3.1.1, Luna 4.4.1, Java 1.7.0_71, OS X Yosemite.
Changing debug port (properties->glassfish->debug port) to current+1 (eg. from 8008 to 8009) every time it happens makes it work for me.
I'm using eclipse neon 4.6.0 + glassfish 4.1
If any one is still stuck go to your glassfish folder domain > domain1 > config
edit domain.xml change network listener port no. to any other port number.
Restart eclipse and glassfish.
assuming you have glassfish 4.1.1 it worked for me.
I fixed the problem by using Eclipse Neon (4.6) and GlassFish 4.1.1.
Had the same problem, no idea why this happens. Anyway, I deleted Glassfish from Eclipse and had a new GF set up. Worked for me just fine!
Using Eclipse Mars and Glassfish 3.2. I used Eclipse > Help > Check for Updates. Two updates were found and one was Glassfish tools. Allowed the update to do its thing and it seems to have resolved the problem.
Go to below path:
C:\glassfish4\glassfish\domains\domain1\config
Also the path where your server location configured into the eclipse and open domain.xml file.
Find out the 8080 port number and change different port number like 8081...
Save and close the file.
In eclipse:
Remove the added server and add fresh Glashfish server.
Start the server. This will solve the problem.
Same problem here, stuck at 68%.
I find out that it was docker which occupied 8080:80.
If any one who is also using docker:
I do "docker ps"to see which one is using 8080
then i do "docker stop [container id]"and "docker rm [container id]"
then the glassfish sever in eclipse finally launched successfully.

Tomcat server not being recognized

I'm currently using Eclipse Mars on OS X to build a PHP based application which requires a web server for a form submission. However, upon attempting to add Tomcat 7.0 as a server, the server list is empty (shown below).
I've been following several tutorials for setting up and configuring a Tomcat server and each one says to place the extracted Tomcat folder in the Eclipse workspace directory so they'll be detected when adding them in Eclipse. The Apache Tomcat folder is in the workspace directory but it still isn't being detected. I've tried reinstalling Eclipse and deleting any duplicate files but I keep getting the same result. How can I properly set up and configure an Apache Tomcat server in Eclipse Mars?
You can tell it about the Tomcat installation using the Server Runtime Environments preference page.
If Tomcat isn't already a known server type, you might need to install a few more. The WTP FAQ has instructions.
All of those tutorials are wrong. You do want to download a copy of Tomcat from Apache so it has the expected layout when Eclipse looks for the jars needed to launch it, but there's no reason to actually put it in the workspace.
I am also using Eclipse neon and I faced the same problem and the answer was available in a question Apache Tomcat Not Showing in Eclipse Server Runtime Environments in the same site already posted
Of the Available Answers the below steps Worked for me:
1.Help-->Eclipse Marketplace
2.Type Tomcat in search box and choose the Option JST Server Adapters(Apache Tomcat,...) and click on Install
3.Then complete the Simple installation steps and after installation Eclipse prompts for a restart accept and then you can see the Target Run time updated with Tomcat server
Note:I am using Windows

How do I change instance when debugging Eclipse through Tomcat

I have a Java servlet application to maintain and have downloaded both the Live version and the Test version rom SVN to Eclipse (Helios) and have associated my Tomcat 7 with Eclipse to debug the applications. But when I attempt to Run or Debug the Test instance of the servlet on the associated Tomcat server Tomcat always seems to start the Live instance. For example when I attempt to start the Live Instance - in Eclipse it shows the URL to be;
https://localhost:8443/SWFinanceLive/WEB-INF/classes/path/to/web/request/entry/point.java
When I am expecting;
https://localhost:8443/SWFinanceTest/WEB-INF/classes/path/to/web/request/entry/point.java
How do I change the instance when running through the server in Eclipse?
This link seemed promising but then doesn't tell you how to change the setting;
tomcat server instance debugging in the eclipse
With the assistance of #Susie I was able to change the project root context. Things are working as I desire now

Error 404 running Tomcat from Eclipse

I'm new to Eclipse and to Java Web app but i have to work to a project for school on databases.
I created an Eclipse project form the template they gave us and installed Tomcat v7.0
When I start Tomcat "manually" with startup.sh it start nicely and shows the tomcat homepage to localhost:8080. But when I try to run the project from eclipse on both localhost:8080 and localhost:8080/IntroDBProjectit shows the 404 error report.
I already tried copying the ROOTfolder in ../.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/ (and restarting eclipse) but still it doesn't seem to work.
Can someone help?
I'm working on Mac OSX 10.9.2 / Eclipse Java EE IDE / Tomcat v7.0
Ok I solved the problem.
I simply deleted and reimported the project. I should have done that earlier. I feel dumb -.-

Eclipse + JBoss Tools won't run webapp to configured JBoss AS

I am using Eclipse 3.7.2 with JBoss Tools 3.3 under Ubuntu 12 and have configured a locally installed copy of JBoss AS 7.1.1 in Eclipse under "Preferences::Server::Runtime" Environments.
However, when trying to run a Java EE application by double-clicking on the project or an .xhtml page I only see "Run As / Run" on Server as an option and I get an HTTP 404 from Apache Tomcat/7.0.26 at localhost:8080. That is, it seems like Eclipse is trying to deploy to a Tomcat server as opposed to the JBoss AS I have configured in "Preferences::Server::Runtime" and I don't get an option like "Run on JBoss" or anything. When I export my application as a war and manually deploy to JBoss AS the app runs fine.
The idea is to add your application to a specific server that you have configured. Additionally; just adding the server runtime isn't enough.
You need to open the Servers view, and from there right click on the background and select New, and then Server. If you choose JBoss Community -> JBoss AS 7.1 here, you can select your previously created Server runtime in the Server runtime environment, or optionally create a new one.
Then comes the mental twist that you need to make. In WTP you don't use the Run As command, but instead right click the server in the Servers view (default name should be JBoss 7.1 Runtime Server, and select Add and Remove. Select one or more applications from your workspace that you would like to run on your server. Click finish when done.
Now right click again on your server, and choose either Start or Debug.