• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Name jdbc is not bound in this Context :Error TomCat 6

 
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I deploy my war file an start the server I get the following error:

Name jdbc is not bound in this Context.

my datasource is jdbc/EnterpriseAppDS

I have updated the following files:




in my appserver-applicationContext.xml

<bean id="enterpriseDataSource" class="org.springframework.jndi.JndiObjectFactoryB ean" scope="singleton">
<property name="jndiName" value="jdbc/EnterpriseAppDS"/>
</bean>

in my web.xml

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/EnterpriseAppDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>


conf\context.xml
<Resource name="jdbc/EnterpriseAppDS"
auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbcostgresql://mongus.com/mongus_com"
username="scott"
password="tiger"
validationQuery="select now()"
maxWait="1000"
removeAbandoned="true"
maxActive="8"
maxIdle="4"
removeAbandonedTimeout="60"
logAbandoned="true"/>


As its spring on the tc-server-6.0.20.C. Is there anyother file I should update.

The stack trace is :

org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManager
Factory' defined in file [E:\_DEVELOPMENT\ide\springIde\32Bit\tc-server-6.0.20.C\webapps\mo-moses-0.1
.0-SNAPSHOT\WEB-INF\classes\META-INF\spring\applicationContext.xml]: Cannot resolve reference to bean
'enterpriseDataSource' while setting bean property 'dataSource'; nested exception is org.springframe
work.beans.factory.BeanCreationException: Error creating bean with name 'enterpriseDataSource' define
d in URL [file:/E:/_DEVELOPMENT/ide/springIde/32Bit/tc-server-6.0.20.C/webapps/mo-moses-0.1.0-SNAPSHO
T/WEB-INF/classes/META-INF/spring/appserver-applicationContext.xml]: Invocation of init method failed
; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(Bea
nDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecess
ary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyProperty
Values(AbstractAutowireCapableBeanFactory.java:130 5)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(
AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(
AbstractAutowireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(Ab
stractAutowireCapableBeanFactory.java:450)

Thanks for any help


Also I have three context.xml in my tomcat server, any ide what the other two are for:

tc-server-6.0.20.C/webapps/host-manager/META-INF/context.xml
tc-server-6.0.20.C/webapps/manager/META-INF/context.xml
tc-server-6.0.20.C/conf/context.xml
 
Tony Evans
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did not put the sqljdbc-1.0.jar in my \tc-server-6.0.20.C\lib
 
Get me the mayor's office! I need to tell him about this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic