Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

tomcat issues while doing hot/real time deployment vs manual deployment

Hi,

When I do below steps command prompt
1.  env
2.  mvn eclipse:eclipse
3.  mvn clean install
4. go to the target folder of the imported maven project within eclipse workspace and copy the generated project folder
5. paste in the C:\sftwr\apache-tomcat-6.0.37-windows-x64\apache-tomcat-6.0.37\webapps
6. go to bin by entering 'cd C:\sftwr\apache-tomcat-6.0.37-windows-x64\apache-tomcat-6.0.37' and click startup.bat
7. then go to the URL everything works perfect. UI comes and all good stuff.

But problem with above manual deployment is i cannot debug the code real time.


Now switching to other hot/real time approach steps

 in the eclipse
1. click on the project and "Run As---Maven Clean"
2. and then click on the project and "Run As---Maven Build(goal as compile)"
3. and then click on the project and "Run As---Maven install"
4. and then click on the project and "Run As---run on server(tomcat 6 server)

I do not know where it is putting the latest war file. how do i know whether latest war is picking latest code or not.

I am getting all kinds of errors with spring, maven, hibernate, not found web.xml etc.

I want to make sure my latest code is properly getting deployed in the hot/real time deployment.(also want to make sure to clean all the junk in that folder before rerunning the application on server)


 when i try real time/hot deployment i am experiencing all kinds of issues.


please advise
Any links resources ideas highly appreciated. Thanks in advance
Avatar of mccarl
mccarl
Flag of Australia image

I'm not 100% sure what is the question here.. Is it "where is you code deployed to when running on the server started by Eclipse" ?

If so, then yeah, it is a little bit hidden, but you should be able to follow this to locate it...

Start from your Eclipse workspace folder (wherever that may be), and then follow...

.metadata\.plugins\org.eclipse.wst.server.core

In that folder you will find one (or more) folders called "tmp" and then followed by a number. Each of these represents server objects within your Eclipse IDE. If you only have one than great, just open up that folder otherwise either just poke around until you find the right one, or you can open up "tmp-data.xml" in that folder and it will give you the mapping between the server name in Eclipse and the correct "tmp?" folder.

Now inside this tmp? folder, you will find a number of folders, if you look in wtpwebapps you should see the folder the Eclipse has deployed your application into.
Avatar of gudii9

ASKER

2. mvn eclipse:eclipse
3.  mvn clean instal


what is the purpose and difference of above two steps.
1.  env
I do above step  in the beginning by going to some specific folder in my local machine command prompt like
cd C:\xyz\lmn\aaHome then type env then enter then i get message saying "environment has been set" not sure what that step either means. Please advise
Avatar of gudii9

ASKER

i see under workpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ROOT\WEB-INF

there is web.xml. can i delete this file.

when i open that file it is empty file and nothing in it like below
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd" version="2.5">
</web-app>

Open in new window



what this ROOT folder is used for.

I keep getting error as below

Nov 12, 2013 12:29:07 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:abc-def-web-app' did not find a matching property.
Nov 12, 2013 12:29:07 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Nov 12, 2013 12:29:07 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 359 ms
Nov 12, 2013 12:29:07 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 12, 2013 12:29:07 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
Nov 12, 2013 12:29:09 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
com.sun.faces.config.ConfigurationException: no web.xml present
at com.sun.faces.config.ConfigureListener$WebXmlProcessor.scanForFacesServlet(ConfigureListener.java:822)
at com.sun.faces.config.ConfigureListener$WebXmlProcessor.<init>(ConfigureListener.java:782)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:180)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
I already deleted maven web application named 'abc-def-web-app'  from
workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps
(workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps looks corresponds to other tomcat 7 instance i have on my laptop which i am not interested right now as i did not deploy there but deployed on tomcat 6 i.e going to tmp0)

now after this clean up when i redeploy the application and hit the URL getting errors as below

INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
Nov 13, 2013 3:57:23 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)




SEVERE: Error configuring application listener of class org.springframework.web.context.request.RequestContextListener
java.lang.ClassNotFoundException: org.springframework.web.context.request.RequestContextListener
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)

Open in new window


couple of days back everything  working perfect not sure which got messed up later on.

when i deploy on tomcat7 instead of tomcat6 i see latest folder being updated under
workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
with 'abc-def-web-app' with current timestamp but
when i hit the url
http://localhost:8080/abc-def-web-app/
i see error as below
HTTP Status 404 - /abc-def-web-app/

--------------------------------------------------------------------------------

type Status report

message /caf-dif-web-app/

description The requested resource is not available.

please advise
2. mvn eclipse:eclipse
3.  mvn clean install
The first one, generates the Eclipse project files to align it with the maven configuration. The second one, first deletes any previous compiled/generated files, and then recompiles your code, packages as a jar/war/etc and then installs that packaged file into the local maven repository (if the default lifecycle hasn't been changed in the pom.xml)

"environment has been set" not sure what that step either means
I don't know either, this is something particular to your local setup. But I am guessing that env is actually a batch file "env.bat" in that directory that you mention, and so you can open up that file to see what it is actually doing.

there is web.xml. can i delete this file.
If it is empty then, yeah, probably. But this wouldn't be the cause of any of your errors, so I would just leave it alone if I were you.

what this ROOT folder is used for.
The ROOT folder in webapps (or wtpwebapps) supplies all the content that isn't in a specific webapp. For example, your web-app is named "abc-def-web-app" and so you access it via something like http://localhost:8080/abc-def-web-app/..... but if you had a file, say index.jsp, in the ROOT folder, you could access it via http://localhost:8080/index.jsp   (note that there is nothing between the host:port part and the filename part. That is what the ROOT is for.... But again, this won't be having any impact on why you have errors, so I would not focus on this.


The first error that you posted above, I am not sure about because the error has to do with JSF and I haven't used that.

The second error that you are getting (the ClassNotFoundExceptions) looks as though it is due to the spring library jars not being present. For some reason, maybe Eclipse is not deploying them properly, but just from this it is hard to work out why.

The last error (the 404) could be so many things, and since I have no idea about what your webapp is, I can't help here. All I can say, is that for this URL to work as is, you would either need to have a Controller mapped to the "/" resource, or else a correctly configured "welcome-file-list" section in your web.xml that listed a resource that is present in your webapp.
Avatar of gudii9

ASKER

2. mvn eclipse:eclipse
3.  mvn clean install

why we need to execute those commands on the command prompt by going to the 'maven imported source code location(lets say going to --->cd C:\Users\aaaaa\Desktop\aafolder\subverersion_aaaaaaaa) rather than at going to workspace location -->cd C:\Users\eclipse_workspace_aaaaaa).

Please advise
Avatar of gudii9

ASKER

But I am guessing that env is actually a batch file "env.bat" in that directory that you mention, and so you can open up that file to see what it is actually doing.

you are right. I opened and it is batch file where they are setting
JAVA_HOME, M2_HOME, PATH  by referring to one other properties file which has info like java.home and localhostname, server ip address etc.

I wonder what is the need of additional property file again. Please advise
ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial