[JBoss Seam] - Re: How to set expiry time for s:cache?
by satellite
I'm using this treecache.xml with success:
<?xml version="1.0" encoding="UTF-8"?>
| <server>
| <mbean code="org.jboss.cache.TreeCache"
| name="jboss.cache:service=TreeCache">
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
|
| <!-- Configure the TransactionManager -->
| <attribute name="TransactionManagerLookupClass">
| org.jboss.cache.JBossTransactionManagerLookup
| </attribute>
|
| <!-- Specific eviction policy configurations. -->
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">5</attribute>
|
| <!-- Cache wide default -->
| <region name="/_default_"
| policyClass="org.jboss.cache.eviction.LRUPolicy">
| <!-- This is the maximum number of nodes allowed in this region. -->
| <!-- 0 denotes no limit. -->
| <attribute name="maxNodes">0</attribute>
|
| <!-- The amount of time a node is not written to or read (in seconds) before the node is swept away. -->
| <!-- 0 denotes no limit. -->
| <attribute name="timeToLiveSeconds">0</attribute>
|
| <!-- Lifespan of a node (in seconds) regardless of idle time before the node is swept away. -->
| <!-- 0 denotes no limit. -->
| <attribute name="maxAgeSeconds">0</attribute>
| </region>
|
| <region name="/5sec"
| policyClass="org.jboss.cache.eviction.LRUPolicy">
| <attribute name="maxNodes">0</attribute>
| <attribute name="timeToLiveSeconds">0</attribute>
| <attribute name="maxAgeSeconds">5</attribute>
| </region>
| </config>
| </attribute>
| </mbean>
| </server>
|
Code for testing:
| <table border="1">
| <tr>
| <td><b>Short term cache ('/5sec'):</b></td>
| <td>
| <s:cache region="/5sec" key="now" enabled="true">
| <h:outputText value="#{form.info.now()}" />
| </s:cache>
| </td>
| </tr>
| <tr>
| <td><b>Long term cache ('/forever'):</b></td>
| <td>
| <s:cache region="/forever" key="now" enabled="true">
| <h:outputText value="#{form.info.now()}" />
| </s:cache>
| </td>
| </tr>
| </table>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107563#4107563
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107563
18 years, 6 months
[Installation, Configuration & DEPLOYMENT] - EAR structure: jndi.properties and logging
by fla83tn
Hi to all!
I would like to know how to package correctly a Java EE (EJB3) application. My EAR has 3 archives inside:
- WAR module (warmodule.war)
- EJB-JAR module (ejbmodule.jar)
- SWING application client module (swing-client.jar)
All of them perform logging and use a ServiceLocator to perform lookup of objects via JNDI. Since I deploy all of them as a unique package I would like to know how to construct the EAR archive correctly.
Two fundamental questions:
1) Where to put jndi.properties and log4j.properties? Am I able to put just one copy of them in the EAR archive and see them from other archives or do I need to put them in each package? At the moment it works just putting them in the swing-client.jar but I don't know why..(however I can't see any logging from the server side...is it really needed to change also jboss-log4j.xml in the Jboss server/conf directory?)
2) When I get the logger, do I need to import org.jboss.logging.Logger
or org.apache.log4j.Logger?? Which are the differences?
Any help is appreciated!! Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107559#4107559
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107559
18 years, 6 months
[JBoss Portal] - portlet with ajax4jsf1.1.1 problem
by jackyluck
I try Ajax(Ajax4jsf1.1.1) function with jsf and portlet ,I don't konw why it have a error of jsp page when click the button of jsp page ,the error is :
Request error,status:500 (/404 )internal Server error
and the server log error is :
2007-11-25 11:34:25,968 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/ajaxTest2].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
java.lang.ClassCastException: org.apache.catalina.core.ApplicationContextFacade cannot be cast to javax.portlet.PortletContext
at com.sun.faces.portlet.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:64)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:239)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
1.below is my web xml :
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
REQUEST
FORWARD
INCLUDE
</filter-mapping>
2.below is my jsp :
<h:form>
<h:inputText id="test" value="#{managebean.info}">
<a4j:support event="onkeyup" reRender="test3"/>
</h:inputText>
<a4j:commandButton id="dd" value="Ajax button">
<a4j:support action="#{managebean.pring}" event="onclick" reRender="test3"/>
</a4j:commandButton>
</h:form>
</f:view>
3.I add ajax4jsf-1.1.1.jar and ajax4jsf-protlet-1.1.1.jar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107554#4107554
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107554
18 years, 6 months