Results 1 to 8 of 8

Thread: Spring Transaction Management using JNDI and WAS 6.1

  1. #1
    Join Date
    Jul 2007
    Posts
    25

    Default 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. #2
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    Looks like a Spring jars conflict.

    Joerg
    This post can contain insufficient information.

  3. #3
    Join Date
    Jul 2007
    Posts
    25

    Default

    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

  4. #4
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    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
    This post can contain insufficient information.

  5. #5
    Join Date
    Jul 2007
    Posts
    25

    Default

    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 at 03:38 PM. Reason: updating the issue

  6. #6
    Join Date
    Mar 2007
    Posts
    515

    Default

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

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

    Default

    Next to that he probably also has a memory/performance issue. Re-creating the ApplicationContext on each request... :s
    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
    Jul 2007
    Posts
    25

    Default

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

Posting Permissions

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