We have been trying to get Coherence working with CQ5.5. We have read the steps given in an earlier thread and tried to follow them but none of the approaches work with CQ5.5 and Coherence 3.7. This is what we have tried so far.
We created plugin-jar containing coherence.jar using Eclipse and then deployed/installed in my local CQ5 author installation using CQ5 Web Console Bundles - install/update. The bundle was installed and started without any errors.
Created a simple jsp using CQ5.5's geometrixx content page and modified it as given in the above thread to just test coherence.
<%-- Sample jsp--%><%@include file="/libs/foundation/global.jsp" %><%@ page import="com.tangosol.net.CacheFactory,com.tangosol.net.NamedCache" %><% String key = "k2"; String value = "Hello World from cq!"; ClassLoader oldLoader = Thread.currentThread().getContextClassLoader(); ClassLoader newLoader = com.tangosol.net.CacheFactory.class.getClassLoader(); Thread.currentThread().setContextClassLoader(newLoader); CacheFactory.ensureCluster(); NamedCache cache = CacheFactory.getCache("hello-example"); cache.put(key, value); out.println((String)cache.get(key)); CacheFactory.shutdown(); Thread.currentThread().setContextClassLoader(oldLoader); %><div id="main"> <div class="container_16"> Hello, my name is 1.1 <div class="grid_16"> <cq:include path="carousel" resourceType="foundation/components/carousel"/> </div> <div class="grid_12 body_container"> <cq:include path="lead" resourceType="geometrixx/components/lead"/> <cq:include path="par" resourceType="foundation/components/parsys"/> </div> <div class="grid_4 right_container"> <cq:include path="rightpar" resourceType="foundation/components/parsys"/> </div> <div class="clear"></div> </div></div>
These are the errors that we are seeing.
Caused by: (Wrapped) java.lang.NoClassDefFoundError: javax/naming/NamingException at com.tangosol.util.Base.ensureRuntimeException(Base.java:288) at com.tangosol.util.Base.ensureRuntimeException(Base.java:269) at com.tangosol.net.CacheFactory.getCluster(CacheFactory.java:392) at com.tangosol.net.CacheFactory.ensureCluster(CacheFactory.java:421) at org.apache.jsp.apps.geometrixx.components.homepage.content_jsp._jspService(content_jsp.java:169) at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:420) ... 126 more Caused by: java.lang.NoClassDefFoundError: javax/naming/NamingException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.tangosol.net.CacheFactory.<clinit>(CacheFactory.java:923) at org.apache.jsp.apps.geometrixx.components.homepage.content_jsp._jspService(content_jsp.java:171) ... 129 more Caused by: java.lang.ClassNotFoundException: javax.naming.NamingException not found by Coherence_vs [238] at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787) at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768) at java.lang.ClassLoader.loadClass(Unknown Source) ... 133 more
The steps below given in the above thread don't seem to be valid in CQ5.5 anymore like for example -
- Deploy the hello.war file by going to cq servlet engine at http://<host>:<port>/admin( did not see http://<host>:<port>/admin option in the current CQ5.5 installation)
or
- Place coherence.jar at <CQ_Install_Dir>/crx-quickstart/server/runtime/0/_/WEB-INF/lib/ (there is no such directory in the current CQ5.5 installation)
Would really appreciate any help. Thank you in advance.
VS