jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chetan Mehrotra (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (OAK-3248) Felix Connect throws exception when launching Oak in Spring Boot env
Date Tue, 18 Aug 2015 09:26:45 GMT

    [ https://issues.apache.org/jira/browse/OAK-3248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14700991#comment-14700991
] 

Chetan Mehrotra edited comment on OAK-3248 at 8/18/15 9:25 AM:
---------------------------------------------------------------

Fixed the issue by providing a custom {{Revision}} implementation for Spring Boot based deployments.
This feature needs to be explicitly enabled via setting {{org.apache.jackrabbit.oak.repository.springBootMode}}
to {{true}} in config passed to RepositoryFactory

The custom revision implementation makes use of {{getUrl}} [1] method meet the requirement
as done in Felix {{JarRevision}} [2]. This avoids creating custom URL based on some implicit
convention

Done in rev http://svn.apache.org/r1696375

[1] https://github.com/spring-projects/spring-boot/blob/v1.2.5.RELEASE/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarEntry.java#L58
[2] https://github.com/apache/felix/blob/trunk/connect/src/main/java/org/apache/felix/connect/JarRevision.java#L66


was (Author: chetanm):
Fixed the issue by providing a custom {{Revision}} implementation for Spring Boot based deployments.
This feature needs to be explicitly enabled via setting {{org.apache.jackrabbit.oak.repository.springBootMode}}
to {{true}} in config passed to RepositoryFactory

The custom revision implementation makes use of {{getUrl}} [1] method meet the requirement
as done in Felix {{JarRevision}} [2]. This avoids creating custom URL based on some implicit
convention

[1] https://github.com/spring-projects/spring-boot/blob/v1.2.5.RELEASE/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarEntry.java#L58
[2] https://github.com/apache/felix/blob/trunk/connect/src/main/java/org/apache/felix/connect/JarRevision.java#L66

> Felix Connect throws exception when launching Oak in Spring Boot env
> --------------------------------------------------------------------
>
>                 Key: OAK-3248
>                 URL: https://issues.apache.org/jira/browse/OAK-3248
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: pojosr
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: 1.3.5
>
>
> When using Oak with pojosr support in Spring Boot based application then following exception
is seen
> {noformat}
> Caused by: java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: String
index out of range: -4
>         at org.apache.jackrabbit.oak.run.osgi.OakOSGiRepositoryFactory.startBundles(OakOSGiRepositoryFactory.java:341)
>         at org.apache.jackrabbit.oak.run.osgi.OakOSGiRepositoryFactory.initializeServiceRegistry(OakOSGiRepositoryFactory.java:217)
>         at org.apache.jackrabbit.oak.run.osgi.OakOSGiRepositoryFactory.getRepository(OakOSGiRepositoryFactory.java:161)
>         at com.meta64.mobile.repo.OakRepository.createRepository(OakRepository.java:258)
>         at com.meta64.mobile.repo.OakRepository.initRepository(OakRepository.java:226)
>         at com.meta64.mobile.repo.OakRepository.postConstruct(OakRepository.java:158)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
>         at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
>         at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
>         ... 51 more
> Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -4
>         at java.lang.String.substring(String.java:1875)
>         at org.apache.felix.connect.PojoSR.buildRevision(PojoSR.java:334)
>         at org.apache.felix.connect.PojoSR.startBundles(PojoSR.java:259)
>         at org.apache.jackrabbit.oak.run.osgi.OakOSGiRepositoryFactory.startBundles(OakOSGiRepositoryFactory.java:339)
>         ... 63 more
> {noformat}
> Application used here a modified form of https://github.com/Clay-Ferguson/meta64



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message