You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Craig Ganoe <cg...@psu.edu> on 2010/10/13 13:33:30 UTC

changing the Jackrabbit embedded repository code

Is there an "easy" way for me to make modifications to the embedded  
Jackrabbit repository that gets bundled with the standalone Sling?

I've built Sling from the latest code, and I've built a modified  
version of Jackrabbit 2.1.1 (which is what it looked like Sling uses)  
separately. I don't see where Sling gets its embedded Jackrabbit though.

All I'm trying to do is get a version of Jackrabbit into Sling where  
the ObservationManager's Event.getIdentifer() method is functional via  
RMI. Jackrabbit has currently left these unimplemented for RMI.

Thanks for any input on how to do this.

Craig


Re: changing the Jackrabbit embedded repository code

Posted by Vidar Ramdal <vi...@idium.no>.
> On 10/13/10 9:37 AM, Craig Ganoe wrote:
>> If the change to the pom.xml file is "simple", care to explain that
>> part? Apparently I got the hard part.

On Wed, Oct 13, 2010 at 3:51 PM, Justin Edelson <ju...@gmail.com> wrote:
> Actually, Vidar got this second part wrong. As of 2.0,
> jackrabbit-jcr-rmi is an OSGi bundle and, as such, is just included into
> the Sling JAR/WAR. So the actual file to patch is
> /launchpad/builder/src/main/bundles/list.xml

Ah, I'm still stuck on 1.6 ... need to get upgraded to 2.0 sooooon!

-- 
Vidar S. Ramdal <vi...@idium.no> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00 / +47 22 00 84 76
Quando omni flunkus moritatus!

Re: changing the Jackrabbit embedded repository code

Posted by Craig Ganoe <cg...@psu.edu>.
Excellent advice, particularly on the version naming. Though you made  
it too easy, and I didn't need to read the Maven docs (but my  
appreciation for Maven has increased somewhat). Thanks!

Now I just have to debug my RMI code.

On Oct 13, 2010, at 9:51 AM, Justin Edelson wrote:

> On 10/13/10 9:37 AM, Craig Ganoe wrote:
>>
>> On Oct 13, 2010, at 8:34 AM, Vidar Ramdal wrote:
>>> On Wed, Oct 13, 2010 at 1:33 PM, Craig Ganoe <cg...@psu.edu> wrote:
>>>>
>>>> Is there an "easy" way for me to make modifications to the embedded
>>>> Jackrabbit repository that gets bundled with the standalone Sling?
>>>>
>>>> I've built Sling from the latest code, and I've built a modified
>>>> version of
>>>> Jackrabbit 2.1.1 (which is what it looked like Sling uses)  
>>>> separately. I
>>>> don't see where Sling gets its embedded Jackrabbit though.
>>>>
>>>> All I'm trying to do is get a version of Jackrabbit into Sling  
>>>> where the
>>>> ObservationManager's Event.getIdentifer() method is functional  
>>>> via RMI.
>>>> Jackrabbit has currently left these unimplemented for RMI.
>>>>
>>>> Thanks for any input on how to do this.
>>>
>>> I guess you will have to build your own version of
>>> jackrabbit-jcr-rmi.jar (if that's what you need to get the method
>>> exposed via RMI).
>>
>> Already did that, and have the jar. It also looks like what I built  
>> was
>> also installed in some kind of repository off my home directory  
>> (hoping
>> this is useful later):
>> .m2/repository/org/apache/jackrabbit/jackrabbit-jcr-rmi/2.1.1/ 
>> jackrabbit-jcr-rmi-2.1.1.jar
>
> You would be better off modifying the version to indicate that it's
> patched. First, delete the patched version you installed in your local
> Maven repository, then modify the jackrabbit-jcr-rmi POM file to  
> have a
> unique version (2.1.1-psu-1 would be my suggestion). Then re-run mvn
> install.
>
>>
>>
>>> Then you would have to roll your own version of the bundle Sling
>>> Jackrabbit Embedded Repository
>>> (org.apache.sling.jcr.jackrabbit.server), where the only  
>>> modification
>>> you need is to include your jackrabbi-jcr-rmi.jar instead of the
>>> standard one. A simple change in the pom.xml should be enough.
>>
>> Right, but I know nothing about Maven and pom files, and it looks  
>> like
>> there is far more than one pom.xml file in the Sling source tree.  
>> Seems
>> like there are at least two references to "jackrabbit-jcr-rmi" in
>> pom.xml files:
>>
>> bundles/jcr/jackrabbit-server/pom.xml
>> bundles/jcr/base/pom.xml
>>
>> Both of which have:
>>        <dependency>
>>            <groupId>org.apache.jackrabbit</groupId>
>>            <artifactId>jackrabbit-jcr-rmi</artifactId>
>>            <version>2.0.0</version>
>>            <scope>provided</scope>
>>        </dependency>
>>
>> If the change to the pom.xml file is "simple", care to explain that
>> part? Apparently I got the hard part.
>>
> Actually, Vidar got this second part wrong. As of 2.0,
> jackrabbit-jcr-rmi is an OSGi bundle and, as such, is just included  
> into
> the Sling JAR/WAR. So the actual file to patch is
> /launchpad/builder/src/main/bundles/list.xml
>
> That said, you really would be well-served by learning a bit about
> Maven. You don't need to be a master, but reading the first few  
> chapters
> of either
> http://www.sonatype.com/books/mvnex-book/reference/public-book.html or
> http://www.sonatype.com/books/mvnref-book/reference/public-book.html
> would pay dividends.
>
> Justin
>


