Link to home
Start Free TrialLog in
Avatar of Promethyl
PromethylFlag for United States of America

asked on

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>
Avatar of Promethyl
Promethyl
Flag of United States of America image

ASKER

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.
Avatar of kupra1
kupra1

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

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>




ASKER CERTIFIED SOLUTION
Avatar of kupra1
kupra1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Kupra: could you provide a link to some reference on how this is done?