tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: how to get local/remote ejb stored in spring from a servlet - openejb spring integration
Date Wed, 06 Jul 2011 11:30:28 GMT
The code i copy/paste works since i used it in a project.

Did you clear you app ctx when you tried?

- Romain

2011/7/6 lamle <lamle@wapice.com>

> This is the error when i put openejb-core.jar to my webapp/lib
>
>
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'bookTestBeanImplLocal': Invocation of init method failed; nested
> exception is javax.naming.NamingException: Cannot instantiate a
> LocalInitialContext. Exception: java.lang.NoSuchMethodException
> org.apache.openejb.client.LocalInitialContext.<init>(java.util.Hashtable,
> org.apache.openejb.client.LocalInitialContextFactory) [Root exception is
> java.lang.NoSuchMethodException:
> org.apache.openejb.client.LocalInitialContext.<init>(java.util.Hashtable,
> org.apache.openejb.client.LocalInitialContextFactory)]
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>
>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
>
>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>
>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
>
>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
>
>
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
>
>
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
>
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
>
>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>
>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
>         com.wapice.test.TestServlet.doGet(TestServlet.java:45)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
>
> root cause
>
> javax.naming.NamingException: Cannot instantiate a LocalInitialContext.
> Exception: java.lang.NoSuchMethodException
> org.apache.openejb.client.LocalInitialContext.<init>(java.util.Hashtable,
> org.apache.openejb.client.LocalInitialContextFactory) [Root exception is
> java.lang.NoSuchMethodException:
> org.apache.openejb.client.LocalInitialContext.<init>(java.util.Hashtable,
> org.apache.openejb.client.LocalInitialContextFactory)]
>
>
> org.apache.openejb.client.LocalInitialContextFactory.getLocalInitialContext(LocalInitialContextFactory.java:98)
>
>
> org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:43)
>
>  javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
>
>  javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
>        javax.naming.InitialContext.init(InitialContext.java:223)
>        javax.naming.InitialContext.<init>(InitialContext.java:197)
>
>
> org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:136)
>
>  org.springframework.jndi.JndiTemplate.getContext(JndiTemplate.java:103)
>        org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
>        org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
>        org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
>
>
> org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
>
>
> org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
>
>
> org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
>
>
> org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>
>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
>
>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>
>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
>
>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
>
>
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
>
>
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
>
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
>
>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>
>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
>         com.wapice.test.TestServlet.doGet(TestServlet.java:45)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
>
> root cause
>
> java.lang.NoSuchMethodException:
> org.apache.openejb.client.LocalInitialContext.<init>(java.util.Hashtable,
> org.apache.openejb.client.LocalInitialContextFactory)
>        java.lang.Class.getConstructor0(Class.java:2706)
>        java.lang.Class.getConstructor(Class.java:1657)
>
>
> org.apache.openejb.client.LocalInitialContextFactory.getLocalInitialContext(LocalInitialContextFactory.java:85)
>
>
> org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:43)
>
>  javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
>
>  javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
>        javax.naming.InitialContext.init(InitialContext.java:223)
>        javax.naming.InitialContext.<init>(InitialContext.java:198)
>
>
> org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:136)
>
>  org.springframework.jndi.JndiTemplate.getContext(JndiTemplate.java:103)
>        org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
>        org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
>        org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:179)
>
>
> org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
>
>
> org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
>
>
> org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
>
>
> org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>
>
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
>
>
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>
>
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
>
>
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
>
>
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
>
>
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:896)
>
>
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
>
>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
>
>
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:84)
>        com.wapice.test.TestServlet.doGet(TestServlet.java:45)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/how-to-get-local-remote-ejb-stored-in-spring-from-a-servlet-openejb-spring-integration-tp3647869p3648369.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message