unable to lookup infispan cache
ashishtm Jun 9, 2015 2:52 AM
Hi all,
I am new to JBOSS cache and am facing a lot of problem,
In standalone.xml I added
<cache-container name="web" aliases="standard-session-cache" default-cache="dist" jndi-name="java:jboss/infinispan/NextGenNMS">
<local-cache name="dist" batching="false">
<file-store passivation="false" purge="false"/>
</local-cache>
</cache-container>
now an creating a war for a standalone application containg a index.jsp to show the content of cache.
The code is shown below
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="org.infinispan.Cache" %>
<%@ page import="org.jboss.as.clustering.infinispan.DefaultCacheContainer" %>
<%@ page import=" javax.naming.InitialContext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>test</title>
</head>
<body>
<%
InitialContext initialContext = new InitialContext();
DefaultCacheContainer cacheContainer = (DefaultCacheContainer) initialContext.lookup("java:jboss/infinispan/NextGenNMS");
Cache<Object, Object> cache = cacheContainer.getCache();
out.println("printing cache : "+cache);
%>
</body>
</html>
but upon deploying I ma getting the error below
JBWEB000309: type JBWEB000066: Exception report
JBWEB000068: message javax.naming.NameNotFoundException: infinispan/NextGenNMS -- service jboss.naming.context.java.jboss.infinispan.NextGenNMS
JBWEB000069: description JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.
JBWEB000070: exception
javax.servlet.ServletException: javax.naming.NameNotFoundException: infinispan/NextGenNMS -- service jboss.naming.context.java.jboss.infinispan.NextGenNMS
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:845)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.index_jsp._jspService(index_jsp.java:87)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
I am attaching the war too(TestInfispan.war)
Please suggest what to do . As this is quiet important and I have spend a lot of time on this but I am unable to solve
-
TestInfispan.war 2.5 MB