Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Running Tomcat6 from Eclipse
Running Tomcat6 from Eclipse [message #222593] Tue, 07 October 2008 13:40 Go to next message
Marc Chamberlin is currently offline Marc Chamberlin
Messages: 27
Registered: July 2009
Junior Member
Newbie here so please go easy on me! It has been quite a challenge getting
Tomcat6 and Eclipse Version: 3.4.1 to work together mostly because there
was a broken Manifest.MF in one of the jar files that came with my
SuSE11.0 distribution of Eclipse... sigh...

I have Eclipse configured to use the Tomcat server that is already
installed on my system, and not to create separate instances of it.

Anywise I now have reached the point where I can start and stop Tomcat6
from inside Eclipse but it appears that I have some sort of permissions
problem with creating log files and I cannot figure out how to resolve
this. When I start up Tomcat6, I get the following stack walkbacks
(repeated several times during startup)-

How do I give Tomcat permission, when running under Eclipse, running under
my own Linux account, the permission to create log files when it needs to?
I have tried some of the "obvious" things like adding myself to the tomcat
group, changin permissions on the /var/log/tomcat directory, setting my
user environment variable to tomcat... but so far no joy...

Thanks in advance for help offered... Marc...


java.util.logging.ErrorManager: 4
java.io.FileNotFoundException:
/usr/share/tomcat6/logs/catalina.2008-10-07.log (Permission denied)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:207)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at java.io.FileWriter.<init>(FileWriter.java:78)
at org.apache.juli.FileHandler.open(FileHandler.java:259)
at org.apache.juli.FileHandler.<init>(FileHandler.java:59)
at org.apache.juli.FileHandler.<init>(FileHandler.java:50)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:5 32)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at
org.apache.juli.ClassLoaderLogManager.readConfiguration(Clas sLoaderLogManager.java:398)
at
org.apache.juli.ClassLoaderLogManager.readConfiguration(Clas sLoaderLogManager.java:342)
at
org.apache.juli.ClassLoaderLogManager.readConfiguration(Clas sLoaderLogManager.java:238)
at java.util.logging.LogManager$2.run(LogManager.java:277)
at java.security.AccessController.doPrivileged(Native Method)
at
java.util.logging.LogManager.readPrimordialConfiguration(Log Manager.java:275)
at java.util.logging.LogManager.getLogManager(LogManager.java:2 58)
at java.util.logging.Logger.<init>(Logger.java:238)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:966)
at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:963)
at java.util.logging.LogManager$1.run(LogManager.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:175)
at java.util.logging.Logger.getLogger(Logger.java:291)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:71)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLo g.java:178)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.ja va:170)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.ja va:241)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:29 6)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:54)
Re: Running Tomcat6 from Eclipse [message #222595 is a reply to message #222593] Tue, 07 October 2008 15:25 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3052
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Marc Chamberlin wrote:
> Newbie here so please go easy on me! It has been quite a challenge
> getting Tomcat6 and Eclipse Version: 3.4.1 to work together mostly
> because there was a broken Manifest.MF in one of the jar files that came
> with my SuSE11.0 distribution of Eclipse... sigh...
>
> I have Eclipse configured to use the Tomcat server that is already
> installed on my system, and not to create separate instances of it.
>
> Anywise I now have reached the point where I can start and stop Tomcat6
> from inside Eclipse but it appears that I have some sort of permissions
> problem with creating log files and I cannot figure out how to resolve
> this. When I start up Tomcat6, I get the following stack walkbacks
> (repeated several times during startup)-
>
> How do I give Tomcat permission, when running under Eclipse, running
> under my own Linux account, the permission to create log files when it
> needs to? I have tried some of the "obvious" things like adding myself
> to the tomcat group, changin permissions on the /var/log/tomcat
> directory, setting my user environment variable to tomcat... but so far
> no joy...
> Thanks in advance for help offered... Marc...
>
>
> java.util.logging.ErrorManager: 4
> java.io.FileNotFoundException:
> /usr/share/tomcat6/logs/catalina.2008-10-07.log (Permission denied)
> at java.io.FileOutputStream.openAppend(Native Method)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:207)
> at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
> [snip]
>

