Eclipse Tomcat server does not start - java

Situation: I installed JRE 8, and configured Tomcat 8.5 on my Eclipse Neon.3 Release (4.6.3).
Problem : I added a project and the server console shows server start-up in 41935 ms. But the background process keeps showing "Starting...." This is shown in the ScreenShot below.
Later, the server stops because it times out. Please help me resolve this.

I don't know how this worked, but merely restarting the PC and cleaning Eclipse's Tomcat server solved this issue.
Also, if at any point of time there is a Security alert asking permission to allow Java to access Public or Private networks, check all the boxes.

This can happen if already an instance of Tomcat server is running on the port(default is 8080). Kindly run below command in command prompt
netstat -ano
to list down the list of process and the port they acquire that are running currently and see if there a process running on the Port that your tomcat server is trying to acquire.
If yes, kill it and run the server again

had the same problem with Tomcat 7 (Liferay server), seems to be a compatibility bug in eclipse, I had to change to a lower version of eclipse.

Related

Can't run Java EE project through WildFly 10

When I unzip the wildfly-10.1.0.Final.zip file on my computer at home. Then WildFly starts running automatically. I had verified this through going to localhost:8080. Because of this I can't run my Java EE project on Netbeans (I have added WildFly as server in Netbeans). In the logs I see:
Address localhost: 8080 is already in use
I also can't shutdown WildFly through the following command:
$ ./jboss-cli.sh --connect command=:shutdown
However I can shutdown WildFly by killing his process. But this still doesn't fixed my issue on Netbeans. Because I still get to see: Address localhost: 8080 is already in use.
At my work when I had unzipped the wildfly-10.1.0.Final.zip file. It didn't start automatically I also had no problems with running my project on WildFly. And I also can shutdown WildFly through the command line or Netbeans.
Anyone that maybe knows how I can fix my WildFly server problem on my computer at home?
Which version of NetBeans are you using ? Until 8.2 WildFly 10 isn't correctly identified.
You may try NetBeans 8.2 RC1 from https://netbeans.org/community/releases/82/ or a nightly build as this would fix your issue.
NetBeans checks if there the instance is already running before trying to start it, so you don't have to start it beforehand but you can :)

Starting Websphere from Eclipse hangs when security is enabled

I have a Websphere Application Server 8.0.0.6, which was installed as part of RAD.
I need to run the server from an Eclipse Java EE Kepler or Luna. There is no problem when administrative security is disabled. However, once security is enabled, the server either doesn't start completely, or Ecplise is unable to to detect it.
The progress bar stops at 23%. The last message logged is "Server server1 open for e-business". The status however is still "starting". After a while I get an error complaining that the server didn't start within 300 seconds. It then tries to stop the server, and remains in "stopping" indefinitely.
The server is started, Eclipse just seems unable to see it. I can't access the admin console from within Eclipse (though I can with a browser), I can't publish or debug applications, and I can't stop the server from Eclipse.
This happens with both Kepler and Luna.
The server starts fine in RAD, or when started with the start script.
I have checked start websphere server from RAD hangs at "Server server1 open for e-business" . There is a similar question: Websphere in RAD hangs on startup, but there was no solution.
Update: The problem is the communication between Ecipse and Websphere, after Websphere has started (as wFateem also has pointed out).
Eclipse makes SOAP calls to Websphere to check the status. If administrative security is disabled in WAS, it accepts SOAP calls in plain HTTP. Once security is enabled, only HTTPS is allowed.
I checked communications between Eclipse and WAS using the TCP-Monitor built into Eclipse. With disabled security I can see the successful SOAP calls. After enabling security I expected to see just the binary SSL data. However, Eclipse was still trying to use HTTP, without any success of course.
Eclipse has a setting for the WAS server to indicate that the server is secured, and which user and password to use for the calls. It even has a flag pertaining to the SSL communication ("automatically trust server certificate during SSL handshake"). But still, it is not using SSL for some reason.
I had no problem in this scenario on my old development machine, which got replaced by my current machine a few days ago.
So, the current status is: Eclipse does not use SSL when talking to the WAS, even though it knows the server is secured.
The question now is: What did I do wrong that Eclipse does not use SSL to talk to a secured server?
I solved same problems for WebSphere 7 and Eclipse Neon.
Just run eclipse with ibm jdk 8 (type in google "ibm jdk 8 download").
My eclipse ini is
-vm
..\ibm_sdk80\jre\bin\javaw.exe
-vmargs
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Xms256m
-Xmx1024m
-XX:MaxPermSize=320m
-Dcom.ibm.ws.management.event.max_polling_interval=1000
-Dcom.ibm.websphere.thinclient=true
Best regards, Sergey Batsura
If you suspect problems with SSL, you could try the following workaround.
Once server is started (e.g. via command line), go to web admin console and then to: Global security > CSIv2 inbound communications and in transport section set transport to TCP-IP. Save and restart the server. This will disable SSL for RMI/IIOP connections.
Then in RAD in Server settings change Server connection types... to Manually provide connection settings and select only RMI.
Check if it will work better.
As last resort you could also try to start the server, then exit the RAD and restart the RAD again, it should detect server as already running. But it's not very useful...
it's important to modify the eclipse.ini.
First of all specifying the WebSphere -vm BEFORE -vmargs
Here are my parameters:
--launcher.XXMaxPermSize
512M
-vm
C:\IBM\WebSphere\AppServer\java\jre\bin\javaw.exe
-vmargs
-Xms256m
-Xmx1024m
-XX:MaxPermSize=512m
-Xmx1024m
-Xshareclasses:name=IBMSDP_%u
-Xcompressedrefs
-Xquickstart
-Xgcpolicy:gencon
-Xmnx64m
-XX:+UseCompressedOops
-Dcom.ibm.ws.management.event.max_polling_interval=1000
-Dcom.ibm.websphere.thinclient=true
After the above changes, communication from eclipse to WebSphere with security enabled works without problems
I'm not too familiar with starting WAS from Eclipse. However, from the sound of it this looks like a communication issue between your IDE and the WAS server. If you're able to start the server and you get the "open for e-business" message, but Eclipse is unable to see the proper status and this only occurs when security is enabled then you need to look into how Eclipse authenticates and performs SSL handshake with the WAS server.
You can start the server without any issues, but other tasks would require authentication (stopping server, retrieving status, etc...).
You may need to retrieve the WAS server's personal certificate into Eclipse's local trust store for example.
I was experiencing the same issue when trying to start WebSphere from Eclipse Luna. Finally I was able to start it following the guidelines posted by Aleksander Kovač in an answer from developer works forum: Unable to initialize SSL connection(WASCE7)
I hope this helps!
Maybe this is a silly advise, but have you tried using WebSphere Developer Tools? They are installed on top of Eclipse, either Luna or Kepler, using P2
https://developer.ibm.com/wasdev/
Look at this web page to learn how to install the tools
http://www-01.ibm.com/support/knowledgecenter/was_beta_devtools/com.ibm.websphere.wdt.doc/topics/t_install_wdt.htm
Update the JDK in eclipse.ini file to IBM JDB 1.8 64Bit. I am using WAS 8.5.0 with Eclipse MARS.
-vm
C:/IBM/WebSphere8.5/AppServer/java_1.8_64/bin/javaw
If eclipse does not start and return code=13, then check in eclipse.ini version is 1.7
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms256m
-Xmx1024m
Note:I have already commented in Sergey's answer,but needed to update some info.
I had the similar issue (Websphere application server hung in eclipse after adding Security).
Resolved the same by adding com.ibm.ws.orb_8.5.0.jar file from your appserver/runtimes and placed it in C:\Temp\endorsed folder and specify the same in your eclipse.ini file as below.
Eg:
vmargs
Djava.endorsed.dirs=C:\Temp\endorsed

Eclipse cannot shutdown BEA WebLogic server

I am using Eclipse Galileo and I have the BEA WebLogic Server v.10 installed.
The problem that I am facing is that the server cannot be stopped anymore(running in debug mode).
For example it shows the progress bar of stopping until 93% and after that it gives the message "The server cannot be stopped within timeout."; I can only restart eclipse in order to start again the server.
In the console I see the message:
"C:/bea1001/jrockit_150_11/bin/java -classpath C:/bea1001/wlserver_10.0/server/lib/weblogic.jar weblogic.Admin -url t3://localhost:80 -username weblogic -password 12345678 FORCESHUTDOWN AdminServer
Server "AdminServer" was force shutdown successfully ..." -
But it seems that something is blocking to stop the server.
Can anyone tell me what I can do?
p.s. I tried to delete and create a new server in the eclipse but I still have the same problem
Thanks and regards,
Luisa
I have found the problem: I changed the port of the BEA WebLogic to be 80 and this port was used also by Skype.
I changed the port of the Skype and now the server stops
Luisa
I've had the same problem and another solution may be to start Eclipse with java command (in my case Weblogic was running as java.exe, but Eclipse as javaw.exe). Also check if the same version of JDK is used for running both Weblogic and Eclipse.

Debug web application in Eclipse under Oracle Application Server

I am using Eclipse and I am familiar with Apache Tomcat.
I can run/debug my web applications under Tomcat.
But I can not do it for Oracle Application Server.
When I try to start the server from eclipse it is beginning to start, but after 240 seconds it says that timeout is reached.
Please suggest any method to debug under Oracle Application Server in Eclipse.
#user179437: you can try following things:-
You can increase debug timeout setting in eclipse
you can increase heap memory size by passing java parameters in debug configuration
If it is windows machine, you can do netstat -a to check what is status of debug port on the machine where OAS is running. What happens to status of port when timeout happens.
Just check java home configured in your eclipse and check its filesystem directory, if you are seeing any java heap dump files. If these files are created, you may see useful error information in same.
Last but not least, I was having same issue in websphere 6.0 with myeclipse, then I needed to apply server latest patches which basically upgraded my JRE which resolved the issue.
Please let me know if you want to know detailed explanation on any of the steps above.
Double-click on the server, and change the Start timeout in the Timeouts section.
Check the logs:
- in Eclipse workspace under .metadata/.plugins/org.eclipse.wst.server.core
or
- in the deployment directory
There must be an error or something other useful message.

Jconsole cannot connect to java processes running as Windows 7 Services

We have a Java process which we run as a Windows service (using srvany). It runs with Java 1.6 (1.6.0.23 at the moment).
In the past (Windows XP), I could connect JConsole to the processes, on Windows 7 I cannot do this anymore.
If I run jconsole <pid> I get “Invalid process id:4488”. The services are running as SYSTEM user.
If I make the service run as my desktop user (using “Log On as This Account”) the services process ID appear in JConsole, but they are grayed out and I cannot connect.
Is it impossible to dynamically connect to Java processes when they are running as a Windows 7 service?
Perhaps it is a 64bit/32bit problem, I have several applications compiled with 32bit JDK, which could not be opened with JConsole from 64bit JDK on Windows 7 64bit, after I downloaded the 32bit JDK it worked.
Others have been able to run jstack on 2008r2 which may provide some insight on how to get jconsole to connect on Windows 7. As you noted in your comment, the permissions are important. If the service and jconsole can't access the temp directory to write to the appropriate hsperf subdirectory, it won't work. What is also important is the location of the temp directory, the user the service is running, and the user that is running jconsole.
Running SysInternals psexec -s -i <jdk_home>\bin\jconsole <PID> can be used to run jconsole as Local System, the same user that I believe you are using to run your service.
My experience running jconsole from JDK 1.5 in Server 2008 as a system user was unsuccessful. With permissions that I thought should have been sufficient, I got a Could Not Open PerfMemory error. Java 1.6 may be a different story.
In light of all the challenges with running jconsole locally, you would probably have better luck setting it up to accept remote connections. You could set it up for local-only access with your firewall blocking that port from external access.
Add the following to JAVA_OPTION
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8086
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
Then,
Use JConsole to connecet remote session:
localhost:8086
I am currently facing the same problem but on Windows 2003 R2 (SP2). There is on open bug in Oracle Bug database (bug id 6399729)
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6399729
Also there is a work-around posted towards the end. It talks about installing java in "install" mode :-), but didn't work for me on Windows 2003 though. But your mileage may vary!!
Change Environment Variable TEMP and Tmp to a different folder that you created.
Like c:\theTemp
It might be a problem with the folder %TMP%/hsperfdata_{USER_NAME}.
In my case, it worked after I :
close all applications running over the JVM
delete the folder %TMP%/hsperfdata_{USER_NAME} (exemple: C:/Temp/hsperfdata_MyUser)
reopen JConsole (it recreates the folder)
Hope it helps. You can also take a look at this thread in Oracle community.

Categories