Tomee +(1.7.1)

I have an EAR deployed in 'apps' dir. This EAR has webApp and a Custom
Resource Factory is configured.

app WEB-INF/Web.xml contains this

<resource-env-ref>
  <description>
      Object factory for custom properties
  </description>
  <resource-env-ref-name>
      ldap/env
  </resource-env-ref-name>
  <resource-env-ref-type>
      com.fco.ps.fmc.fp.JNDIConfig
  </resource-env-ref-type>
</resource-env-ref>

META-INF/context.xml looks like this

<Context>

<Resource name="ldap/env" auth="Container"
                type="com.fco.ps.fmc.fp.JNDIConfig"
                factory="com.fco.ps.fmc.fp.JNDIConfigFactory"
                singleton="false"
                Usr="uservalue"
                Password="password"/>
</Context>

and in source code this is read as below

ctx = new InitialContext();
Context envCtx = (Context) ctx.lookup("java:comp/env");
Object obj = envCtx.lookup("ldap/env");

but this throws error saying 

*org.apache.openejb.OpenEJBException: No provider available for
resource-env-ref 'ldap/env' of type 'com.fco.ps.fmc.fp.JNDIConfig' for
'fmc-1.22-SNAPSHOT'*

So i removed the <resource-env-ref> configuration from app/web.xml and added
it in CATALINA_HOME/conf/web.xml (added at the end of the file). This worked
well no resource errors.
But when the code executes the following error was thrown.

*javax.naming.NameNotFoundException: Name [comp/env] is not bound in this
Context. Unable to find [comp]*

This looks like the context is not visible for the app deployed through ear.
What could be the problem and am i missing something here?



--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/javax-naming-NameNotFoundException-Name-comp-env-is-not-bound-in-this-Context-tp4676365.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to