Images and Tomcat under Fedora
by Wellington L.S. da Silva
I'm new to the list, pretty fresh on Fedora, and this first message of mine
is about how to configure a Fedora box with Tomcat and Java to serve high
definition graphics. I work for the UN and I'm trying to setup a box for my
mapping and eGis projects, but, from time to time, the graphics server
(XServer?) just crashed leaving me bad.
Any ideas on how to serve images (mostly png, jpeg, tiff, or gif) with
Tomcat?
Thanks,
Wellington
18 years, 4 months
How to debug a Tomcat5 servlet on Fedora
by Ryan McDougall
I hope this is one topic for this list, if not a redirect would be
greatly appreciated.
I am trying to set up a simple servlet, which according to various
tutorials, should work. However it doesnt, and I am unable to find out
why. The tomcat manager simply tells me "FAIL - Application at context
path /myservlet could not be started" and thats it.
My question is how can I tease out enough information to discover what
the problem is? I am a decently experienced programmer, so _any_ sekret
kungfu would be helpful. This is a high priority for my company, so
thats all Im working on at the moment, but Im stuck without the tools to
debug+solve my own problem ATM.
Java Source:
import javax.servlet.http.*;
import java.io.*;
public class TestWebApp extends HttpServlet
{
static final long serialVersionUID =0;
public void doPost (HttpServletRequest req, HttpServletResponse resp) throws IOException
{
resp.setContentType ("text/html");
PrintWriter out = resp.getWriter ();
out.println ("w00t");
}
}
web.xml:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4>
<servlet>
<servlet-name>testapp</servlet-name>
<servlet-class>TestWebApp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testapp</servlet-name>
<url-pattern>/myservlet/*.do</url-pattern>
</servlet-mapping>
</web-app>
deployed in $CATALINA_HOME/webapps/myservlet
./myservlet/WEB-INF/web.xml
./myservlet/WEB-INF/classes/TestWebApp.class
./myservlet/WEB-INF/lib
When I try to start the servlet the relevant output of
tail /var/log/tomcat5/localhost_log.2005-12-13.txt:
2005-12-13 11:19:56 StandardContext[/manager]HTMLManager: init: Associated with Deployer 'localhost'
2005-12-13 11:19:56 StandardContext[/manager]HTMLManager: init: Global resources are available
2005-12-13 11:19:56 StandardContext[/manager]HTMLManager: list: Listing contexts for virtual host 'localhost'
2005-12-13 11:20:02 StandardContext[/manager]HTMLManager: start: Starting web application at '/myservlet'
2005-12-13 11:20:02 StandardContext[/manager]HTMLManager: list: Listing contexts for virtual host 'localhost'
Which errors out with:
FAIL - Application at context path /myservlet could not be started
ps. Should be an up-to-date stock fedora core 4:
tomcat5-servlet-2.4-api-javadoc-5.0.30-5jpp_6fc
tomcat5-jasper-5.0.30-5jpp_6fc
tomcat5-jasper-javadoc-5.0.30-5jpp_6fc
tomcat5-5.0.30-5jpp_6fc
tomcat5-webapps-5.0.30-5jpp_6fc
tomcat5-servlet-2.4-api-5.0.30-5jpp_6fc
tomcat5-admin-webapps-5.0.30-5jpp_6fc
java-1.4.2-gcj-compat-debuginfo-1.4.2.0-40jpp_31rh.FC4.2
java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp_31rh.FC4.2
java-1.4.2-gcj-compat-1.4.2.0-40jpp_31rh.FC4.2
libgcj-4.0.2-8.fc4
libgcj-devel-4.0.2-8.fc4
libgcj-src-4.0.2-8.fc4
java-1.4.2-gcj-compat-src-1.4.2.0-40jpp_31rh.FC4.2
but I also have the sun sdk installed:
/usr/sbin/alternatives --display java
java - status is auto.
link currently points to /usr/lib/jvm/jre-1.4.2-gcj/bin/java
/usr/java/jdk1.5.0_04/bin/java - priority 2
slave rmiregistry: /usr/java/jdk1.5.0_04/bin/rmiregistry
slave jre_exports: (null)
slave jre: /usr/java/jdk1.5.0_04/jre/
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
slave jre: /usr/lib/jvm/jre-1.4.2-gcj
Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java.
/usr/sbin/alternatives --display javac
javac - status is auto.
link currently points to /usr/lib/jvm/java-1.4.2-gcj/bin/javac
/usr/lib/jvm/java-1.4.2-gcj/bin/javac - priority 1420
slave java_sdk: /usr/lib/jvm/java-1.4.2-gcj
slave java_sdk_exports: /usr/lib/jvm-exports/java-1.4.2-gcj
slave javadoc: /usr/lib/jvm/java-1.4.2-gcj/bin/javadoc
slave javah: /usr/lib/jvm/java-1.4.2-gcj/bin/javah
slave jar: /usr/lib/jvm/java-1.4.2-gcj/bin/jar
slave rmic: /usr/lib/jvm/java-1.4.2-gcj/bin/rmic
Current `best' version is /usr/lib/jvm/java-1.4.2-gcj/bin/javac.
Cheers,
Ryan
18 years, 4 months
building Eclipse plugins
by Anthony Green
I used to think building Eclipse plugins from source was hard. I don't
know why I didn't notice this before, but you can right click on the
plugin.xml file and generate a build.xml that just works.
So I've packaged the SchemeScript Eclipse plugin. Here's my first crack
at it: http://people.redhat.com/green/FC/SchemeScript-1.1.4-1.src.rpm .
Here's a screenshot:
http://spindazzle.org/green/pics/20051204-SchemeScript.png
SchemeScript is really nice. It works with kawa (in-process or out), or
any number of other external scheme implementations, and has pretty much
every feature you might find in emacs scheme mode and more (backtrace
view, outline view, a special canvas view (see screenshot), terrific
integrated documentation, etc). I hope to get this into Extras for FC5.
AG
18 years, 4 months
xalan build
by Anthony Green
I'm not sure who is working on the GCC 4.1 rebuild of the java packages
right now, but I found I had to apply the following patch to xalan-j2 to
get it to build. This probably has more to do with the recent Eclipse
upgrade more than anything else.
AG
18 years, 4 months
Re: Why does tomcat5 stop automaticlly after started
by Mike Zang
I installed tomcat5 and mod_jk on FC4 as below:
yum install tomcat5 tomcat5-webapps tomcat5-admin-webapps mod_jk
I cound't find startup.sh and stop.sh, there are only three files
in bin:
-rw-r--r-- 1 root root 30231 May 10 2005 bootstrap.jar
-rwxr-xr-x 1 root root 713 May 10 2005 relink
-rwxr-xr-x 1 root root 341 May 10 2005 reloctomcat5
and I used service tomcat5 start,
At the first, the tomcat5 is ok, but after I reboot the server, the
tomcat soon stop after started, I can find it as below after
started:
tomcat 3885 1 18 15:28 pts/2 00:00:06
/usr/lib/jvm/java/bin/java
-Djava.endorsed.dirs=/usr/share/tomcat5/common/endorsed -classpath
/usr/lib/jvm/java/lib/tools.jar:/usr/share/tomcat5/bin/bootstrap.jar:/usr/share/java/commons-logging-api.jar:/usr/share/java/mx4j/mx4j.jar
-Dcatalina.base=/usr/share/tomcat5
-Dcatalina.home=/usr/share/tomcat5
-Djava.io.tmpdir=/usr/share/tomcat5/temp
org.apache.catalina.startup.Bootstrap start
Can you help me?
18 years, 4 months
lib-foo-bar magic name class loading
by Anthony Green
Eclipse starts 15 to 20 seconds faster for me when I start it like so...
eclipse -vmargs -Dgnu.gcj.runtime.VMClassLoader.library_control=never
This is because it's doing over 60,000 fewer failing file-system calls
(trying to open non-existent libraries).
Should we change libgcj's default behaviour? If not, adding
-Dgnu.gcj.runtime.VMClassLoader.library_control=never to startup scripts
like /usr/bin/eclipse seems like a good idea. AFAIK we don't rely on
this old class loading trick.
AG
18 years, 4 months