-
Sep 26th, 2005, 01:27 AM
#1
Oracle OC4J 904 and environment variable
Hi all, we are getting this when trying to run our app in Oracle 904:
org.springframework.beans.factory.access.Bootstrap Exception: Define an environment variable [java:comp/env/ejb/BeanFactoryPath] containing the class path locations of XML bean definition files; nested exception is javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/BeanFactoryPath
javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/BeanFactoryPath
at com.sun.enterprise.naming.java.javaURLContext.look up(javaURLContext.java:116)
at javax.naming.InitialContext.lookup(InitialContext. java:345)
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.context.access.ContextJndiBean FactoryLocator.useBeanFactory(ContextJndiBeanFacto ryLocator.java:64)
at org.springframework.ejb.support.AbstractEnterprise Bean.loadBeanFactory(AbstractEnterpriseBean.java:1 17)
at org.springframework.ejb.support.AbstractStatelessS essionBean.ejbCreate(AbstractStatelessSessionBean. java:63)
at MethodInvokerHome_StatelessSessionHomeWrapper1.cal lCreate(MethodInvokerHome_StatelessSessionHomeWrap per1.java:115)
at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.ejb.StatelessSessionEJBHome.getContextInst ance(StatelessSessionEJBHome.java:275)
at MethodInvokerRemote_StatelessSessionBeanWrapper0.i nvoke(MethodInvokerRemote_StatelessSessionBeanWrap per0.java:77)
at java.lang.reflect.Method.invoke(Native Method)
at org.springframework.remoting.rmi.RmiClientIntercep torUtils.doInvoke(RmiClientInterceptorUtils.java:1 03)
at org.springframework.ejb.access.SimpleRemoteSlsbInv okerInterceptor.doInvoke(SimpleRemoteSlsbInvokerIn terceptor
Basically the app server thinks there is no environment entry but I have it declared in ejb-jar.xml descriptor:
<env-entry>
<env-entry-name>ejb/BeanFactoryPath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>applicationContext.prod.xml</env-entry-value>
</env-entry>
Any ideas,
J
-
Sep 26th, 2005, 07:38 AM
#2
I remember vaguely that I encountered such an issue, too. Unfortunately it is a while ago, so I cannot remember the solution exactly
The problem is about JNDI. Your environment entry has been found, however the JNDI path could not be resolved.
You might try to use resourceRef=false to access the path without "java:comp/env".
Besides that you might use lookupHomeOnStartup=false to delay the actual JNDI access.
In any case it might be helpful to explore the JNDI tree to have a look at what has actually been registered.
Hope this might be helpful.
Andreas
-
Sep 28th, 2005, 02:25 AM
#3
solution
You need to define stuff in the ejb-jar.xml file:
<env-entry>
<description><![CDATA[Spring Application Context]]></description>
<env-entry-name>ejb/BeanFactoryPath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
<env-entry>
<description><![CDATA[Spring Method Interceptor]]></description>
<env-entry-name>ejb/MethodBeanName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
and then give these entries values in orion-ejb-jar.xml file in the session-deployment:
<env-entry-mapping name="ejb/BeanFactoryPath">applicationContext.prod.xml</env-entry-mapping>
<env-entry-mapping name="ejb/MethodBeanName">applicationManager</env-entry-mapping>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules