Malcolm Warren

Greenhorn
+ Follow
since Mar 22, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Malcolm Warren

Ok, Earnest, looks like you're right - because whatever I've done so far it looks like Tomcat is saying: "I need graphics here, so I'll open up in a graphics environment". Which explains why it's a tomcat window, and not an Xvfb window - which the system ignored.

Is there any solution, as far as you know, to the problem? For some reason headless doesn't work at all for the only two cases where I need graphics.

1) Where we measure new photos on our system, so that the html pages know in advance the size of photos
2) Creating .pdfs

Any idea why headless won't deal with two normal graphics needs like these?

Meanwhile thanks to everyone for the help and attention.


14 years ago


Try adding a "2> /dev/null".



Thanks for the idea, and I've tried it, but the window still opens. Here's the line in catalina.sh
/usr/X11/bin/Xvfb :1 -screen 0 1152x900x8 2> /dev/null &

I also ran Xvfb from a macintosh plist with the logging directed to the tomcat logs: same problem.
The startup messages came out in the tomcat logs all right, but it still opened a window.

And the other question is: why is the window entitled 'org.apache.catalina.startup.Bootstrap'? (i.e. it's a Tomcat window).
The window only opens when Xvfb is needed, but it doesn't appear to be an Xvfb window.

The only good thing in all this is that at least the graphics programmes do their job. But it causes all sorts of problems (Eclipse can't find tomcat for debugging when the window is open, for example, so I have to close it and restart Tomcat).
14 years ago
Actually Tim, I think you're right. Thanks for the idea. That ought be it.
It's the call to launch Xvfb that needs to finish with > /dev/null
I've copied the line from our production server which looks like this:

/usr/X11/bin/Xvfb :1 -screen 0 1152x900x8 > /dev/null &

But for some reason the window still opens, which is very perplexing.
I'm sure this is on the right track, however.



14 years ago
Thank you Tim, for clearing up the logging business.
Because it made absolutely no sense that graphics and logging had anything to do with each other.

So I'm still stuck with this problem.
Tomcat starts in the background on startup, from a Macintosh plist, and it all works.

Then as soon as a some code that needs graphics starts (one of them measures photo sizes for example), then a tomcat bootstrap window opens up.
And if I close that window, Tomcat stops with it. I'm completely stumped.


14 years ago
Thanks very much, Ulf for your reply.

We spent a lot of time on trying to get headless working and eventually gave up and fell back on Xvfb, which is on our production (Linux) server, so ideally I'd like my test (Mac) server to do the same.

However:
The strange bit is that here on my test (Mac) machine, headless was working, so I wasn't bothering with Xvfb. But suddenly one day a week ago, headless stopped working for no apparent reason. Though I think I know why, and here perhaps you can help.

Headless seems installed by default with Tomcat for logging: can't quite see why but there you are. Because it's part of the options for logging.
Here's the line in catalina.sh
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true"

I've just installed and started using Log4j, and I can only think that this is why headless started complaining.

Does any of this make sense to you? Thanks again.

14 years ago
To get Xvfb working I've added the following code to my catalina.sh script for tomcat on Mac Leopard

DISPLAY=localhost:1.0
export DISPLAY

Then further down in the same script I have the command
/usr/X11/bin/Xvfb :1 -screen 0 1152x900x8

This all goes fine up to a point and I can work.
But as soon as I call some code that needs Xvfb, the Tomcat bootstrap process opens up in its own window, which if closed, shuts down Tomcat.

If I leave the bootstrap window open, I can at least continue working, but this behaviour is a little strange, and I would like solve this, keeping Tomcat working in the background.
Anybody got any ideas what's happening?

Thanks for any help.
14 years ago
Ok, the servlet-mapping hack does work, so it will be a solution until I can recode the URLs. Thanks.

However I still have the context.xml problem, I'd be grateful for any help on that.
14 years ago
Can I do this or similar?

14 years ago
OR could I just add '/servlet' to the servlet names in the web.xml file?
14 years ago
Thanks for the reply. Yes, I think I must be invoker servlet dependant.
So actually all I will have to do is to remove '/servlet' from all my URLs right?
14 years ago
Thank you very much for your reply.
I realise that you can also place them in the /conf/Catalina/localhost/ directory, but what I can't work out is what to call the .xml file for the application that has a "" path to the context, because the path is inferred from the name of the file, right?

14 years ago
I'm trying to upgrade to Tomcat6 from Tomcat 5.0.30 and it's a little frustrating.

However I've reached a point where I've got one of my four applications (contexts) more or less working.
However I have two problems:

1) I'm getting a message saying "The requested resource (/servlet/WriteToAccessLog) is not available". This message appears within the html on the page, but not in any logs at all, not even in the Apache logs.
Anyone got any idea why this should be happening? It's configured normally in the web.xml file where it's been all these years.

2) All my contexts are currently configured in server.xml, but in Tomcat6 they recommend moving the contexts to a context.xml file and I would rather like to move them to the META-INF folder within the application folder, which seems rather neat to me, right there in the application.
The problem is this, I don't have an application named ROOT; I didn't like the name, so years ago, when I was using Tomcat4 I renamed the ROOT application to 'main-app'.
The problem is that this new way of configuring contexts doesn't seem to envisage the lack of a named ROOT application. Because the path="" parameter, which you can use in the server.xml file is no longer used in the new context.xml files and the path is inferred from the name of the .xml file. I presumably can't name a file just ".xml" (I haven't tried), and in the docs they only seem to envisage a ROOT.xml.
I could of course rename my main-app to ROOT, but that's not going to be neat solution as there are references to 'main-app' about the place and I will have to find them and rename them and so on.
Does anyone know of a solution to the problem?

Thanks for any help.

14 years ago