Jakarta Tomcat Shows 404 Instead of Detailed Error Messsage

How can I get Tomcat via the mod_jk connector to correctly report the error instead of issuing at 404? Even a 50x would be better?

But in the logs I found:

2005-05-12 07:49:31 StandardContext[]Exception sending context initialized event to listener instance of c
lass org.haterade.webapp.listener.StartupListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' define
d in ServletContext resource [/WEB-INF/applicationContext-resources.xml]: Initialization of bean failed; n
ested exception is javax.naming.NameNotFoundException: Name haterade_news is not bound in this Context
javax.naming.NameNotFoundException: Name haterade_news is not bound in this Context

Logs/Conf available upon request.

Apache.conf bits:
LoadModule jk_module          libexec/mod_jk.so
AddModule mod_jk.c
Include "/usr/local/apache/conf/jk.conf"

<VirtualHost 67.15.xx.xx>
...
<IfModule mod_jk.c>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
</IfModule>
</VirtualHost>
LVL 7
PromethylAsked:
Who is Participating?
 
kupra1Connect With a Mentor Commented:
So, you need to add the datasource in your tomcat configuration. Go to the admin console of the tomcat and add the datasource.
0
 
PromethylAuthor Commented:
It's important to note also that the server works when  Ilook at a different domain. It's only the configuration directives in this particular users /web-inf/applicationContext-resources.xml which cause it to show a 404.

The 404 is not legitimate in this case. The jsp test page works on other domains.

Wanted to make sure I cleared up the Jakarta/jk/Tomcat system works in most regards.
0
 
kupra1Commented:
The exception is caused by the fact that "haterade_news" is not bound in the context. So, when you are trying to do a jndi lookup and initialize a bean, it fails.
Therefore, it displays the 404 page as that is the exception in case a resource is not found.
So, you need to bind the name "haterade_news" in the context, which you can do that by going to the "Admin" console of tomcat.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
PromethylAuthor Commented:
Kupra: could you provide a link to some reference on how this is done?
0
 
PromethylAuthor Commented:
pING!
0
 
kupra1Commented:
sry for replying late.
can you tell what is "haterade_news"? Is it a datasource name or what?
0
 
PromethylAuthor Commented:
It's used on one of the accounts hosted on the webserver. Most likely a ODBC-like connection to a mysql database.

0
 
PromethylAuthor Commented:
Below is the defintion:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
    <!-- For mail settings and future properties files -->
    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:mail.properties</value>
            </list>
        </property>
    </bean>

    <!-- JNDI DataSource for J2EE environments -->
    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName"><value>java:comp/env/jdbc/haterade_news</value></property>
    </bean>
</beans>




0
 
PromethylAuthor Commented:
Kupra: could you provide a link to some reference on how this is done?

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.