Promethyl
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.listen er.Startup Listener
org.springframework.beans. factory.Be anCreation Exception: Error creating bean with name 'dataSource' define
d in ServletContext resource [/WEB-INF/applicationConte xt-resourc es.xml]: Initialization of bean failed; n
ested exception is javax.naming.NameNotFoundE xception: Name haterade_news is not bound in this Context
javax.naming.NameNotFoundE xception: 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>
But in the logs I found:
2005-05-12 07:49:31 StandardContext[]Exception
lass org.haterade.webapp.listen
org.springframework.beans.
d in ServletContext resource [/WEB-INF/applicationConte
ested exception is javax.naming.NameNotFoundE
javax.naming.NameNotFoundE
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
<VirtualHost 67.15.xx.xx>
...
<IfModule mod_jk.c>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
</IfModule>
</VirtualHost>
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.
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.
ASKER
Kupra: could you provide a link to some reference on how this is done?
ASKER
pING!
sry for replying late.
can you tell what is "haterade_news"? Is it a datasource name or what?
can you tell what is "haterade_news"? Is it a datasource name or what?
ASKER
It's used on one of the accounts hosted on the webserver. Most likely a ODBC-like connection to a mysql database.
ASKER
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.fac tory.confi g.Property Placeholde rConfigure r">
<property name="locations">
<list>
<value>classpath:mail.prop erties</va lue>
</list>
</property>
</bean>
<!-- JNDI DataSource for J2EE environments -->
<bean id="dataSource" class="org.springframework .jndi.Jndi ObjectFact oryBean">
<property name="jndiName"><value>jav a:comp/env /jdbc/hate rade_news< /value></p roperty>
</bean>
</beans>
<?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
<property name="locations">
<list>
<value>classpath:mail.prop
</list>
</property>
</bean>
<!-- JNDI DataSource for J2EE environments -->
<bean id="dataSource" class="org.springframework
<property name="jndiName"><value>jav
</bean>
</beans>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Kupra: could you provide a link to some reference on how this is done?
ASKER
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.