Re: changing the Jackrabbit embedded repository code

Posted by Justin Edelson <ju...@gmail.com>.
On 10/13/10 9:37 AM, Craig Ganoe wrote:
> 
> On Oct 13, 2010, at 8:34 AM, Vidar Ramdal wrote:
>> On Wed, Oct 13, 2010 at 1:33 PM, Craig Ganoe <cg...@psu.edu> wrote:
>>>
>>> Is there an "easy" way for me to make modifications to the embedded
>>> Jackrabbit repository that gets bundled with the standalone Sling?
>>>
>>> I've built Sling from the latest code, and I've built a modified
>>> version of
>>> Jackrabbit 2.1.1 (which is what it looked like Sling uses) separately. I
>>> don't see where Sling gets its embedded Jackrabbit though.
>>>
>>> All I'm trying to do is get a version of Jackrabbit into Sling where the
>>> ObservationManager's Event.getIdentifer() method is functional via RMI.
>>> Jackrabbit has currently left these unimplemented for RMI.
>>>
>>> Thanks for any input on how to do this.
>>
>> I guess you will have to build your own version of
>> jackrabbit-jcr-rmi.jar (if that's what you need to get the method
>> exposed via RMI).
> 
> Already did that, and have the jar. It also looks like what I built was
> also installed in some kind of repository off my home directory (hoping
> this is useful later):
> .m2/repository/org/apache/jackrabbit/jackrabbit-jcr-rmi/2.1.1/jackrabbit-jcr-rmi-2.1.1.jar

You would be better off modifying the version to indicate that it's
patched. First, delete the patched version you installed in your local
Maven repository, then modify the jackrabbit-jcr-rmi POM file to have a
unique version (2.1.1-psu-1 would be my suggestion). Then re-run mvn
install.

> 
> 
>> Then you would have to roll your own version of the bundle Sling
>> Jackrabbit Embedded Repository
>> (org.apache.sling.jcr.jackrabbit.server), where the only modification
>> you need is to include your jackrabbi-jcr-rmi.jar instead of the
>> standard one. A simple change in the pom.xml should be enough.
> 
> Right, but I know nothing about Maven and pom files, and it looks like
> there is far more than one pom.xml file in the Sling source tree. Seems
> like there are at least two references to "jackrabbit-jcr-rmi" in
> pom.xml files:
> 
> bundles/jcr/jackrabbit-server/pom.xml
> bundles/jcr/base/pom.xml
> 
> Both of which have:
>         <dependency>
>             <groupId>org.apache.jackrabbit</groupId>
>             <artifactId>jackrabbit-jcr-rmi</artifactId>
>             <version>2.0.0</version>
>             <scope>provided</scope>
>         </dependency>
> 
> If the change to the pom.xml file is "simple", care to explain that
> part? Apparently I got the hard part.
> 
Actually, Vidar got this second part wrong. As of 2.0,
jackrabbit-jcr-rmi is an OSGi bundle and, as such, is just included into
the Sling JAR/WAR. So the actual file to patch is
/launchpad/builder/src/main/bundles/list.xml

