You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Umesh Singh <um...@iogloballtd.com> on 2006/07/03 18:18:46 UTC
Jackrabbit and Jboss (Shared Deployment Model)
Hi,
I'm trying to deploy Jackrabbit under Jboss in a shared deployment model
I tried deploying directly using RegistryHelper which works and I can see on JBoss console that Repository has been deployed
but when I try to do the lookup It seems Jackrabbit tries to start a new instance of the repository. This fails because the .lock file
exists from when I initially invoked RegistryHelper.
Has anyone deployed under Jboss using model 2? Is there something wrong?
Regards,
Umesh
Re: Jackrabbit and Jboss (Shared Deployment Model)
Posted by Edgar Poce <ed...@gmail.com>.
Hi Umesh,
see the jcr-rmi docs at
http://svn.apache.org/viewvc/jackrabbit/trunk/jcr-rmi/src/java/org/apache/jackrabbit/rmi/client/package.html?view=markup
and a client code example at
http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/ext/ConnectToJNDIServer.java?view=markup
br,
edgar
On 7/7/06, Umesh Singh <um...@iogloballtd.com> wrote:
> Hi Edgar,
>
> Thanks for the help. After checking out the source from the svn I am
> able to build and deploy the jar in JBoss and RMI server is also running
> now. But from the client program when I try to do a lookup for the
> Repository I am getting this error:
>
> /java.lang.ClassCastException:
> org.apache.jackrabbit.rmi.server.ServerRepository_Stub
> at
> com.io_content.contentrepository.impl.ContentRepositoryRmiTest.testJackRabbitInRMIClientServer(ContentRepositoryRmiTest.java:59)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)/
>
>
> This is code I am using in client test:
>
> * Properties props = System.getProperties();
> props.setProperty("java.naming.factory.initial",
> "org.jnp.interfaces.NamingContextFactory");
> props.setProperty("java.naming.provider.url", "jnp://"+
> "localhost" +":1099");
> props.setProperty("java.naming.factory.url.pkgs",
> "org.jboss.naming:org.jnp.interfaces");
>
> Context context = new InitialContext(props);
> Repository repository = (Repository)context.lookup("jcrServer");*
>
> I also tried using ClientRepositoryFactory but there also I get error.
>
> *ClientRepositoryFactory factory = new ClientRepositoryFactory();
> Repository repository =
> factory.getRepository("//localhost:1099/jcrServer");*
>
> /java.rmi.ConnectIOException: non-JRMP server at remote endpoint
> at
> sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:217)
> at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
> at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
> at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
> at java.rmi.Naming.lookup(Naming.java:84)
> at
> org.apache.jackrabbit.rmi.client.ClientRepositoryFactory.getRepository(ClientRepositoryFactory.java:85)
> at
> com.io_content.contentrepository.impl.ContentRepositoryRmiTest.testJackRabbitInRMIClientServer(ContentRepositoryRmiTest.java:65)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)/
>
> Any idea what could be wrong here?
>
> Regards,
> Umesh
>
>
> Edgar Poce wrote:
> > hi,
> >
> > On 7/4/06, Umesh Singh <um...@iogloballtd.com> wrote:
> >> Hi Edgar,
> >>
> >> Thanks for the wiki post. I am able to setup jackrabbit according to the
> >> instructions given there but still I am not able to do the RMI bit.
> >> Still I am not able to understand how putting just a jar in deploy
> >> folder will make it accessible over rmi?
> >>
> >
> > there's a service descriptor inside the built jar that manages the
> > jcr-rmi lifecycle, it starts the jcr-rmi layer and binds it to a jndi
> > address.
> >
> >> Should it not have some JBoss MBean deployed in SAR or Or I am missing
> >> something?
> >>
> >
> > there's an MBean inside the jar. see
> > http://svn.apache.org/viewvc/jackrabbit/trunk/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/jmx/
> >
> >
> > br,
> > edgar
> >
> >> Regards,
> >> Umesh
> >>
> >> Edgar Poce wrote:
> >> > Hi Umesh,
> >> >
> >> > On 7/3/06, Umesh Singh <um...@iogloballtd.com> wrote:
> >> >> Hi,
> >> >>
> >> >> I'm trying to deploy Jackrabbit under Jboss in a shared deployment
> >> model
> >> >>
> >> >
> >> > take a look to http://wiki.apache.org/jackrabbit/JackrabbitOnJBoss.
> >> > see the section "Deploy Jackrabbit with JCA".
> >> >
> >> > br,
> >> > edgar
> >> >
> >> >> I tried deploying directly using RegistryHelper which works and I can
> >> >> see on JBoss console that Repository has been deployed
> >> >> but when I try to do the lookup It seems Jackrabbit tries to start a
> >> >> new instance of the repository. This fails because the .lock file
> >> >> exists from when I initially invoked RegistryHelper.
> >> >>
> >> >> Has anyone deployed under Jboss using model 2? Is there something
> >> wrong?
> >> >>
> >> >>
> >> >> Regards,
> >> >> Umesh
> >> >>
> >> >
> >>
> >>
> >
>
>
>
Re: Jackrabbit and Jboss (Shared Deployment Model)
Posted by Umesh Singh <um...@iogloballtd.com>.
Hi Edgar,
Thanks for the help. After checking out the source from the svn I am
able to build and deploy the jar in JBoss and RMI server is also running
now. But from the client program when I try to do a lookup for the
Repository I am getting this error:
/java.lang.ClassCastException:
org.apache.jackrabbit.rmi.server.ServerRepository_Stub
at
com.io_content.contentrepository.impl.ContentRepositoryRmiTest.testJackRabbitInRMIClientServer(ContentRepositoryRmiTest.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)/
This is code I am using in client test:
* Properties props = System.getProperties();
props.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.provider.url", "jnp://"+
"localhost" +":1099");
props.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
Context context = new InitialContext(props);
Repository repository = (Repository)context.lookup("jcrServer");*
I also tried using ClientRepositoryFactory but there also I get error.
*ClientRepositoryFactory factory = new ClientRepositoryFactory();
Repository repository =
factory.getRepository("//localhost:1099/jcrServer");*
/java.rmi.ConnectIOException: non-JRMP server at remote endpoint
at
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:217)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at
org.apache.jackrabbit.rmi.client.ClientRepositoryFactory.getRepository(ClientRepositoryFactory.java:85)
at
com.io_content.contentrepository.impl.ContentRepositoryRmiTest.testJackRabbitInRMIClientServer(ContentRepositoryRmiTest.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)/
Any idea what could be wrong here?
Regards,
Umesh
Edgar Poce wrote:
> hi,
>
> On 7/4/06, Umesh Singh <um...@iogloballtd.com> wrote:
>> Hi Edgar,
>>
>> Thanks for the wiki post. I am able to setup jackrabbit according to the
>> instructions given there but still I am not able to do the RMI bit.
>> Still I am not able to understand how putting just a jar in deploy
>> folder will make it accessible over rmi?
>>
>
> there's a service descriptor inside the built jar that manages the
> jcr-rmi lifecycle, it starts the jcr-rmi layer and binds it to a jndi
> address.
>
>> Should it not have some JBoss MBean deployed in SAR or Or I am missing
>> something?
>>
>
> there's an MBean inside the jar. see
> http://svn.apache.org/viewvc/jackrabbit/trunk/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/jmx/
>
>
> br,
> edgar
>
>> Regards,
>> Umesh
>>
>> Edgar Poce wrote:
>> > Hi Umesh,
>> >
>> > On 7/3/06, Umesh Singh <um...@iogloballtd.com> wrote:
>> >> Hi,
>> >>
>> >> I'm trying to deploy Jackrabbit under Jboss in a shared deployment
>> model
>> >>
>> >
>> > take a look to http://wiki.apache.org/jackrabbit/JackrabbitOnJBoss.
>> > see the section "Deploy Jackrabbit with JCA".
>> >
>> > br,
>> > edgar
>> >
>> >> I tried deploying directly using RegistryHelper which works and I can
>> >> see on JBoss console that Repository has been deployed
>> >> but when I try to do the lookup It seems Jackrabbit tries to start a
>> >> new instance of the repository. This fails because the .lock file
>> >> exists from when I initially invoked RegistryHelper.
>> >>
>> >> Has anyone deployed under Jboss using model 2? Is there something
>> wrong?
>> >>
>> >>
>> >> Regards,
>> >> Umesh
>> >>
>> >
>>
>>
>
Re: Jackrabbit and Jboss (Shared Deployment Model)
Posted by Edgar Poce <ed...@gmail.com>.
hi,
On 7/4/06, Umesh Singh <um...@iogloballtd.com> wrote:
> Hi Edgar,
>
> Thanks for the wiki post. I am able to setup jackrabbit according to the
> instructions given there but still I am not able to do the RMI bit.
> Still I am not able to understand how putting just a jar in deploy
> folder will make it accessible over rmi?
>
there's a service descriptor inside the built jar that manages the
jcr-rmi lifecycle, it starts the jcr-rmi layer and binds it to a jndi
address.
> Should it not have some JBoss MBean deployed in SAR or Or I am missing
> something?
>
there's an MBean inside the jar. see
http://svn.apache.org/viewvc/jackrabbit/trunk/jcr-rmi/src/java/org/apache/jackrabbit/rmi/server/jmx/
br,
edgar
> Regards,
> Umesh
>
> Edgar Poce wrote:
> > Hi Umesh,
> >
> > On 7/3/06, Umesh Singh <um...@iogloballtd.com> wrote:
> >> Hi,
> >>
> >> I'm trying to deploy Jackrabbit under Jboss in a shared deployment model
> >>
> >
> > take a look to http://wiki.apache.org/jackrabbit/JackrabbitOnJBoss.
> > see the section "Deploy Jackrabbit with JCA".
> >
> > br,
> > edgar
> >
> >> I tried deploying directly using RegistryHelper which works and I can
> >> see on JBoss console that Repository has been deployed
> >> but when I try to do the lookup It seems Jackrabbit tries to start a
> >> new instance of the repository. This fails because the .lock file
> >> exists from when I initially invoked RegistryHelper.
> >>
> >> Has anyone deployed under Jboss using model 2? Is there something wrong?
> >>
> >>
> >> Regards,
> >> Umesh
> >>
> >
>
>
Re: Jackrabbit and Jboss (Shared Deployment Model)
Posted by Umesh Singh <um...@iogloballtd.com>.
Hi Edgar,
Thanks for the wiki post. I am able to setup jackrabbit according to the
instructions given there but still I am not able to do the RMI bit.
Still I am not able to understand how putting just a jar in deploy
folder will make it accessible over rmi?
Should it not have some JBoss MBean deployed in SAR or Or I am missing
something?
Regards,
Umesh
Edgar Poce wrote:
> Hi Umesh,
>
> On 7/3/06, Umesh Singh <um...@iogloballtd.com> wrote:
>> Hi,
>>
>> I'm trying to deploy Jackrabbit under Jboss in a shared deployment model
>>
>
> take a look to http://wiki.apache.org/jackrabbit/JackrabbitOnJBoss.
> see the section "Deploy Jackrabbit with JCA".
>
> br,
> edgar
>
>> I tried deploying directly using RegistryHelper which works and I can
>> see on JBoss console that Repository has been deployed
>> but when I try to do the lookup It seems Jackrabbit tries to start a
>> new instance of the repository. This fails because the .lock file
>> exists from when I initially invoked RegistryHelper.
>>
>> Has anyone deployed under Jboss using model 2? Is there something wrong?
>>
>>
>> Regards,
>> Umesh
>>
>
Re: Jackrabbit and Jboss (Shared Deployment Model)
Posted by Edgar Poce <ed...@gmail.com>.
Hi Umesh,
On 7/3/06, Umesh Singh <um...@iogloballtd.com> wrote:
> Hi,
>
> I'm trying to deploy Jackrabbit under Jboss in a shared deployment model
>
take a look to http://wiki.apache.org/jackrabbit/JackrabbitOnJBoss.
see the section "Deploy Jackrabbit with JCA".
br,
edgar
> I tried deploying directly using RegistryHelper which works and I can see on JBoss console that Repository has been deployed
> but when I try to do the lookup It seems Jackrabbit tries to start a new instance of the repository. This fails because the .lock file
> exists from when I initially invoked RegistryHelper.
>
> Has anyone deployed under Jboss using model 2? Is there something wrong?
>
>
> Regards,
> Umesh
>