Thank you for the reply,
so I added @Cache to my Service and "@Context ServerCache cache" as parameter
to the Cache annotated Service,
in the web.xml i added the following
<context-param>
<param-name>server.request.cache.infinispan.config.file</param-name>
<param-value>infinispan.xml</param-value>
</context-param>
<context-param>
<param-name>server.request.cache.infinispan.cache.name</param-name>
<param-value>MyCache</param-value>
</context-param>
Couldn't really find something about the cache config file so I didn't know
what todo.
Next up I created a new Class
public class Application extends javax.ws.rs.core.Application {
public Set<Class<?>> getClasses() {
return super.getClasses();
}
}
and changed the web.xml to
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>net.devvsbugs.coding.daraku_mal_api.Application</param-value>
</init-param>
</servlet>
is this all I need to do? Does it has something with the cache config file todo?
Thank you.
> Date: Wed, 29 Oct 2014 15:13:45 -0400
> From: [email protected]
> To: [email protected]
> Subject: Re: [Resteasy-users] Use Resteasy server-side Cache
>
> Implementation was refactored and reimplemneted in 3.0:
>
> http://docs.jboss.org/resteasy/docs/3.0.9.Final/userguide/html/Cache_NoCache_CacheControl.html#server_cache
>
> On 10/29/2014 1:35 PM, Frederic Eßer wrote:
> > Hello everyone,
> >
> > I develop a software which provides webservices on a tomcat. These
> > webservices parse and display data from a 3rd website with JSOUP in XML
> > or JSON format.
> > Now I want to use the server-side caching to reduce the requests be made
> > to these websites.
> > The Project is managed with Maven and I'm using the 3.0.6.Final version
> > of resteasy and it will all be deployed on an integrated Tomcat 7 for
> > testing purposes.
> >
> > While researching on how to get the caching into my project I stumbled
> > upon this link
> > http://docs.jboss.org/resteasy/docs/1.1.GA/userguide/html/Cache_NoCache_CacheControl.html
> > which I thought contained everything I needed. So I added the dependency
> > to my pom
> >
> > <dependency>
> > <groupId>org.jboss.resteasy</groupId>
> > <artifactId>resteasy-cache-core</artifactId>
> > <version>3.0.9.Final</version>
> > </dependency>
> >
> > and added the context parameter to my web.xml
> >
> > <context-param>
> > <param-name>resteasy.server.cache.maxsize</param-name>
> > <param-value>1000</param-value>
> > </context-param>
> >
> > <context-param>
> >
> > <param-name>resteasy.server.cache.eviction.wakeup.interval</param-name>
> > <param-value>5000</param-value>
> > </context-param>
> >
> > <listener>
> >
> > <listener-class>org.jboss.resteasy.plugins.cache.server.ServletServerCache</listener-class>
> > </listener>
> >
> > But while trying to run the project on my server I get the following
> > exception
> >
> > SEVERE: Error configuring application listener of class
> > org.jboss.resteasy.plugins.cache.server.ServletServerCache
> > java.lang.ClassNotFoundException:
> > org.jboss.resteasy.plugins.cache.server.ServletServerCache
> > at
> > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
> > at
> > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
> > at
> > org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
> > at
> > org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
> > at
> > org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
> > at
> > org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4638)
> > at
> > org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
> > at
> > org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
> > at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> > at
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > at
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > at java.lang.Thread.run(Thread.java:745)
> >
> > So I build the war with Maven -> build and checked for the jar file in
> > WEB-INF/lib/ and found the resteasy-cache-core-3.0.9.Final.jar.
> >
> > What is going wrong? Or is the way on approaching the server-side cache
> > implementation wrong?
> >
> > Thank you.
> >
> >
> > ------------------------------------------------------------------------------
> >
> >
> >
> > _______________________________________________
> > Resteasy-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/resteasy-users
> >
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Resteasy-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
------------------------------------------------------------------------------
_______________________________________________
Resteasy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/resteasy-users