That said, you really would be well-served by learning a bit about
Maven. You don't need to be a master, but reading the first few chapters
of either
http://www.sonatype.com/books/mvnex-book/reference/public-book.html or
http://www.sonatype.com/books/mvnref-book/reference/public-book.html
would pay dividends.

Justin

Re: changing the Jackrabbit embedded repository code

Posted by Craig Ganoe <cg...@psu.edu>.
On Oct 13, 2010, at 8:34 AM, Vidar Ramdal wrote:
> On Wed, Oct 13, 2010 at 1:33 PM, Craig Ganoe <cg...@psu.edu> wrote:
>>
>> Is there an "easy" way for me to make modifications to the embedded
>> Jackrabbit repository that gets bundled with the standalone Sling?
>>
>> I've built Sling from the latest code, and I've built a modified  
>> version of
>> Jackrabbit 2.1.1 (which is what it looked like Sling uses)  
>> separately. I
>> don't see where Sling gets its embedded Jackrabbit though.
>>
>> All I'm trying to do is get a version of Jackrabbit into Sling  
>> where the
>> ObservationManager's Event.getIdentifer() method is functional via  
>> RMI.
>> Jackrabbit has currently left these unimplemented for RMI.
>>
>> Thanks for any input on how to do this.
>
> I guess you will have to build your own version of
> jackrabbit-jcr-rmi.jar (if that's what you need to get the method
> exposed via RMI).

Already did that, and have the jar. It also looks like what I built  
was also installed in some kind of repository off my home directory  
(hoping this is useful later):
.m2/repository/org/apache/jackrabbit/jackrabbit-jcr-rmi/2.1.1/ 
jackrabbit-jcr-rmi-2.1.1.jar

> Then you would have to roll your own version of the bundle Sling
> Jackrabbit Embedded Repository
> (org.apache.sling.jcr.jackrabbit.server), where the only modification
> you need is to include your jackrabbi-jcr-rmi.jar instead of the
> standard one. A simple change in the pom.xml should be enough.

Right, but I know nothing about Maven and pom files, and it looks like  
there is far more than one pom.xml file in the Sling source tree.  
Seems like there are at least two references to "jackrabbit-jcr-rmi"  
in pom.xml files:

bundles/jcr/jackrabbit-server/pom.xml
bundles/jcr/base/pom.xml

Both of which have:
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>jackrabbit-jcr-rmi</artifactId>
             <version>2.0.0</version>
             <scope>provided</scope>
         </dependency>

If the change to the pom.xml file is "simple", care to explain that  
part? Apparently I got the hard part.


Re: changing the Jackrabbit embedded repository code

Posted by Vidar Ramdal <vi...@idium.no>.
On Wed, Oct 13, 2010 at 1:33 PM, Craig Ganoe <cg...@psu.edu> wrote:
>
> Is there an "easy" way for me to make modifications to the embedded
> Jackrabbit repository that gets bundled with the standalone Sling?
>
> I've built Sling from the latest code, and I've built a modified version of
> Jackrabbit 2.1.1 (which is what it looked like Sling uses) separately. I
> don't see where Sling gets its embedded Jackrabbit though.
>
> All I'm trying to do is get a version of Jackrabbit into Sling where the
> ObservationManager's Event.getIdentifer() method is functional via RMI.
> Jackrabbit has currently left these unimplemented for RMI.
>
> Thanks for any input on how to do this.

I guess you will have to build your own version of
jackrabbit-jcr-rmi.jar (if that's what you need to get the method
exposed via RMI).

Then you would have to roll your own version of the bundle Sling
Jackrabbit Embedded Repository
(org.apache.sling.jcr.jackrabbit.server), where the only modification
you need is to include your jackrabbi-jcr-rmi.jar instead of the
standard one. A simple change in the pom.xml should be enough.

-- 
Vidar S. Ramdal <vi...@idium.no> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00 / +47 22 00 84 76
Quando omni flunkus moritatus!