jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgeniy Strokin <evgeniy.stro...@yahoo.com>
Subject get a resourse in webapp
Date Sun, 30 Sep 2007 11:27:44 GMT
Hello,
I've installed jackrabbit.war file on Tomcat 6. It works fine.
Now I want to add some services to the application.
I need to get a resource.
How can I get it?
I'm trying to use JNDI, but it doesn't work.
For such code:
InitialContext context = new InitialContext();
Context environment = (Context) context.lookup("java:comp/env");
Repository repository = (Repository) environment.lookup("bbmedia");

I'm getting the exception:
Exception in thread "main" javax.naming.NamingException: Cannot create resource instance
    at org.apache.naming.factory.ResourceEnvFactory.getObjectInstance(ResourceEnvFactory.java:114)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
    at bb.servicebus.MyServiceImpl.getRepository(MyServiceImpl.java:45)
.................

This I have in web.xml:
<resource-env-ref>
  <description>Content Repository</description>
  <resource-env-ref-name>bbmedia</resource-env-ref-name>
  <resource-env-ref-type>javax.jcr.Repository</resource-env-ref-type>
</resource-env-ref>

And this is my bootstrap.properties:

# Repository configuration settings (will be adjusted by installer)
repository.config=/BB-ARCHIVE/repository/repository.xml
repository.home=/BB-ARCHIVE/repository/bbmedia
repository.name=bbmedia

# RMI Settings
rmi.enabled=false
rmi.port=0
rmi.host=localhost

# JNDI Settings
jndi.enabled=true
jndi.name=bbmedia
java.naming.provider.url=http://www.apache.org/jackrabbit
java.naming.factory.initial=org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory

Could you help me out?
May be I can get the access some other way? 

Thank you
Gene


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