Hi All ,

While Trying to Access the Deployed StaelessSession Bean I am gettig Error like this

INFO: Creating shared instance of singleton bean 'echoService'
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'echoService' defined in resource loaded through InputStream: Initialization of bean failed; nested exception is javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(U nknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unkn own Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx (Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.springframework.jndi.JndiTemplate$1.doInContex t(JndiTemplate.java:123)
at org.springframework.jndi.JndiTemplate.execute(Jndi Template.java:85)
at org.springframework.jndi.JndiTemplate.lookup(JndiT emplate.java:121)
at org.springframework.jndi.JndiLocatorSupport.lookup (JndiLocatorSupport.java:71)
at org.springframework.jndi.JndiObjectLocator.lookup( JndiObjectLocator.java:85)
at org.springframework.ejb.access.AbstractSlsbInvoker Interceptor.refreshHome(AbstractSlsbInvokerInterce ptor.java:102)
at org.springframework.ejb.access.AbstractSlsbInvoker Interceptor.afterPropertiesSet(AbstractSlsbInvoker Interceptor.java:90)
at org.springframework.ejb.access.SimpleRemoteStatele ssSessionProxyFactoryBean.afterPropertiesSet(Simpl eRemoteStatelessSessionProxyFactoryBean.java:95)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1065)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:343)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:260)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:221)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
at Executor.main(Executor.java:40)



THINGS I HAVE DONE




I Have Deployed a StateLessSessionBean in
jboss-3.0.4_tomcat-4.1.12 with
Spring1.1.4 while deploying it is showing the Following


Bean : EchoServiceEJB
Method : public abstract EchoServiceRemote create() throws CreateException
Section: 6.10.6
Warning: The method return values in the home interface must be of valid types for RMI/IIOP.

18:14:41,468 INFO [EJBDeployer]
Bean : EchoServiceEJB
Method : public abstract EchoServiceRemote create() throws CreateException
Section: 6.10.6
Warning: The methods in the home interface must include java.rmi.RemoteException in their throws clause.

18:14:41,468 INFO [EJBDeployer]
Bean : EchoServiceEJB
Method : public abstract String echo(String)
Section: 6.10.5
Warning: The methods in the remote interface must include java.rmi.RemoteException in their throws clause.


But it is Showing that the bean is bean is been deployed and started.

Files the JarFile Contains Are :
EchoService Interface
EchoServiceImpl Class

EchoServiceRemote Interface
EchoServceHome Interface
EchoServiceEJB Class

WEB-INF/applicationContext.xml
-------------------------------------

<bean id="EchoServiceImpl" class="spn.EchoServiceImpl" />
<bean id="EchoServiceEJB" class="spn.EchoServiceEJB">
<property name="service">
<ref local="EchoServiceImpl" />
</property>
</bean>

META-INF/ejb-jar.xml
--------------------------
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>EchoServiceEJB</ejb-name>
<home>spn.EchoServiceHome</home>
<remote>spn.EchoServiceRemote</remote>
<ejb-class>spn.EchoServiceEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>ejb/BeanFactoryPath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>applicationContext.xml</env-entry-value>
</env-entry>
</session>
</enterprise-beans>

<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>EchoServiceEJB</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>


META-INF/jboss.xml
-----------------------
<jboss>
<enterprise-beans>
<session>
<ejb-name>EchoServiceEJB</ejb-name>
<jndi-name>ejb/echoService</jndi-name>
</session>
</enterprise-beans>
</jboss>




IN The Client Side:
---------------------

BeanCofig.xml
-----------------
<bean id="echoService" class="org.springframework.ejb.access.SimpleRemote StatelessSessionProxyFactoryBean">
<property name="jndiName">
<value>ejb/echoService</value>
</property>
<property name="resourceRef">
<value>true</value>
</property>
<property name="businessInterface">
<value>spn.EchoService</value>
</property>
</bean>
MainProgramm Accessign the bean From where the Err is thrown
---------------------------------------------------------------------------

InputStream beanConfigFile = new FileInputStream("C:\\SpringPersist\\BeanConfigFile .xml");
BeanFactory factory =(BeanFactory) new XmlBeanFactory(beanConfigFile);
EchoService remoteBean=(EchoService)factory.getBean("echoServi ce");
System.out.println(remoteBean);

IS THERE ANY SOLUTION TO THIS ?????