You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Pedro Saraiva <ps...@maisis.pt> on 2011/02/03 13:09:34 UTC

JBoss deployment with webapp and jndi

Hello,

I'm new to JCR and Jackrabbit. I'm trying to deploy the Jackrabbit 
webapp under JBoss 6.
I've been able to create a repository and access it using webdav.

Now I'm struggling to connect to the local repository using jndi from 
another webapp.
My jndi settings look like this:

----------------------------------------------
Configuration of JNDIConfig
----------------------------------------------
valid: true
jndiName: jackrabbit
jndiEnabled: true
class: class org.apache.jackrabbit.j2ee.JNDIConfig
jndiEnv: {java.naming.provider.url=http://www.maisis.pt/jackrabbit, 
java.naming.factory.initial=org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory}


  I've written a small test to connect to the repository:

Properties props = new Properties();
props.put( "java.naming.factory.initial", 
"org.jnp.interfaces.NamingContextFactory" );
props.put( "java.naming.provider.url", "http://www.maisis.pt/jackrabbit" );
props.put( Context.PROVIDER_URL, "jnp://localhost:1099" );

InitialContext context = new InitialContext( props );
NamingEnumeration<Binding> bindings = context.listBindings( "" );

while ( bindings.hasMore() )
{
     Binding b = bindings.next();
     _logger.error( "-> Found binding " + b.getName() );
}

Repository repository = ( Repository ) context.lookup( "jackrabbit" );

This is the output I get:

  11:57:16,304 ERROR [ServicesConfigurationServlet] -> Found binding 
UserTransactionSessionFactory
11:57:16,304 ERROR [ServicesConfigurationServlet] -> Found binding 
UUIDKeyGeneratorFactory
11:57:16,304 ERROR [ServicesConfigurationServlet] -> Found binding 
HiLoKeyGeneratorFactory
11:57:16,304 ERROR [ServicesConfigurationServlet] -> Found binding 
SecureDeploymentManager
11:57:16,304 ERROR [ServicesConfigurationServlet] -> Found binding 
SecureManagementView
11:57:16,304 ERROR [ServicesConfigurationServlet] -> Found binding 
DeploymentManager
11:57:16,304 ERROR [ServicesConfigurationServlet] -> Found binding 
XAConnectionFactory
11:57:16,304 ERROR [ServicesConfigurationServlet] -> Found binding 
ProfileService
11:57:16,304 ERROR [ServicesConfigurationServlet] -> Found binding 
SecureProfileService
11:57:16,305 ERROR [ServicesConfigurationServlet] -> Found binding queue
11:57:16,305 ERROR [ServicesConfigurationServlet] -> Found binding 
UserTransaction
11:57:16,305 ERROR [ServicesConfigurationServlet] -> Found binding 
ConnectionFactory
11:57:16,305 ERROR [ServicesConfigurationServlet] -> Found binding jmx
11:57:16,305 ERROR [ServicesConfigurationServlet] -> Found binding 
BeanValidatorFactories
11:57:16,305 ERROR [ServicesConfigurationServlet] -> Found binding 
TomcatAuthenticators
11:57:16,305 ERROR [ServicesConfigurationServlet] -> Found binding 
XAThroughputConnectionFactory
11:57:16,305 ERROR [ServicesConfigurationServlet] -> Found binding 
ManagementView
11:57:16,305 ERROR [ServicesConfigurationServlet] -> Found binding 
ThroughputConnectionFactory
11:57:16,316 ERROR [STDERR] javax.naming.NameNotFoundException: 
jackrabbit not bound
11:57:16,316 ERROR [STDERR]     at 
org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
11:57:16,316 ERROR [STDERR]     at 
org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
11:57:16,316 ERROR [STDERR]     at 
org.jnp.server.NamingServer.getObject(NamingServer.java:785)
11:57:16,317 ERROR [STDERR]     at 
org.jnp.server.NamingServer.lookup(NamingServer.java:443)

Can you explain me why the jndi name isn't bound and how can I make this 
work?

Kind regards,

Pedro Saraiva