Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » How to debug Web app with Tomcat & Eclipse(JRE mismatch)
How to debug Web app with Tomcat & Eclipse [message #1007205] Tue, 05 February 2013 00:01 Go to next message
siegfried@heintze.com Mising name is currently offline siegfried@heintze.com Mising nameFriend
Messages: 6
Registered: February 2013
Junior Member
I have a web app that runs find with mvn jetty:run and I would like to run it with tomcat.

My value for CATALINA_HOME is "C:\Users\siegfried\Documents\AppBin\tomcat\apache-tomcat-7.0.35".
My value for JAVA_HOME is "c:\Program Files\Java\jdk1.7.0_11".
My value for ECLIPSE_HOME is "C:\Users\siegfried\Documents\AppBin\eclipse\64\eclipse-jee-juno-SR1-win32-x86_64"

Have my project set to us Java 1.7.
To accommodate maven I have inserted these two lines in the top of my eclipse.ini:
-vm
c:\Program Files\Java\jdk1.7.0_11\bin\javaw.exe

I see my Tomcat v7.0 Server at localhost-config. When I run my app I get a dialog box

"Launching Tomcat v7.0 Servr at Localhost' has encountered a problem. The specified JR installation does not exist'.

What the heck am I doing wrong?

Tomcat runs find if I start it directly. I want to start it from eclipse, however, so I can single step thru my java source code.
Thanks
Siegfried
Re: How to debug Web app with Tomcat & Eclipse [message #1007413 is a reply to message #1007205] Tue, 05 February 2013 18:47 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 2/5/2013 9:04 AM, siegfried@xxxxxxxx Mising name wrote:
> I have a web app that runs find with mvn jetty:run and I would like to
> run it with tomcat.
>
> My value for CATALINA_HOME is
> "C:\Users\siegfried\Documents\AppBin\tomcat\apache-tomcat-7.0.35".
> My value for JAVA_HOME is "c:\Program Files\Java\jdk1.7.0_11". My value
> for ECLIPSE_HOME is
> "C:\Users\siegfried\Documents\AppBin\eclipse\64\eclipse-jee-juno-SR1-win32-x86_64"
>
>
> Have my project set to us Java 1.7.
> To accommodate maven I have inserted these two lines in the top of my
> eclipse.ini:
> -vm c:\Program Files\Java\jdk1.7.0_11\bin\javaw.exe
>
> I see my Tomcat v7.0 Server at localhost-config. When I run my app I get
> a dialog box
>
> "Launching Tomcat v7.0 Servr at Localhost' has encountered a problem.
> The specified JR installation does not exist'.
>
> What the heck am I doing wrong?
>
> Tomcat runs find if I start it directly. I want to start it from
> eclipse, however, so I can single step thru my java source code.
> Thanks
> Siegfried
>

Double-click the "Tomcat v7.0 Server at local" in the Servers view. In
the server editor page that opens, click the link for "Runtime
Environment" in the "General Information" section. In the "Edit Server
Runtime Environment" dialog that pops up, the JRE selection is what the
Tomcat will try to run on. You can click on the "Installed JREs" button
to see where that JRE is installed, if it still is. Otherwise pick a
different JRE in the "Edit Server Runtime Environment" dialog.

When you change a server runtime like this, projects which use this
server runtime may not see your update and still reference the old JRE
in the Java Build Path. If this is the case, open the project's
Properties dialog and go to the "Project Facets" page. Select the
"Runtimes" tab on the right. Uncheck the selected runtime and click
Apply, then re-check the runtime and click OK. This will force the
project to update the JRE that the project's Java Build Path is referencing.

Cheers,
Larry
Re: How to debug Web app with Tomcat & Eclipse [message #1007460 is a reply to message #1007413] Tue, 05 February 2013 22:40 Go to previous messageGo to next message
siegfried@heintze.com Mising name is currently offline siegfried@heintze.com Mising nameFriend
Messages: 6
Registered: February 2013
Junior Member
Thanks Larry.
I was not sure which JRE to use.
I tried all the options: "Workbench default JRE", JRE7, and "JDK1.7.0_11" none of them seem to work.

I tried checking and unchecking the runtimes on the the projects facet page.

I'm getting the exact same error. Do you have any more suggestions?

Thanks
Siegfried
Re: How to debug Web app with Tomcat & Eclipse [message #1007600 is a reply to message #1007460] Wed, 06 February 2013 17:05 Go to previous messageGo to next message
siegfried@heintze.com Mising name is currently offline siegfried@heintze.com Mising nameFriend
Messages: 6
Registered: February 2013
Junior Member
I inserted these two lines in the top of my eclipse.ini file to accommodate some error messages I used to get from maven. Could these be causing the problem? Are these lines still necessary to accommodate maven?
I also defined some environment variables like ECLIPSE_HOME and TOMCAT_HOME and CATALINA_HOME. I know the latter needs to be defined. I've defined ECLIPSE_HOME to point to the directory that contains my current eclipse instance. I don't understand the variables I see when mucking around with the java build path -- are these environment variables? I created TOMCAT_HOME because a tutorial on Java/Spring MVC said to. Are these causing problems?

Thanks
Siegfried
Re: How to debug Web app with Tomcat & Eclipse [message #1007658 is a reply to message #1007600] Wed, 06 February 2013 22:24 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 2/6/2013 12:05 PM, siegfried@xxxxxxxx Mising name wrote:
> I inserted these two lines in the top of my eclipse.ini file to
> accommodate some error messages I used to get from maven. Could these be
> causing the problem? Are these lines still necessary to accommodate maven?
> I also defined some environment variables like ECLIPSE_HOME and
> TOMCAT_HOME and CATALINA_HOME. I know the latter needs to be defined.
> I've defined ECLIPSE_HOME to point to the directory that contains my
> current eclipse instance. I don't understand the variables I see when
> mucking around with the java build path -- are these environment
> variables? I created TOMCAT_HOME because a tutorial on Java/Spring MVC
> said to. Are these causing problems?
>
> Thanks
> Siegfried

The thing to be aware of is that each time you launch the Tomcat server
in Eclipse, an associated Eclipse launch configuration (i.e. what you
see under "Apache Tomcat" when you click "Run -> Run Configurations...")
gets generated/updated. This launch configuration defines what will be
used to run Tomcat. It is unaffected by settings you add to
eclipse.ini, etc.

If you double-click the server in the Servers view, you will see the
server editor for this server. For Tomcat, the Server Locations section
establishes where "catalina.base" will point. In the General
Information section, the selected Runtime Enviroment establishes where
catalina.home will point (i.e. it will point to the Tomcat directory you
selected when the runtime was created). The JRE associated with the
selected Runtime Environment will define where the Java that runs Tomcat
will come from. These are all set automatically in the launch
configuration when you start the server.

One thing you can do is to try starting the Tomcat. After it fails,
switch to the Debug perspective. In the Debug view, you should see a
terminated launch for Tomcat. Right click on the first child of the
terminated launch and select "Properties". In the dialog the appears,
the complete command line that Eclipse attempted to execute is
displayed. You can open a DOS window and try to execute this command.
This might make it easier to see what it is about the command line that
is causing a problem. Once you have determined what's wrong, we can try
to see is wrong in your Eclipse workspace that causing that problem in
the command.

Cheers,
Larry

P.S. For some general info about the WTP Tomcat support see:
http://wiki.eclipse.org/WTP_Tomcat_FAQ
Re: How to debug Web app with Tomcat & Eclipse [message #1007682 is a reply to message #1007658] Thu, 07 February 2013 05:16 Go to previous message
siegfried@heintze.com Mising name is currently offline siegfried@heintze.com Mising nameFriend
Messages: 6
Registered: February 2013
Junior Member
It seems this servlet does not work with tomcat 7 as explained at www.objectdb.com/database/forum/501

Thanks for your help!
Previous Topic:change the tomcat startup url to ssl https connector
Next Topic:I need XML validation support
Goto Forum:
  


Current Time: Fri Apr 19 20:54:15 GMT 2024

Powered by FUDForum. Page generated in 0.02825 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top