This conversation has been locked due to inactivity. Please create a new post.
This conversation has been locked due to inactivity. Please create a new post.
I migrated my code base from aem 5.6.1 to 6.0 instance still using 5.6 api. It worked fine.
I decided to start using 6.0 api so created new pom files using mvn. That worked fine too.
I placed my code in to the bundle and compiled successfully and uploaded and installed my package.
However my bundle would not start because i am missing a required package, org.apache.jackrabbit.uuid -- Cannot be resolved
I don't use this class directly. It must be used by some other jackrabbit class.
I have this dependency in my pom file
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
<version>2.8.0</version>
<scope>provided</scope>
</dependency>
I tried different versions with out any success. I tried adding jackrabbit-core version 1.0 and 1.1. Needles to say nothing worked.
Could some one tell me what version or what other dependency I can add to resolve my issue?
Thanks and regards,
Solved! Go to Solution.
Views
Replies
Total Likes
I built a test AEM OSGi bundle that uses the http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/util/Text.html API.
Here is my test code:
package com.adobe.test;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import javax.jcr.RepositoryException;
import org.apache.felix.scr.annotations.Reference;
import org.apache.jackrabbit.commons.JcrUtils;
import javax.jcr.Session;
import javax.jcr.Node;
//Sling Imports
import org.apache.sling.api.resource.ResourceResolverFactory ;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.Resource;
import org.apache.jackrabbit.util.Text ;
//This is a component so it can provide or consume services
@Component
@Service
public class BuildStringImp implements BuildString {
@Override
public String getThePath() {
// TODO Auto-generated method stub
String myPath = Text.getName("/content/forms");
return myPath;
}
}
I invoked it from a JSP page component:
<%@include file="/libs/foundation/global.jsp" %>
<cq:include script="/libs/wcm/core/components/init/init.jsp"/>
<html>
<head>
<title>AEM UserManager Page</title>
</head>
<body>
<h2>This page invokes the String method</h2>
<%
com.adobe.test.BuildString test = sling.getService(com.adobe.test.BuildString.class);
%>
<h3>"The returned path is : <%=test.getThePath()%></h3>
</body>
</html>
The bundle started on AEM 6 and produced this result:
[img]AStringTest.png[/img]
And I used this dependency in my POM:
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
<version>2.8.0</version>
</dependency>
Views
Replies
Total Likes
Views
Replies
Total Likes
See
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
<modelVersion>4.0.0</modelVersion>
<!-- ====================================================================== -->
<!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<parent>
<groupId>com.aem.community</groupId>
<artifactId>stringtest</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<!-- ====================================================================== -->
<!-- P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<artifactId>stringtest-bundle</artifactId>
<packaging>bundle</packaging>
<name>string Bundle</name>
<!-- ====================================================================== -->
<!-- B U I L D D E F I N I T I O N -->
<!-- ====================================================================== -->
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<executions>
<execution>
<id>generate-scr-descriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>com.aem.community.stringtest-bundle</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
<configuration>
<slingUrl>http://${crx.host}:${crx.port}/apps/string/install</slingUrl>
<usePut>true</usePut>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-core</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.api</artifactId>
<version>2.2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>com.day.cq.wcm</groupId>
<artifactId>cq-wcm-api</artifactId>
<version>5.5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.day.cq</groupId>
<artifactId>cq-commons</artifactId>
<version>5.5.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>adobe</id>
<name>Adobe Public Repository</name>
<url>http://repo.adobe.com/nexus/content/groups/public/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>adobe</id>
<name>Adobe Public Repository</name>
<url>http://repo.adobe.com/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
</project>
Views
Replies
Total Likes
YOu stated you are using the 6.0 api.
What AEM API are you using and what are you trying to do. We need more information so it can be re-duplicated to see if a bug exists or if there is another explanation.
Views
Replies
Total Likes
This is getting interesting.
I put your code with the pom files in to my bundle and got the same error.
Removed jackrabbit.util.Text and all is okay.
I do not have SP1 installed. Do you have it installed?
Views
Replies
Total Likes
Thanks for trying to help me.
I am using this class org.apache.jackrabbit.util.Text; I hope this is what your are asking me.
I need this dependency
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
<version>2.8.0</version>
<scope>provided</scope>
</dependency>
Views
Replies
Total Likes
Adding bundle log, in case it helps
Views
Replies
Total Likes
I am going to build a bundle using this API and will report back my findings.
Views
Replies
Total Likes
I built a test AEM OSGi bundle that uses the http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/util/Text.html API.
Here is my test code:
package com.adobe.test;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import javax.jcr.RepositoryException;
import org.apache.felix.scr.annotations.Reference;
import org.apache.jackrabbit.commons.JcrUtils;
import javax.jcr.Session;
import javax.jcr.Node;
//Sling Imports
import org.apache.sling.api.resource.ResourceResolverFactory ;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.Resource;
import org.apache.jackrabbit.util.Text ;
//This is a component so it can provide or consume services
@Component
@Service
public class BuildStringImp implements BuildString {
@Override
public String getThePath() {
// TODO Auto-generated method stub
String myPath = Text.getName("/content/forms");
return myPath;
}
}
I invoked it from a JSP page component:
<%@include file="/libs/foundation/global.jsp" %>
<cq:include script="/libs/wcm/core/components/init/init.jsp"/>
<html>
<head>
<title>AEM UserManager Page</title>
</head>
<body>
<h2>This page invokes the String method</h2>
<%
com.adobe.test.BuildString test = sling.getService(com.adobe.test.BuildString.class);
%>
<h3>"The returned path is : <%=test.getThePath()%></h3>
</body>
</html>
The bundle started on AEM 6 and produced this result:
[img]AStringTest.png[/img]
And I used this dependency in my POM:
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
<version>2.8.0</version>
</dependency>
Views
Replies
Total Likes
Can you attach your pom file(s) so I can compare with mine?
Views
Replies
Total Likes
Here you are....
I changed to txt to upload it.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies