I'm gonna tell you about all steps I've done. I'll also give some pictures to make my problem more easy to understand. Any recommendation will be nice.
Neccessary to say that I use
Tomcat 6 (Instaled on C:\Program Files\Apache Software Foundation\Tomcat 6.0)
Eclipse 3.7 (Indigo)
Google plugin for eclipse 3.7 (for working with GWT)
In eclipse I have created a Server
I have $CATALINA_HOME set at C:\Program Files\Apache Software Foundation\Tomcat 6.0
I should say also that there is an exception when I try to run Tomcat from Eclipse (I mean R-click on server -> start).
INFO: Starting Servlet Engine: Apache Tomcat/6.0.36
12 бер 2013 17:01:38 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
12 бер 2013 17:01:38 org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: C:\Program Files\Apache Software Foundation\Tomcat 6.0\work\Catalina\localhost\docs is unusable.
12 бер 2013 17:01:38 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory helloserver
12 бер 2013 17:01:38 org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: C:\Program Files\Apache Software Foundation\Tomcat 6.0\work\Catalina\localhost\helloserver is unusable.
12 бер 2013 17:01:38 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
12 бер 2013 17:01:38 org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory manager
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina\localhost\manager.xml (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1051)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
12 бер 2013 17:01:38 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
12 бер 2013 17:01:38 org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: C:\Program Files\Apache Software Foundation\Tomcat 6.0\work\Catalina\localhost\_ is unusable.
12 бер 2013 17:01:38 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
12 бер 2013 17:01:38 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
12 бер 2013 17:01:38 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/28 config=null
12 бер 2013 17:01:38 org.apache.catalina.startup.Catalina start
INFO: Server startup in 722 ms
I checked that I have no directories in the conf directory.
Okay look what I do next (I use this manual http://courses.coreservlets.com/Course-Materials/pdf/ajax/GWT-Intro.pdf):
1) Create a new Web Application Project (GWT). It works fine on Jetty
2) Than I need to export a WAR file.
3) The first problem (and the main one I think): that WAR file doesn't go to C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps. But it goes to c:\Users\username\AppData\Local\VirtualStore\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ . Moreover than I try to create a dynamic web project and try to run it on the server (r-click -> run as -> run on server). And than it is deployed in the same directory (I mean c:\Users\username\AppData\Local\VirtualStore\Program Files\Apache Software Foundation\Tomcat 6.0\webapps). I fail to see why! What is the reason?
4) Then I try to export WAR file (I mean GWT Project again) on the desktop. It goes fine and then I manually put the war file to C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps (Tomcat is still working).
5) Another problem is that Tomcat doesn't unpackage WAR file. And I get no result trying to load it in a web browser (http://localhost:8080/helloserver). And than I manually unpackage WAR file and put the helloserver directory to webapps and it works! All works fine.
The initial error in the log file tends to indicate that you don't have the tomcat manager application installed (or perhaps it is installed, but just incorrectly configured / disabled).
Try to verify if the manager application is functional by browsing
http://youmachine.domain:8080/manager/html
And if you can log in and see the list of installed web applications, then you know your tomcat manager application is functional.
I'm going to take a guess and suppose that the subsequent problems come from attempts (either initiated by you in trying to get it to work, or initiated as a fallback by windows / eclipse) to use a file copying deployment scheme, and it's getting redirected since that's a local to the application storage scheme.
You really want to upload the WAR via the manager application, don't bother trying to fix the copy scheme, as it runs amok with the virtual application storage configuration scheme on latter windows systems.
Related
So I deployed a WAR file containing my jHipster app (Angularjs+Spring boot) on openshift Tomcat 7 Cartridge. I can open reach my application with no problems (the front end) but once I try to login (interaction with the backend) i get an error.
Normally I check the exception stacktrace in the console of Eclipse IDE if I am debugging my application locally.
I checked the logs in app-root/logs/jbossews.log but I only see that my app is deployed logs. like :
INFO: Deploying web application archive /var/lib/openshift/57582f677628e108ba000096/app-root/runtime/dependencies/jbossews/webapps/ROOT.war
Jun 10, 2016 10:43:18 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/openshift/57582f677628e108ba000096/app-root/runtime/dependencies/jbossews/webapps/ROOT.war has finished in 29,121 ms
Jun 10, 2016 10:43:18 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-127.8.28.129-8080"]
Jun 10, 2016 10:43:18 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 29501 ms
Not my application exceptions.
Is there any configuration that I should add to get my application exceptions in the logs ?
Hard to tell without seeing your configuration but there is a "OPENSHIFT_LOG_DIR" environment variable in every Openshift gear and you can use that to write your log files to the designated log directory.
Example in your spring-boot application.yml file, you can add
logging:
path: ${OPENSHIFT_LOG_DIR}
file: myApplication.log
I'm a complete noob to IntelliJ and Tomcat 8. I managed to configured Tomcat 7 in IntelliJ in the same manner (as configuring TC8) and it works normally. Also, TC8 works when I start it up using command-line.
Here's what IntelliJ tells me when I try to run TC8:
"Application Server was not connected before run configuration stop,
reason: java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.CommunicationException [Root exception is
java.rmi.ConnectIOException: error during JRMP connection
establishment; nested exception is: java.net.SocketException:
Connection reset]"
Logs:
C:\apache-tomcat-8.0.8\bin\catalina.bat run Using CATALINA_BASE:
"C:\Program Files\Apache Software Foundation\Tomcat 8.0" Using
CATALINA_HOME: "C:\apache-tomcat-8.0.8" Using CATALINA_TMPDIR:
"C:\apache-tomcat-8.0.8\temp" Using JRE_HOME: "C:\Program
Files\Java\jre8" Using CLASSPATH:
"C:\apache-tomcat-8.0.8\bin\bootstrap.jar;C:\apache-tomcat-8.0.8\bin\tomcat-juli.jar"
Jun 06, 2014 1:22:08 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [C:\Program
Files\Apache Software Foundation\Tomcat 8.0\conf\server.xml] Jun 06,
2014 1:22:08 AM org.apache.catalina.startup.Catalina load WARNING:
Unable to load server configuration from [C:\Program Files\Apache
Software Foundation\Tomcat 8.0\conf\server.xml] Jun 06, 2014 1:22:08
AM org.apache.catalina.startup.Catalina start SEVERE: Cannot start
server. Server instance is not configured. Disconnected from server
Follow these steps :
Configure new Tomcat Server :
After configure click on OK.
Then on that one + symbol is there click on it i.e. in Green color, it shows :
then last step is to configure it for application :
from deployment tab add exploded file of application then configure that in which browser you want to open application then click OK, if you want to change more settings then you can.
Then try click on Green Button that will run your application.
I am taking over an existing Struts-based web application and am trying to deploy it for the first time on my local machine. My predecessor told me to run it through Eclipse on a Tomcat server.
I have installed the latest tomcat and it is running fine. I have grabbed the code from their CVS server and, with a few tweaks, removed all of the errors from the Java files. I then created a new Run Configuration having it run as "Run on server".
When I run the Run Config, the tomcat server starts up without error messages in the Console and an Eclipse browser page pops up to the correct local URL. The returned page is a 404, however. Looking at my Tomcat "webaps" folder, I see that my application is not there.
My question is, how can I troubleshoot this? My tomcat error logs do not get updated when I deploy and the Console output, shown below, offers no hint that there is a problem.
May 30, 2011 3:48:07 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: <long list of paths>
May 30, 2011 3:48:07 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 30, 2011 3:48:07 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 410 ms
May 30, 2011 3:48:07 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 30, 2011 3:48:07 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
May 30, 2011 3:48:08 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor CanPost_Emil.xml
May 30, 2011 3:48:08 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
May 30, 2011 3:48:08 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
May 30, 2011 3:48:08 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
May 30, 2011 3:48:08 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 244 ms
This is not the way to run web apps inside Eclipse.
Go to the Server view panel instead, and choose Add server. Here install the Tomcat adapter according to the instructions, and then add the projects you have (if they are Dynamic Web Projects). You can now start and stop the server and have the projects chosen updated when you change.
Do it this way. Do not try to create a Run Configuration launching Tomcat.
I have exactly the same problem.
While this is not a solution to the problem itself (running the project on Tomcat from within Eclipse), it is a way to run the project:
Pack(age) the project (I use maven: 'mvn clean package')
Copy the .war file into the webapps dir inside your tomcat installation.
(if not already running) Start up tomcat.
This works for me. I'm still looking for the proper answer to your question, but until I find it I'll just continue to manually package/deploy the project.
I am trying to create my first webservice using eclipse javaEE under Axis2,
i am following this turorial eclipse tutorial
to learn how to make it.I make the webservice but when i want to assure that the ws has been deployed through viewing it through URL, an HTTP status 400 occure. How can I know what is the error??
here what i make exactly:
i make the settings in preferences [ ant , axis2, tomcat and java ].
New -> New dynamic web page
new ->java (I create the class i want to convert to ws)
new ->web service (i want to create bottom up ws).
type http://localhost:8080/Axis2/services/listservices in the url of browser
this what return HTTP Status 404 - /services/listservices
can some one tell me how can i know what is the error? or how can i define it?
EDIT:
an exception happen in the console of eclipse which is :
org.apache.axis2.transport.http.AxisAdminServlet java.lang.ClassNotFoundException: org.apache.axis2.transport.http.AxisAdminServlet
what should I do ,in the configuration i specify where is axis2 and eclipse shows
Axis2 runtime loaded successfully
after creating new work space and create webservice again, this is the output appears in console
Dec 20, 2010 8:32:04 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path: C:\Program
Files\Java\jdk1.6.0_18\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;F:/alaa college/year 4/1st
semester/Advance sw/Libraries/eclipse/jre/bin/client;F:/alaa college/year 4/1st
semester/Advance sw/Libraries/eclipse/jre/bin;D:\app\AloOoSh\product\11.1.0\db_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_18\bin;%ANT_HOME%\bin;%AXIS2_HOME%\bin;%CATALINA_HOME%\bin;C:\Program Files\MATLAB\R2008a\bin;C:\Program Files\MATLAB\R2008a\bin\win32;
Dec 20, 2010 8:32:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source'
to 'org.eclipse.jst.jee.server:testFirst' did not find a matching property.
Dec 20, 2010 8:32:05 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 20, 2010 8:32:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 401 ms
Dec 20, 2010 8:32:05 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 20, 2010 8:32:05 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
[INFO] Deploying module: addressing-1.4 - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testF
irst/WEB-INF/modules/addressing-1.4.mar
[INFO] Deploying module: metadataExchange-1.4 -
file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/mex-1.4.mar
[INFO] Deploying module: ping-1.4 -
file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/ping-1.4.mar
[INFO] Deploying module: script-1.4 - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/scripting-1.4.mar
[INFO] Deploying module: smtpfault - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/smtpfault.mar
[INFO] Deploying module: soapmonitor-1.4 - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/modules/soapmonitor-1.4.mar
[INFO] Deploying Web service: Converter - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/services/Converter/
[INFO] Deploying Web service: version.aar - file:/D:/EclipseExcercises/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testFirst/WEB-INF/services/version.aar
Dec 20, 2010 8:32:06 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Dec 20, 2010 8:32:06 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Dec 20, 2010 8:32:06 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/19 config=null
Dec 20, 2010 8:32:06 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1383 ms
These is my own post to creating webservice and use that service in android. its
work properly.
Try this once below link
http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/#comment-179
The 404 error occurs because there is nothing at the desired url. So there must have been something wrong with your deployment.
Have you set up a server in eclipse and actually published the WS at all? Note that this is different from running Tomcat from a directory somewhere else on your computer! You can add a server instance by selecting New => Server.
If the server configuration is otherwise correct, the server output should appear in eclipse's console, and if anything is wrong with your WS setup, there should be error messages you can use to track down the problem.
You probably extracted the contents of axis2.war (renamed to app.zip) into the wrong folder or deployed files to the wrong folder. Look for the WEB-INF folder directly under the app.war folder that you deployed. If you have another folder of WEB-INF for the axis2 extracted folders, then JBoss cannot locate them. The WEB-INF folder must be a folder as a 1st level descendant. Along with the following folders: axis2-web, META-INF and org.
I've been running Tomcat 6 on my pc for some time now, and it has been running successfully...up until today. I just tried to start it, and now for some reason it won't start.
I start it from a command line prompt. The second prompt that appears after I enter 'startup' in the first prompt is exiting quickly, whereas it usually stays open and shows the status of the server.
Here's what the log file logged -
Dec 3, 2010 4:00:00 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Java\jdk1.5.0_16\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0;c:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Java\jdk1.5.0_16\bin;C:\jakarta-tomcat\bin;C:\MYSQL\MySQL Server 5.1\bin
Dec 3, 2010 4:00:01 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 3, 2010 4:00:01 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 424 ms
Dec 3, 2010 4:00:01 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 3, 2010 4:00:01 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Dec 3, 2010 4:00:01 PM org.apache.tomcat.util.modeler.Registry registerComponent
SEVERE: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/MyWebApp,J2EEApplication=none,J2EEServer=none
I never saw this before, where it says SEVERE: Null component... - what does it mean? What's causing it?
Here's what I ended up doing. I made a backup of my server.xml and web.xml files, along with my apps under the webapps folder, and removed jakarta-tomcat, and then reinstalled it. I restored the server.xml and web.xml file, threw my webapps back in, and started Tomcat up. This time, I got the same error as before, but it pinpointed that a particular servlet under one of my folders had a "bad version number". So I went through my servlet folders and recompiled the classes.
I started Tomcat again, and its running as it used to.
The problem was that a class had been compiled under a different version of the JDK, and it was causing an error.
Have you changed anything recently with regard to your Tomcat installation, configuration or deployments? Do you have a web application running under Tomcat called "MyWebApp"? If so, I would remove it and see if that fixes the problem. Otherwise, you might have to reinstall Tomcat.