Announcement Announcement Module
Collapse
No announcement yet.
Help V4.0 datasource error in Websphere? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help V4.0 datasource error in Websphere?

    This is my first project using spring frameworks. I am getting this error when setting my datasource using the jndi lookup. Does this mean that I can't use spring if I am using a V4 datasource?

    8/13/04 9:36:41:078 PDT] 673c1ebe XmlWebApplica I org.springframework.web.context.support.XmlWebAppl icationContext Refreshing listeners
    [8/13/04 9:36:41:078 PDT] 673c1ebe DefaultListab I org.springframework.beans.factory.support.DefaultL istableBeanFactory Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [propertyConfigurer,messageSource,myDataSource,sess ionFactory,transactionManager,clinicTarget,clinic]; Root of BeanFactory hierarchy]
    [8/13/04 9:36:41:078 PDT] 673c1ebe DefaultListab I org.springframework.beans.factory.support.DefaultL istableBeanFactory Creating shared instance of singleton bean 'myDataSource'
    [8/13/04 9:36:41:578 PDT] 673c1ebe DSFactoryImpl E CONM7019E: Attempted to use a 4.0 DataSource from a version 2.3 (or higher) servlet. Invalid configuration.
    [8/13/04 9:36:41:703 PDT] 673c1ebe Helpers W NMSV0605W: A Reference object looked up from the context "localhost/nodes/localhost/servers/server1" with the name "jdbc/xep" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:
    Reference Factory Class Name: com.ibm.websphere.advanced.cm.factory.DataSourceFa ctory$ResourceReferenceObjectFactory
    Reference Factory Class Location URLs: <null>
    Reference Class Name: com.ibm.ejs.cm.portability.PortableDataSource
    Exception data follows:
    javax.naming.NamingException: Attempted to use a 4.0 DataSource from a 2.3 (or higher) servlet. Invalid configuration.
    at com.ibm.ejs.cm.DSFactoryImpl.verifyConfiguration(D SFactoryImpl.java:237)
    at com.ibm.websphere.advanced.cm.factory.DataSourceFa ctory$ResourceReferenceObjectFactory.getObjectInst ance(DataSourceFactory.java:733)

    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
    <property name="location"><value>/WEB-INF/jdbc.properties</value>
    </property>
    </bean>
    <!-- Message source for this context, loaded from localized "messages_xx" files
    -->
    <bean id="messageSource" class="org.springframework.context.support.Resourc eBundleMessageSource" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
    <property name="basename"><value>messages</value>
    </property>
    </bean>


    <!-- ========================= PERSISTENCE DEFINITIONS ========================= -->

    <!--
    - Makes a JNDI DataSource available as bean reference, assuming a J2EE environment.
    - By default, "java:comp/env/" will be prepended if not already specified.
    -->
    <bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName"><value>jdbc/xep</value></property>
    </bean>

  • #2
    I don't think this is spring-specific: "Attempted to use a 4.0 DataSource from a 2.3 (or higher) servlet. " You should be getting this message anywhere you attempt to get the reference to that datasource from any of your servlets.

    You'll need to either drop your servlet down to 2.2 (in web.xml I believe...you can also in wsad right-click the project and select properties->Web->J2EE version...sorry I don't have wsad right here...think thats right though), or (probably better) jump your datasource to a version 5 datasource (re-create the datasource and indicate it is a version 5 datasource). I don't think I had any issues moving my datasources to 5 (thats not to say there wont be any).

    Comment


    • #3
      Just a comment on the comment in the xml file, "By default, "java:comp/env/" will be prepended if not already specified.":

      This is what spring used to do a long time ago to JNDI names. It doesn't do this any longer by default, unless you set the 'resourceRef' property of the jndi locator subclass (such as the JndiObjectFactoryBean) to true.

      That doesn't have anything to do with this issue. If you're getting that error message, it means the datasource is being accessed at the right path, as far as I can tell, and the error message is a container config. problem as per the first reply above.

      Regards,

      Comment


      • #4
        Thanks I was stuck there for awhile I thought it was spring's jndi lookup routine. I on to my next errors.

        Comment


        • #5
          My first Spring project too in WSAD 5.1.2

          Hi,

          I'm hoping you can help me with this error I'm getting
          I'm getting this error

          [8/15/04 22:19:28:440 GMT-05:00] 3ce0163c DispatcherSer I org.springframework.web.servlet.DispatcherServlet Servlet with name 'springapp' will try to create custom WebApplicationContext context of class 'org.springframework.web.context.support.XmlWebApp licationContext' using parent context [null]
          [8/15/04 22:19:28:770 GMT-05:00] 3ce0163c XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefin itionReader Loading XML bean definitions from resource [/WEB-INF/springapp-servlet.xml] of ServletContext
          [8/15/04 22:19:28:861 GMT-05:00] 3ce0163c DispatcherSer E org.springframework.web.servlet.DispatcherServlet Context initialization failed
          [8/15/04 22:19:28:881 GMT-05:00] 3ce0163c DispatcherSer E org.springframework.web.servlet.DispatcherServlet TRAS0014I: The following exception was logged org.springframework.beans.factory.BeanDefinitionSt oreException: Error registering bean with name 'springappController' defined in resource [/WEB-INF/springapp-servlet.xml] of ServletContext: Bean class [SpringappController] not found; nested exception is java.lang.ClassNotFoundException: SpringappController
          java.lang.ClassNotFoundException: SpringappController


          Thanks

          Comment


          • #6
            My first Spring project too in WSAD 5.1.2

            Hi,

            I'm hoping you can help me with this error I'm getting
            I'm getting this error

            [8/15/04 22:19:28:440 GMT-05:00] 3ce0163c DispatcherSer I org.springframework.web.servlet.DispatcherServlet Servlet with name 'springapp' will try to create custom WebApplicationContext context of class 'org.springframework.web.context.support.XmlWebApp licationContext' using parent context [null]
            [8/15/04 22:19:28:770 GMT-05:00] 3ce0163c XmlBeanDefini I org.springframework.beans.factory.xml.XmlBeanDefin itionReader Loading XML bean definitions from resource [/WEB-INF/springapp-servlet.xml] of ServletContext
            [8/15/04 22:19:28:861 GMT-05:00] 3ce0163c DispatcherSer E org.springframework.web.servlet.DispatcherServlet Context initialization failed
            [8/15/04 22:19:28:881 GMT-05:00] 3ce0163c DispatcherSer E org.springframework.web.servlet.DispatcherServlet TRAS0014I: The following exception was logged org.springframework.beans.factory.BeanDefinitionSt oreException: Error registering bean with name 'springappController' defined in resource [/WEB-INF/springapp-servlet.xml] of ServletContext: Bean class [SpringappController] not found; nested exception is java.lang.ClassNotFoundException: SpringappController
            java.lang.ClassNotFoundException: SpringappController


            Thanks

            Comment


            • #7
              Re: My first Spring project too in WSAD 5.1.2

              Originally posted by theone
              Hi,

              I'm hoping you can help me with this error I'm getting
              I'm getting this error

              Thanks
              Please don't hijack an existing, completely unrelated thread in the wrong forum area, to boot, to ask a new question.

              That said, with the limited information you provide, it looks like the controller class you are trying to use, as defined "SpringappController", simply doesn't exist.

              Regards,

              Comment

              Working...
              X