Results 1 to 8 of 8

Thread: springs deployed on tomcat

  1. #1
    Join Date
    Apr 2006
    Location
    Chicago
    Posts
    76

    Default springs deployed on tomcat

    any clue why this occurs?

    ERROR springframework.web.servlet.DispatcherServlet : [] Context initialization failed

  2. #2
    Join Date
    Feb 2007
    Posts
    4

    Default Erroneous application-servlet file.

    One of the bean couldn't able to load properly in the application context and caused error. Please set the log level to debug and see the exact error.

  3. #3
    Join Date
    Apr 2006
    Location
    Chicago
    Posts
    76

    Default its the JNDI Naming, any known way of dealing this?

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/config/applicationContext.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:403)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:233)
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:277)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:313)
    org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:139)
    org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:246)
    org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:184)
    org.springframework.web.context.ContextLoaderServl et.init(ContextLoaderServlet.java:83)
    javax.servlet.GenericServlet.init(GenericServlet.j ava:258)
    org.apache.catalina.startup.Catalina.start(Catalin a.java:551)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:294)
    org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:432)

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    It's a matter of configuration. Apparently you haven't set up your jndi datasource correctly.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Feb 2007
    Posts
    4

    Default Data source is not defined in the JNDI

    You need to set-up the connection pool at appliaction level and register with jndi.

  6. #6
    Join Date
    Apr 2006
    Location
    Chicago
    Posts
    76

    Default jndi config

    <bean id="securityDataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName" value="jdbc/adfSecurityOra" />
    </bean>


    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
    <property name="dataSource">
    <ref bean="securityDataSource" />
    </property>
    </bean>

  7. #7
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    That isn't the JNDI configuration, that is the lookup of the datasource from jndi. It doesn't register the datasource with jndi. Check the tomcat docs on how to register a datasource.

    If you are sure everything is configured ok in tomcat and the error still occurs prefixing the jndi name with java:/comp/env/ might help.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  8. #8
    Join Date
    Apr 2006
    Location
    Chicago
    Posts
    76

    Default cp at app level

    <Context path="/adfsrWeb" debug="99" reloadable="true"
    antiJARLocking="true" antiResourceLocking="false">

    <Resource name="jdbc/adfsrcOra" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    username="ADF_WEB" password="webdev"
    url="jdbc:oracle:thin:@xxxxxxxxxx"
    defaultAutoCommit="true" removeAbandoned="true"
    removeAbandonedTimeout="60" logAbandoned="true"/>

    <Resource name="jdbc/adfSecurityOra" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000"
    driverClassName="oracle.jdbc.driver.OracleDriver"
    username="ADF_WEB" password="webdev"
    url="jdbc:oracle:thin:@xxxxxxxxxxxxxxxxx"
    defaultAutoCommit="true" removeAbandoned="true"
    removeAbandonedTimeout="60" logAbandoned="true"/>
    </Context>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •