jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mihai Anescu" <mane...@totalsoft.ro>
Subject RE: JackrabbitOnJBoss - Problems accessing JCA
Date Thu, 06 Sep 2007 14:01:02 GMT
Hi Stefan,

The exception you get can be solved with this kind of code (the default
port is 1099, if you changed it use your port):

Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
properties.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
properties.put(Context.PROVIDER_URL, "localhost:1099");
InitialContext ctx = new InitialContext(properties);

Instead of:

InitialContext ctx = new InitialContext() ;

Or, if I recall correctly, you can use a properties file
(naming.properties) inside your application, and there you define the
keys/values as above (the keys being the values stored in the Context
static fields, the values are inside the above code).

You can't use RMI so easy, I already replied you yesterday how you can
connect via RMI (or at least how I managed to connect).


-----Original Message-----
From: stefan81 [mailto:stefan.schlappa@process-relations.com] 
Sent: Wednesday, September 05, 2007 7:10 PM
To: users@jackrabbit.apache.org
Subject: JackrabbitOnJBoss - Problems accessing JCA


Hi,

I want to deploy JackRabbit on JBoss and followed the instructions under
http://wiki.apache.org/jackrabbit/JackrabbitOnJBoss.

I wrote a client program for testing the access to the repository.
According
to JackrabbitOnJBoss I tried a jndi lookup which led to the following
exception:

Code:
InitialContext ctx = new InitialContext() ;
Repository repository = (Repository) ctx.lookup("java:jcr/local") ;

Exception:
Exception in thread "main" 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

After some googling I tried out a lot of other things, for example
acessing
via rmi:

Code:
ClientRepositoryFactory factory = new ClientRepositoryFactory();
Repository repository =
factory.getRepository("rmi://localhost:1099/jcrServer");
Credentials cred = new SimpleCredentials("user",new char[]{'p','w','d'})
;
Session s = repository.login(cred);

Exception:
Exception in thread "main"
org.apache.jackrabbit.rmi.client.RemoteRepositoryException: non-JRMP
server
at remote endpoint: non-JRMP server at remote endpoint


Can anyone please give me a clue what is going wrong? Why does neither
JNDI
lookup nor RMI access work? Did I do something wrong with the deployment
of
JR?

Thx a lot!
-- 
View this message in context:
http://www.nabble.com/JackrabbitOnJBoss---Problems-accessing-JCA-tf43860
29.html#a12503786
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message