Well, this looks very much like your server-side repository is not running (have a look at the logs for any startup errors) or the RMI connection is not enabled. But if you implement a new login module, if would suggest to test it locally without RMI first. For your user class you might also have to add some rmi stubs - but I think you should try to re-use SimpleCredentials instead of your custom User class, unless it has some really unique features not available in SimpleCredentials.
Regards, Alex On Tue, Jan 13, 2009 at 5:35 PM, Alessandro Cosenza <[email protected]> wrote: > thanks. > so, i change repository.xml with my AccessManager and > LoginModule > implementations. > Now using this code > > Repository repository = > new > RMIRemoteRepository("//localhost:1099/jackrabbit.repository"); > User u = new User("name","surname"); > Session s = repository.login(u); > > where User is my own class for authentication and it is used > in my > LoginModule, > a RepositoryException is thrown: > Exception in thread "main" javax.jcr.RepositoryException: > Repository access error: > //localhost:1099/jackrabbit.repository: Connection refused > to host: localhost; nested exception is: > java.net.ConnectException: Connection refused: connect: > Connection refused to host: localhost; nested exception is: > java.net.ConnectException: Connection refused: connect > at > org.apache.jackrabbit.rmi.repository.RMIRemoteRepositoryFactory.getRemoteRepository(RMIRemoteRepositoryFactory.java:71) > at > org.apache.jackrabbit.rmi.repository.AbstractRemoteRepositoryFactory.getRepository(AbstractRemoteRepositoryFactory.java:59) > at > org.apache.jackrabbit.commons.repository.ProxyRepository.login(ProxyRepository.java:100) > at > org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:53) > at it.itkey.repository.TestJCR.main(TestJCR.java:26) > Caused by: java.rmi.ConnectException: Connection refused to > host: localhost; nested exception is: > java.net.ConnectException: Connection refused: connect > at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown > Source) > at > sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown > Source) > at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown > Source) > at sun.rmi.server.UnicastRef.newCall(Unknown Source) > at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown > Source) > at java.rmi.Naming.lookup(Unknown Source) > at > org.apache.jackrabbit.rmi.repository.RMIRemoteRepositoryFactory.getRemoteRepository(RMIRemoteRepositoryFactory.java:63) > ... 4 more > Caused by: java.net.ConnectException: Connection refused: > connect > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(Unknown Source) > at java.net.PlainSocketImpl.connectToAddress(Unknown > Source) > at java.net.PlainSocketImpl.connect(Unknown Source) > at java.net.SocksSocketImpl.connect(Unknown Source) > at java.net.Socket.connect(Unknown Source) > at java.net.Socket.connect(Unknown Source) > at java.net.Socket.<init>(Unknown Source) > at java.net.Socket.<init>(Unknown Source) > at > sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown > Source) > at > sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown > Source) > ... 11 more > java.rmi.ConnectException: Connection refused to host: > localhost; nested exception is: > java.net.ConnectException: Connection refused: connect > at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown > Source) > at > sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown > Source) > at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown > Source) > at sun.rmi.server.UnicastRef.newCall(Unknown Source) > at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown > Source) > at java.rmi.Naming.lookup(Unknown Source) > at > org.apache.jackrabbit.rmi.repository.RMIRemoteRepositoryFactory.getRemoteRepository(RMIRemoteRepositoryFactory.java:63) > at > org.apache.jackrabbit.rmi.repository.AbstractRemoteRepositoryFactory.getRepository(AbstractRemoteRepositoryFactory.java:59) > at > org.apache.jackrabbit.commons.repository.ProxyRepository.login(ProxyRepository.java:100) > at > org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:53) > at it.itkey.repository.TestJCR.main(TestJCR.java:26) > Caused by: java.net.ConnectException: Connection refused: > connect > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(Unknown Source) > at java.net.PlainSocketImpl.connectToAddress(Unknown > Source) > at java.net.PlainSocketImpl.connect(Unknown Source) > at java.net.SocksSocketImpl.connect(Unknown Source) > at java.net.Socket.connect(Unknown Source) > at java.net.Socket.connect(Unknown Source) > at java.net.Socket.<init>(Unknown Source) > at java.net.Socket.<init>(Unknown Source) > at > sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown > Source) > at > sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown > Source) > ... 11 more > > help me please! > > > > ----- Original Message ----- > Da : "Todd Seiber" <[email protected]> > A : [email protected] > Oggetto : Re: how to configure files with LoginModule impl > Data : Tue, 13 Jan 2009 10:36:10 -0500 > >> For Jackrabbit you need only to change repository.xml. If >> your AccessManager and/or LogiModule implementations >> require any configuration changes you will have to make >> those too. >> >> Example: >> <Security appName="Jackrabbit"> >> <AccessManager class="x.y.AccessManager"/> >> <LoginModule >> class="x.y.LoginModule"></LoginModule> >> </Security> >> >> On Tue, Jan 13, 2009 at 9:46 AM, Alessandro Cosenza < >> [email protected]> wrote: >> >> > >> > i have my own LoginModule and AccessManager >> > implementations. what are properties or files i have to >> > create? i don't know if i have to modify repository.xml, >> > or tomcat-related files, or create other config files, >> > please help me. >> > >> > ----- Original Message ----- >> > Da : "Alessandro Cosenza" <[email protected]> >> > A : [email protected] >> > Oggetto : Re: how to configure files with LoginModule >> > impl Data : Tue, 13 Jan 2009 14:42:37 +0100 >> > >> > > ok but this is the only thing i have to do? >> > > another question: which value must have the appName >> > > attribute >> > > of Security element in repository.xml?which value >> > > somewhere must corresponds to? >> > > >> > > ----- Original Message ----- >> > > Da : "Alexander Klimetschek" <[email protected]> >> > > A : [email protected] >> > > Oggetto : Re: how to configure files with LoginModule >> > > impl Data : Tue, 13 Jan 2009 13:20:14 +0100 >> > > >> > > > On Tue, Jan 13, 2009 at 11:14 AM, >> > > > [email protected] >> > > > > <[email protected]> wrote: hi, i have my >> > > > > own LoginModule implementation for authentication. >> > > > > now which files i have to configure with which >> > > > > entry? i'm using Tomcat 5.5. >> > > > >> > > > The LoginModule is configured in the repository.xml. >> > > > See the website: >> > > > >> > > >> > >> > >> > http://jackrabbit.apache.org/jackrabbit-configuration.html#JackrabbitConfiguration-Securityconfiguration >> > > > >> > > > Regards, >> > > > Alex >> > > > >> > > > -- >> > > > Alexander Klimetschek >> > > > [email protected] >> > >> >> >> >> -- >> Todd Seiber >> 830 Fishing Creek Rd. >> New Cumberland, PA 17070 >> >> h. 717-938-5778 >> c. 717-497-1742 >> e. [email protected] >> > -- Alexander Klimetschek [email protected]
