Results 1 to 7 of 7

Thread: Help V4.0 datasource error in Websphere?

  1. #1
    Join Date
    Aug 2004
    Location
    Thousand Oaks, CA
    Posts
    4

    Default 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>
    Thanks,
    jlm

  2. #2
    Join Date
    Aug 2004
    Location
    St. Louis, MO, USA
    Posts
    24

    Default

    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).

  3. #3
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    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,
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

  4. #4
    Join Date
    Aug 2004
    Location
    Thousand Oaks, CA
    Posts
    4

    Default

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

  5. #5

    Default 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

  6. #6

    Default 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

  7. #7
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default Re: My first Spring project too in WSAD 5.1.2

    Quote 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,
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. Replies: 0
    Last Post: Aug 16th, 2005, 11:23 AM
  2. Datasource in WebSphere 5.1
    By carlos_santiago in forum Data
    Replies: 3
    Last Post: Aug 4th, 2005, 12:45 PM
  3. Odd behaviour when injecting TransactionTemplate
    By damon311 in forum Container
    Replies: 3
    Last Post: Jul 23rd, 2005, 11:21 AM
  4. Replies: 5
    Last Post: May 4th, 2005, 10:49 PM
  5. Replies: 1
    Last Post: Oct 2nd, 2004, 09:57 AM

Posting Permissions

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