You're absolutely on the right track. Ensure owner tomcat and group www
(I think) so that both tomcat and apache can access. I shouldn't think
that setting your environment to tomcat is going to be a useful road to
walk.
Re: Running Tomcat6 from Eclipse [message #222630 is a reply to message #222593] Sun, 12 October 2008 20:50 Go to previous messageGo to next message
Eclipse User
Originally posted by: david_williams.linux.vnet.ibm.com

Marc Chamberlin wrote:
> I have Eclipse configured to use the Tomcat server that is already
> installed on my system, and not to create separate instances of it.
>
Don't take my word for it ... there may be some way to configure your
pre-installed version of Tomcat to get it to work ... but I've heard
some suggest that a pre-installed version is set up and configured for
"production use" and it is therefore better (or, at least easier) to
download your own version and unzip it and use that separately. The
default setup for a simple unzipped version is more for development, and
since you are unzipping, should have all the same permissions as when
you run eclipse. It also has the advantage of leaving your "production
server" as is ... which even if you do not use for production, it is
sometimes handy to have for testing or similar.
Re: Running Tomcat6 from Eclipse [message #222638 is a reply to message #222630] Mon, 13 October 2008 15:27 Go to previous messageGo to next message
Marc Chamberlin is currently offline Marc Chamberlin
Messages: 27
Registered: July 2009
Junior Member
David Williams wrote:
> Marc Chamberlin wrote:
>> I have Eclipse configured to use the Tomcat server that is already
>> installed on my system, and not to create separate instances of it.
>>
> Don't take my word for it ... there may be some way to configure your
> pre-installed version of Tomcat to get it to work ... but I've heard
> some suggest that a pre-installed version is set up and configured for
> "production use" and it is therefore better (or, at least easier) to
> download your own version and unzip it and use that separately. The
> default setup for a simple unzipped version is more for development, and
> since you are unzipping, should have all the same permissions as when
> you run eclipse. It also has the advantage of leaving your "production
> server" as is ... which even if you do not use for production, it is
> sometimes handy to have for testing or similar.
>
>

Thanks Russ and David for your replies. I don't fully understand how
permissions and Tomcat/Eclipse all work together and gave up on
trying... So until I understand this better I (like I do with much of
Linux) just went through everything and gave all owner/group/everyone
read/write/execute permissions on all files and directories touched by
either Tomcat or Eclipse... Sometimes I feel like Linux security
policies really just get in the way of productivity. I wish there was a
document somewhere explaining clearly what all is required for setting
up users/permissions for both Tomcat and Eclipse?? Anywise that seemed
to fix the permissions problem I was having for the moment...

As for running a separate Tomcat from my production version, I will
consider it as a possible solution, but we have a very complex
environment (controlling telescopes from the internet) and trying to do
so will add a lot of complicated issues elsewhere so I am reluctant to
attempt a separate development environment right now.. I know there is
risk and have taken precautions backing up everything first...

All this leads me now to my next questions - We do not understand how to
control the publishing of new servlets, and other changes to the Tomcat
server directories, when we make changes in Eclipse to them. We have
managed to do so under very simple conditions but we have also failed
and we do not understand how we cause things to be published. Same goes
for debugging servlets, sometimes we can and sometimes we cannot get
them to run at all and don't understand why... Is there a clear
explanation somewhere of the underlying model for interacting with the
Tomcat server from Eclipse? Is there a way to FORCE a publication to
take place? Or better yet to rebuild all the config and webapp
directories that are set up in Eclipse and need to be moved to the real
Tomcat directories? Ditto questions on the reverse side, when does
Eclipse pick up information from the Tomcat directories and incorporate
it in its own workspace? And is there a way to FORCE this? We found lots
of stuff on how to set up a new WebApp and configure Tomcat but we have
not been able to develop an understanding of the details on how
publication works, and where to look to figure out why it works
sometimes and other times it does not.... It seems quite confusing and
believe me when I say we have spent hours trying to develop this
understanding and debugging the process....

Marc...
Re: Running Tomcat6 from Eclipse [message #222639 is a reply to message #222638] Mon, 13 October 2008 18:46 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3052
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Marc Chamberlin wrote:
> David Williams wrote:
>> Marc Chamberlin wrote:
>>> I have Eclipse configured to use the Tomcat server that is already
>>> installed on my system, and not to create separate instances of it.
>>>
>> Don't take my word for it ... there may be some way to configure your
>> pre-installed version of Tomcat to get it to work ... but I've heard
>> some suggest that a pre-installed version is set up and configured for
>> "production use" and it is therefore better (or, at least easier) to
>> download your own version and unzip it and use that separately. The
>> default setup for a simple unzipped version is more for development,
>> and since you are unzipping, should have all the same permissions as
>> when you run eclipse. It also has the advantage of leaving your
>> "production server" as is ... which even if you do not use for
>> production, it is sometimes handy to have for testing or similar.
>>
>>
>
> Thanks Russ and David for your replies. I don't fully understand how
> permissions and Tomcat/Eclipse all work together and gave up on
> trying... So until I understand this better I (like I do with much of
> Linux) just went through everything and gave all owner/group/everyone
> read/write/execute permissions on all files and directories touched by
> either Tomcat or Eclipse... Sometimes I feel like Linux security
> policies really just get in the way of productivity. I wish there was a
> document somewhere explaining clearly what all is required for setting
> up users/permissions for both Tomcat and Eclipse?? Anywise that seemed
> to fix the permissions problem I was having for the moment...
>
> As for running a separate Tomcat from my production version, I will
> consider it as a possible solution, but we have a very complex
> environment (controlling telescopes from the internet) and trying to do
> so will add a lot of complicated issues elsewhere so I am reluctant to
> attempt a separate development environment right now.. I know there is
> risk and have taken precautions backing up everything first...
>
> All this leads me now to my next questions - We do not understand how to
> control the publishing of new servlets, and other changes to the Tomcat
> server directories, when we make changes in Eclipse to them. We have
> managed to do so under very simple conditions but we have also failed
> and we do not understand how we cause things to be published. Same goes
> for debugging servlets, sometimes we can and sometimes we cannot get
> them to run at all and don't understand why... Is there a clear
> explanation somewhere of the underlying model for interacting with the
> Tomcat server from Eclipse? Is there a way to FORCE a publication to
> take place? Or better yet to rebuild all the config and webapp
> directories that are set up in Eclipse and need to be moved to the real
> Tomcat directories? Ditto questions on the reverse side, when does
> Eclipse pick up information from the Tomcat directories and incorporate
> it in its own workspace? And is there a way to FORCE this? We found lots
> of stuff on how to set up a new WebApp and configure Tomcat but we have
> not been able to develop an understanding of the details on how
> publication works, and where to look to figure out why it works
> sometimes and other times it does not.... It seems quite confusing and
> believe me when I say we have spent hours trying to develop this
> understanding and debugging the process....
>
> Marc...

Marc,

I should have been able to help you more as I work on Linux and have the
same problems with privileges, however, what I told you is what I needed
to fix my problems.

Our product ships with its own Tomcat since we have to manage the
version and some other stuff (JARs) very carefully in order to support
our product. Aspects of this change from version to version too.
Distributing your own Tomcat with your software already "installed"
might not be a bad idea for you to consider. It does not harm the Tomcat
present on the target host either; different Tomcats even with different
versions can co-exist. And Tomcat isn't that big, so it's not like you'd
be burdening the filesystem.

Russ
Re: Running Tomcat6 from Eclipse [message #222644 is a reply to message #222638] Tue, 14 October 2008 09:28 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1287
Registered: July 2009
Senior Member
Marc Chamberlin wrote:
> David Williams wrote:
>> Marc Chamberlin wrote:
>>> I have Eclipse configured to use the Tomcat server that is already
>>> installed on my system, and not to create separate instances of it.
>>>
>> Don't take my word for it ... there may be some way to configure your
>> pre-installed version of Tomcat to get it to work ... but I've heard
>> some suggest that a pre-installed version is set up and configured for
>> "production use" and it is therefore better (or, at least easier) to
>> download your own version and unzip it and use that separately. The
>> default setup for a simple unzipped version is more for development,
>> and since you are unzipping, should have all the same permissions as
>> when you run eclipse. It also has the advantage of leaving your
>> "production server" as is ... which even if you do not use for
>> production, it is sometimes handy to have for testing or similar.
>>
>>
>
> Thanks Russ and David for your replies. I don't fully understand how
> permissions and Tomcat/Eclipse all work together and gave up on
> trying... So until I understand this better I (like I do with much of
> Linux) just went through everything and gave all owner/group/everyone
> read/write/execute permissions on all files and directories touched by
> either Tomcat or Eclipse... Sometimes I feel like Linux security
> policies really just get in the way of productivity. I wish there was a
> document somewhere explaining clearly what all is required for setting
> up users/permissions for both Tomcat and Eclipse?? Anywise that seemed
> to fix the permissions problem I was having for the moment...
>
> As for running a separate Tomcat from my production version, I will
> consider it as a possible solution, but we have a very complex
> environment (controlling telescopes from the internet) and trying to do
> so will add a lot of complicated issues elsewhere so I am reluctant to
> attempt a separate development environment right now.. I know there is
> risk and have taken precautions backing up everything first...
>
> All this leads me now to my next questions - We do not understand how to
> control the publishing of new servlets, and other changes to the Tomcat
> server directories, when we make changes in Eclipse to them. We have
> managed to do so under very simple conditions but we have also failed
> and we do not understand how we cause things to be published. Same goes
> for debugging servlets, sometimes we can and sometimes we cannot get
> them to run at all and don't understand why... Is there a clear
> explanation somewhere of the underlying model for interacting with the
> Tomcat server from Eclipse?

What exists is found here: http://wiki.eclipse.org/WTP_Tomcat_FAQ. Note
that though WTP 3.0.x is hardly mentioned specifically, the info for WTP
2.0.x applies for WTP 3.0.x.

My guess is the confusion is coming from more that just what Eclipse is
doing, but also how Tomcat is reacting and the nature of the changes.
For example, if you are running the server in debug mode and want to
hotfix a servlet without restarting the server, then you must turn off
Tomcat's auto-reload feature for the context serving that project's
module. Otherwise, saving the change will trigger Tomcat to restart
that context which will recreate a "new" context serving the module.
The Eclipse debugger is left connected to a servlet class in stale
webapp classloader which isn't being used anymore. Obviously,
unexpected behavior is likely to occur at that point.

> Is there a way to FORCE a publication to
> take place?

Click the Publish button in the Servers view or right-click on the
server and select Publish.

> Or better yet to rebuild all the config and webapp
> directories that are set up in Eclipse and need to be moved to the real
> Tomcat directories?

Right-click on the server in the Servers view and select "Clean...".
This publishes the server and does a full publish of all the modules
added to the server.

> Ditto questions on the reverse side, when does
> Eclipse pick up information from the Tomcat directories and incorporate
> it in its own workspace?

When a Tomcat server is created, contents of certain configuration files
are imported into the Servers project in the workspace from the Tomcat
installation. That is the only time configuration files from the
original installation are read. For details, see:
http://wiki.eclipse.org/WTP_Tomcat_FAQ#When_I_create_my_firs t_Tomcat_server.2C_why_is_a_Servers_project_created_in_my_wo rkspace.3F

> And is there a way to FORCE this?

It depends on what it is you are trying to "pick up".

> We found lots
> of stuff on how to set up a new WebApp and configure Tomcat but we have
> not been able to develop an understanding of the details on how
> publication works, and where to look to figure out why it works
> sometimes and other times it does not.... It seems quite confusing and
> believe me when I say we have spent hours trying to develop this
> understanding and debugging the process....

It's hard to comment on something this general. If you can supply the
specifics for a particular scenario, I'll see what explanation I can
provide.

Cheers,
Larry

>
> Marc...
>
>
>
>
Re: Running Tomcat6 from Eclipse [message #222807 is a reply to message #222644] Mon, 20 October 2008 14:26 Go to previous messageGo to next message
Marc Chamberlin is currently offline Marc Chamberlin
Messages: 27
Registered: July 2009
Junior Member
Larry Isaacs wrote:
> Marc Chamberlin wrote:
>> David Williams wrote:
>>> Marc Chamberlin wrote:
>>>> I have Eclipse configured to use the Tomcat server that is already
>>>> installed on my system, and not to create separate instances of it.
>>>>
>>> Don't take my word for it ... there may be some way to configure your
>>> pre-installed version of Tomcat to get it to work ... but I've heard
>>> some suggest that a pre-installed version is set up and configured
>>> for "production use" and it is therefore better (or, at least easier)
>>> to download your own version and unzip it and use that separately.
>>> The default setup for a simple unzipped version is more for
>>> development, and since you are unzipping, should have all the same
>>> permissions as when you run eclipse. It also has the advantage of
>>> leaving your "production server" as is ... which even if you do not
>>> use for production, it is sometimes handy to have for testing or
>>> similar.
>>>
>>>
>>
>> Thanks Russ and David for your replies. I don't fully understand how
>> permissions and Tomcat/Eclipse all work together and gave up on
>> trying... So until I understand this better I (like I do with much of
>> Linux) just went through everything and gave all owner/group/everyone
>> read/write/execute permissions on all files and directories touched by
>> either Tomcat or Eclipse... Sometimes I feel like Linux security
>> policies really just get in the way of productivity. I wish there was
>> a document somewhere explaining clearly what all is required for
>> setting up users/permissions for both Tomcat and Eclipse?? Anywise
>> that seemed to fix the permissions problem I was having for the moment...
>>
>> As for running a separate Tomcat from my production version, I will
>> consider it as a possible solution, but we have a very complex
>> environment (controlling telescopes from the internet) and trying to
>> do so will add a lot of complicated issues elsewhere so I am reluctant
>> to attempt a separate development environment right now.. I know there
>> is risk and have taken precautions backing up everything first...
>>
>> All this leads me now to my next questions - We do not understand how
>> to control the publishing of new servlets, and other changes to the
>> Tomcat server directories, when we make changes in Eclipse to them. We
>> have managed to do so under very simple conditions but we have also
>> failed and we do not understand how we cause things to be published.
>> Same goes for debugging servlets, sometimes we can and sometimes we
>> cannot get them to run at all and don't understand why... Is there a
>> clear explanation somewhere of the underlying model for interacting
>> with the Tomcat server from Eclipse?
>
> What exists is found here: http://wiki.eclipse.org/WTP_Tomcat_FAQ. Note
> that though WTP 3.0.x is hardly mentioned specifically, the info for WTP
> 2.0.x applies for WTP 3.0.x.
>
> My guess is the confusion is coming from more that just what Eclipse is
> doing, but also how Tomcat is reacting and the nature of the changes.
> For example, if you are running the server in debug mode and want to
> hotfix a servlet without restarting the server, then you must turn off
> Tomcat's auto-reload feature for the context serving that project's
> module. Otherwise, saving the change will trigger Tomcat to restart
> that context which will recreate a "new" context serving the module. The
> Eclipse debugger is left connected to a servlet class in stale webapp
> classloader which isn't being used anymore. Obviously, unexpected
> behavior is likely to occur at that point.
>
>> Is there a way to FORCE a publication to take place?
>
> Click the Publish button in the Servers view or right-click on the
> server and select Publish.
>
>> Or better yet to rebuild all the config and webapp directories that
>> are set up in Eclipse and need to be moved to the real Tomcat
>> directories?
>
> Right-click on the server in the Servers view and select "Clean...".
> This publishes the server and does a full publish of all the modules
> added to the server.
>
>> Ditto questions on the reverse side, when does Eclipse pick up
>> information from the Tomcat directories and incorporate it in its own
>> workspace?
>
> When a Tomcat server is created, contents of certain configuration files
> are imported into the Servers project in the workspace from the Tomcat
> installation. That is the only time configuration files from the
> original installation are read. For details, see:
> http://wiki.eclipse.org/WTP_Tomcat_FAQ#When_I_create_my_firs t_Tomcat_server.2C_why_is_a_Servers_project_created_in_my_wo rkspace.3F
>
>
>> And is there a way to FORCE this?
>
> It depends on what it is you are trying to "pick up".
>
>> We found lots of stuff on how to set up a new WebApp and configure
>> Tomcat but we have not been able to develop an understanding of the
>> details on how publication works, and where to look to figure out why
>> it works sometimes and other times it does not.... It seems quite
>> confusing and believe me when I say we have spent hours trying to
>> develop this understanding and debugging the process....
>
> It's hard to comment on something this general. If you can supply the
> specifics for a particular scenario, I'll see what explanation I can
> provide.
>
> Cheers,
> Larry
>
>>
>> Marc...
>>
>>
>>
>>


Thanks Larry and Russ for your help and replies. We are making progress
on getting Tomcat6 and Eclipse to work together but still have issues
remaining. Our main headache at the moment is figuring out how multiple
developers can work on development of our webapps together.

We have an environment that is probably somewhat unique and constrains
us. Our Tomcat server is part of an integrated environment/network that
prevents us from developing on separate instances of it. It must work
from a single computer and use ports that are assigned for various
purposes. It is NOT simply a stand alone web server, instead it is
acting in concert with a number of applications and other systems in a
machine (telescope) control application. We use servlets to both
interact with users AND to interact with and control various other
machine controllers, so for this reason it is NOT possible to work with
separate Tomcat servers without running into all kinds of port and
communications conflicts.

We want to use Eclipse, and have each developer deploy applications on
the server as WAR files, and have the main, one and only, instance of
our "production" Tomcat automatically deploy them. (If that requires we
must shut down and restart Tomcat, that is OK) At times we are also
going to want to interact with this Tomcat while debugging. And yes we
know at times this will cause crashes or other headaches but we have no
choice on this environment.

The biggest trouble we are running into is how to control ownership and
permissions set on the deployed WAR files. Tomcat runs under
tomcat:tomcat as its user:group id. When WAR files are deployed they
expand under the user:group id of the developer and this is the first
point of contention. We need to be able to deploy WAR files under the
ownership of tomcat:tomcat automatically. We have not been able to
figure out how to change the ownership of WAR files to tomcat:tomcat
automatically. The same goes for the permissions assigned to the
deployed files, for some of them we have to go in by hand (we are
thinking about a script but it gets messy to maintain) and change
permissions. Right now we are simply setting all permissions recursively
to 777 on all Tomcat files. It is NOT just Tomcat that needs to access
some of these files but other processes as well, via daemons.

Also Tomcat/Eclipse sets up some internal work files for Tomcat inside
its TOMCAT_HOME/work/Catalina/localhost and the ownership and
permissions assigned to some of these often leads to additional failures
such as being able to write/create new directories and files as needed.

We have other issues but I want to tackle just this one for now. Again
thanks in advance for any and all help offered.

Marc....
Re: Running Tomcat6 from Eclipse [message #222816 is a reply to message #222807] Mon, 20 October 2008 15:59 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1287
Registered: July 2009
Senior Member
Marc Chamberlin wrote:
> Larry Isaacs wrote:
>> Marc Chamberlin wrote:
>>> David Williams wrote:
>>>> Marc Chamberlin wrote:
>>>>> I have Eclipse configured to use the Tomcat server that is already
>>>>> installed on my system, and not to create separate instances of it.
>>>>>
>>>> Don't take my word for it ... there may be some way to configure
>>>> your pre-installed version of Tomcat to get it to work ... but I've
>>>> heard some suggest that a pre-installed version is set up and
>>>> configured for "production use" and it is therefore better (or, at
>>>> least easier) to download your own version and unzip it and use that
>>>> separately. The default setup for a simple unzipped version is more
>>>> for development, and since you are unzipping, should have all the
>>>> same permissions as when you run eclipse. It also has the advantage
>>>> of leaving your "production server" as is ... which even if you do
>>>> not use for production, it is sometimes handy to have for testing or
>>>> similar.
>>>>
>>>>
>>>
>>> Thanks Russ and David for your replies. I don't fully understand how
>>> permissions and Tomcat/Eclipse all work together and gave up on
>>> trying... So until I understand this better I (like I do with much of
>>> Linux) just went through everything and gave all owner/group/everyone
>>> read/write/execute permissions on all files and directories touched
>>> by either Tomcat or Eclipse... Sometimes I feel like Linux security
>>> policies really just get in the way of productivity. I wish there was
>>> a document somewhere explaining clearly what all is required for
>>> setting up users/permissions for both Tomcat and Eclipse?? Anywise
>>> that seemed to fix the permissions problem I was having for the
>>> moment...
>>>
>>> As for running a separate Tomcat from my production version, I will
>>> consider it as a possible solution, but we have a very complex
>>> environment (controlling telescopes from the internet) and trying to
>>> do so will add a lot of complicated issues elsewhere so I am
>>> reluctant to attempt a separate development environment right now.. I
>>> know there is risk and have taken precautions backing up everything
>>> first...
>>>
>>> All this leads me now to my next questions - We do not understand how
>>> to control the publishing of new servlets, and other changes to the
>>> Tomcat server directories, when we make changes in Eclipse to them.
>>> We have managed to do so under very simple conditions but we have
>>> also failed and we do not understand how we cause things to be
>>> published. Same goes for debugging servlets, sometimes we can and
>>> sometimes we cannot get them to run at all and don't understand
>>> why... Is there a clear explanation somewhere of the underlying model
>>> for interacting with the Tomcat server from Eclipse?
>>
>> What exists is found here: http://wiki.eclipse.org/WTP_Tomcat_FAQ.
>> Note that though WTP 3.0.x is hardly mentioned specifically, the info
>> for WTP 2.0.x applies for WTP 3.0.x.
>>
>> My guess is the confusion is coming from more that just what Eclipse
>> is doing, but also how Tomcat is reacting and the nature of the
>> changes. For example, if you are running the server in debug mode and
>> want to hotfix a servlet without restarting the server, then you must
>> turn off Tomcat's auto-reload feature for the context serving that
>> project's module. Otherwise, saving the change will trigger Tomcat to
>> restart that context which will recreate a "new" context serving the
>> module. The Eclipse debugger is left connected to a servlet class in
>> stale webapp classloader which isn't being used anymore. Obviously,
>> unexpected behavior is likely to occur at that point.
>>
>>> Is there a way to FORCE a publication to take place?
>>
>> Click the Publish button in the Servers view or right-click on the
>> server and select Publish.
>>
>>> Or better yet to rebuild all the config and webapp directories that
>>> are set up in Eclipse and need to be moved to the real Tomcat
>>> directories?
>>
>> Right-click on the server in the Servers view and select "Clean...".
>> This publishes the server and does a full publish of all the modules
>> added to the server.
>>
>>> Ditto questions on the reverse side, when does Eclipse pick up
>>> information from the Tomcat directories and incorporate it in its own
>>> workspace?
>>
>> When a Tomcat server is created, contents of certain configuration
>> files are imported into the Servers project in the workspace from the
>> Tomcat installation. That is the only time configuration files from
>> the original installation are read. For details, see:
>> http://wiki.eclipse.org/WTP_Tomcat_FAQ#When_I_create_my_firs t_Tomcat_server.2C_why_is_a_Servers_project_created_in_my_wo rkspace.3F
>>
>>
>>> And is there a way to FORCE this?
>>
>> It depends on what it is you are trying to "pick up".
>>
>>> We found lots of stuff on how to set up a new WebApp and configure
>>> Tomcat but we have not been able to develop an understanding of the
>>> details on how publication works, and where to look to figure out why
>>> it works sometimes and other times it does not.... It seems quite
>>> confusing and believe me when I say we have spent hours trying to
>>> develop this understanding and debugging the process....
>>
>> It's hard to comment on something this general. If you can supply the
>> specifics for a particular scenario, I'll see what explanation I can
>> provide.
>>
>> Cheers,
>> Larry
>>
>>>
>>> Marc...
>>>
>>>
>>>
>>>
>
>
> Thanks Larry and Russ for your help and replies. We are making progress
> on getting Tomcat6 and Eclipse to work together but still have issues
> remaining. Our main headache at the moment is figuring out how multiple
> developers can work on development of our webapps together.
>
> We have an environment that is probably somewhat unique and constrains
> us. Our Tomcat server is part of an integrated environment/network that
> prevents us from developing on separate instances of it. It must work
> from a single computer and use ports that are assigned for various
> purposes. It is NOT simply a stand alone web server, instead it is
> acting in concert with a number of applications and other systems in a
> machine (telescope) control application. We use servlets to both
> interact with users AND to interact with and control various other
> machine controllers, so for this reason it is NOT possible to work with
> separate Tomcat servers without running into all kinds of port and
> communications conflicts.

I don't think the Tomcat adapter in WTP is going to work well with this
use case. The Tomcat adapter assumes it has control over the server
which isn't compatible with your use case. As I've never dealt with a
use case like this before, all I can suggest is to see what Ant can do
to help (if you haven't already) once you have exported the WAR from
Eclipse.

Cheers,
Larry

>
> We want to use Eclipse, and have each developer deploy applications on
> the server as WAR files, and have the main, one and only, instance of
> our "production" Tomcat automatically deploy them. (If that requires we
> must shut down and restart Tomcat, that is OK) At times we are also
> going to want to interact with this Tomcat while debugging. And yes we
> know at times this will cause crashes or other headaches but we have no
> choice on this environment.
>
> The biggest trouble we are running into is how to control ownership and
> permissions set on the deployed WAR files. Tomcat runs under
> tomcat:tomcat as its user:group id. When WAR files are deployed they
> expand under the user:group id of the developer and this is the first
> point of contention. We need to be able to deploy WAR files under the
> ownership of tomcat:tomcat automatically. We have not been able to
> figure out how to change the ownership of WAR files to tomcat:tomcat
> automatically. The same goes for the permissions assigned to the
> deployed files, for some of them we have to go in by hand (we are
> thinking about a script but it gets messy to maintain) and change
> permissions. Right now we are simply setting all permissions recursively
> to 777 on all Tomcat files. It is NOT just Tomcat that needs to access
> some of these files but other processes as well, via daemons.
>
> Also Tomcat/Eclipse sets up some internal work files for Tomcat inside
> its TOMCAT_HOME/work/Catalina/localhost and the ownership and
> permissions assigned to some of these often leads to additional failures
> such as being able to write/create new directories and files as needed.
>
> We have other issues but I want to tackle just this one for now. Again
> thanks in advance for any and all help offered.
>
> Marc....
Previous Topic:Call for screenshots
Next Topic:Re: How to create a "document literal wrapped" WSDL ?
Goto Forum:
  


Current Time: Sat Apr 19 06:08:18 EDT 2014

Powered by FUDForum. Page generated in 0.04213 seconds