[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 456
  • Last Modified:

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>
0
Promethyl
Asked:
Promethyl
  • 6
  • 3
1 Solution
 
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
 
PromethylAuthor Commented:
Kupra: could you provide a link to some reference on how this is done?
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 
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
 
kupra1Commented:
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:
Kupra: could you provide a link to some reference on how this is done?

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now