활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
I just trying to create the node in the cq and migrating the aem6 to mongodb and supported jars listed below
Oak-jcr-0.9.jar, Oak-core-0.8.jar, oak-mongomk-0.8, oak-mongomk-0.9 by importing the com.mongodb.*, org.apache.jackrabbit.oak.*, and other corresponding packages
and i tried to create the node using the others site help like "http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2013/12/starting_with_apacheoak.ht..." but the main issues is that after writting the code when i compile the code i am facing the problem like this
"
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.jackrabbit.oak.kernel.KernelNodeState.readProperty(KernelNodeState.java:638)
at org.apache.jackrabbit.oak.kernel.KernelNodeState.init(KernelNodeState.java:180)
at org.apache.jackrabbit.oak.kernel.KernelNodeState.hasChildNode(KernelNodeState.java:262)
at org.apache.jackrabbit.oak.plugins.memory.MutableNodeState.hasChildNode(MutableNodeState.java:268)
at org.apache.jackrabbit.oak.plugins.memory.MemoryNodeBuilder.hasChildNode(MemoryNodeBuilder.java:262)
at org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent.initialize(InitialContent.java:52)
at org.apache.jackrabbit.oak.spi.lifecycle.CompositeInitializer.initialize(CompositeInitializer.java:47)
at org.apache.jackrabbit.oak.spi.lifecycle.OakInitializer.initialize(OakInitializer.java:43)
at org.apache.jackrabbit.oak.Oak.createContentRepository(Oak.java:247)
at org.apache.jackrabbit.oak.jcr.Jcr.createRepository(Jcr.java:153)
at CreateCollectiobn.main(CreateCollectiobn.java:100)
Caused by: java.lang.IllegalArgumentException: unknown type: 10
at javax.jcr.PropertyType.nameFromValue(PropertyType.java:92)
at org.apache.jackrabbit.oak.kernel.TypeCodes.<clinit>(TypeCodes.java:40)
... 11 more
"
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
That blog post is about bootstrapping a new Oak instance. If you are using AEM, you already have an instance of Oak running. You should just use the JCR API to create nodes.
Regards,
Justin
조회 수
답글
좋아요 수
That blog post is about bootstrapping a new Oak instance. If you are using AEM, you already have an instance of Oak running. You should just use the JCR API to create nodes.
Regards,
Justin
조회 수
답글
좋아요 수
it is compile time issue & need to verify your code. Post your example.
조회 수
답글
좋아요 수
Repository repo = new Jcr(kernel).createRepository();
ContentRepository repository = new Oak().createContentRepository();*/
Root root = new Oak().createRoot();
Session session = repo.login(new SimpleCredentials("admin", "admin".toCharArray()));
Node rootNode = (Node) session.getRootNode();
((javax.jcr.Node) rootNode).addNode("oakrocks", "nt:unstructured");
session.save();
Iam using the above for node creation in mongodbmk and its giving me any compilation error and while executing the program its giving the error
Thanks,
Pavan
조회 수
답글
좋아요 수
Hi Pavan,
for AEM, you dont have to create a new repository as it will already be existing. you can just login, use the jcr api and create the nodes
조회 수
답글
좋아요 수
import com.day.cq.commons.jcr.JcrUtil;
@reference
Session session;
session = repo.loginAdministrative(null);
Node root = session.getRootNode();
boolean nodeCheck = root.hasNode(nodePath);
Node path = null;
if(!nodeCheck){
JcrUtil.createPath(nodePath, NT_UNSTRUCTURED, NT_UNSTRUCTURED, session, true);
}
path = root.getNode(nodePath);
조회 수
답글
좋아요 수
조회 수
Likes
답글
조회 수
Likes
답글
조회 수
Likes
답글