Announcement Announcement Module
Collapse
No announcement yet.
Spring Transaction Management using JNDI and WAS 6.1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Transaction Management using JNDI and WAS 6.1

    Hi,
    I was trying to access the Websphere application Server datasource in the spring application code using jndi. When i deploy the war in the WAS i get the following Server error.
    Code:
    [24/09/07 16:25:08:359 MDT] 00000037 ServletWrappe E   SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: TestXA1Servlet. Exception thrown : java.lang.NoSuchMethodError: org/springframework/core/CollectionFactory.createConcurrentMapIfPossible(I)Ljava/util/Map;
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.<init>(DefaultSingletonBeanRegistry.java:82)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.<init>(AbstractBeanFactory.java:142)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.<init>(AbstractAutowireCapableBeanFactory.java:132)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.<init>(AbstractAutowireCapableBeanFactory.java:143)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.<init>(DefaultListableBeanFactory.java:99)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:144)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:99)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
    	at TestXA1Servlet.transWithConfig(TestXA1Servlet.java:141)
    	at TestXA1Servlet.doGet(TestXA1Servlet.java:89)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
    	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    	at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
    	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)
    	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:472)
    	at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111)
    	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
    	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
    	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
    	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
    	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
    	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
    	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
    	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
    	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
    	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
    	at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
    	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
    	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
    	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
    	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
    
    [24/09/07 16:25:08:437 MDT] 00000037 WebApp        E   [Servlet Error]-[org/springframework/core/CollectionFactory.createConcurrentMapIfPossible(I)Ljava/util/Map;]: java.lang.NoSuchMethodError: org/springframework/core/CollectionFactory.createConcurrentMapIfPossible(I)Ljava/util/Map;
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.<init>(DefaultSingletonBeanRegistry.java:82)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.<init>(AbstractBeanFactory.java:142)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.<init>(AbstractAutowireCapableBeanFactory.java:132)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.<init>(AbstractAutowireCapableBeanFactory.java:143)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.<init>(DefaultListableBeanFactory.java:99)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:144)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:99)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:65)
    	at TestXA1Servlet.transWithConfig(TestXA1Servlet.java:141)
    	at TestXA1Servlet.doGet(TestXA1Servlet.java:89)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
    	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
    	at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
    	at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)
    	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:472)
    	at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111)
    	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
    	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
    	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
    	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
    	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
    	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
    	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
    	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
    	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
    	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
    	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
    	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
    	at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
    	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
    	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
    	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
    	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
    My servlet doGet() Code looks like this; the exception is thrown on the very first line itself.
    Code:
    		factory = new ClassPathXmlApplicationContext(
    		"transaction-management.xml");
    		ListIterator listIterator = personDAO.getAllPersons().listIterator();
    		Integer pKey = personDAO.checkValidTransaction();
    regards
    Surya

  • #2
    Looks like a Spring jars conflict.

    Joerg

    Comment


    • #3
      I tried with the main spring.jar and also the spring-*.jar files in the project classpath. Still no solution; It would be great if you could be a little more specific by naming the jar files which may cause the conflict here. Thanks

      Comment


      • #4
        There should be jars of multiple Spring versions on the class path, so maybe in the web application and in the common/shared class loader.

        Joerg

        Comment


        • #5
          Thanks for the reply Jorg,
          I think it was due to the clash of jars in the classpath. I have a new problem now.
          I have an integration issue with hibernate. Please note, my application with hibernate works well.
          Code:
          [26/09/07 14:34:24:421 MDT] 0000002d WebApp        E   [Servlet Error]-[Unknown entity: util.txmanagement.entity.Person; nested exception is org.hibernate.MappingException: Unknown entity: util.txmanagement.entity.Person]: org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity: util.txmanagement.entity.Person; nested exception is org.hibernate.MappingException: Unknown entity: util.txmanagement.entity.Person
          Caused by: org.hibernate.MappingException: Unknown entity: util.txmanagement.entity.Person
          Last edited by Surya1234; Sep 26th, 2007, 03:38 PM. Reason: updating the issue

          Comment


          • #6
            You properly configured the Hibernate session factory ? It seems you specified a wrong mapping file or you didn't specify it at all.

            Comment


            • #7
              Next to that he probably also has a memory/performance issue. Re-creating the ApplicationContext on each request... :s

              Comment


              • #8
                That problem is fixed; Thanks. I used javax.persistence for my hibernate annotations instead of the hibernate.annotations.
                Any ideas on the difference between these two packages.
                Thanks.....

                Comment

                Working...
                X