[JBossCache] - EvictionPolicyConfig and CacheLoaderConfiguration
by sioux
Hi,
I've been looking at eviction policies and have found that my CacheLoaderConfiguration config entry breaks my eviction policy.
e.g. this unit test (taken roughly from jboss src) -
public void testInUseEviction() throws Exception
| {
| long wakeupIntervalMillis_ = 3000;
| String rootStr = "/org/jboss/test/data/inuse/";
| Fqn fqn;
| for (int i = 0; i < 10; i++)
| {
| String str = rootStr + i;
| fqn = Fqn.fromString(str);
| tree.put(fqn, str, str);
| }
|
| Thread.sleep(wakeupIntervalMillis_ + 500);
| tree.getEvictionRegionManager().markNodeCurrentlyInUse(Fqn.fromString(rootStr + 5), 0);
|
| for (int i = 10; i < 15; i++)
| {
| String str = rootStr + i;
| fqn = Fqn.fromString(str);
| tree.put(fqn, str, str);
| }
|
| Thread.sleep(wakeupIntervalMillis_ + 500);
|
| for (int i = 0; i < 5; i++)
| {
| //fails here
| assertNull(tree.get(Fqn.fromString(rootStr + i)));
| }
| }
works with this config:
<server>
|
| <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar" />
| <!-- ==================================================================== -->
| <!-- Defines TreeCache configuration -->
| <!-- ==================================================================== -->
|
| <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
| <attribute name="CacheMode">LOCAL</attribute>
|
|
| <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
|
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">5</attribute>
| <region name="/_default_">
| <attribute name="maxNodes">5000</attribute>
| <attribute name="timeToLiveSeconds">1000</attribute>
| </region>
| <region name="/org/jboss/data">
| <attribute name="maxNodes">5000</attribute>
| <attribute name="timeToLiveSeconds">1000</attribute>
| </region>
| <region name="/org/jboss/test/data">
| <attribute name="maxNodes">5</attribute>
| <attribute name="timeToLiveSeconds">4</attribute>
| </region>
| </config>
| </attribute>
|
|
| </mbean>
| </server>
but not when I include this section:
<attribute name="CacheLoaderConfiguration">
| <config>
| <passivation>false</passivation>
| <preload>/</preload>
| <shared>false</shared>
| <cacheloader>
| <class>org.jboss.cache.loader.FileCacheLoader</class>
|
| <properties>location=/tmp/testcachestore</properties>
|
| <async>false</async>
| <fetchPersistentState>true</fetchPersistentState>
| <ignoreModifications>false</ignoreModifications>
| <purgeOnStartup>true</purgeOnStartup>
| </cacheloader>
|
| </config>
| </attribute>
Is there a way for me to use both features on a single cache? (My goal is to back up the cache to a file store but also to replace all data items over a 24 hour period for which I was considering a custom eviction policy or lazy loading following eviction).
Thanks for any suggestions or help understanding this.
Sioux
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049425#4049425
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049425
18 years, 10 months
[Tomcat, HTTPD, Servlets & JSP] - How to make a .ear use an expanded war classloader
by icordoba
Hi there,
I have the following scenario in my webapps:
- .ear file with EJBs (2.1 & 3)
- expanded war file with the web interface.
I don't include the war in the ear file because in development moment I change many thin in JSPs / struts XMLs /...
JBoss configuration
What is the ClassLoading configuration to make both the .ear EJBS and the webapp search classes before in /WEB-INF/lib than in the .ear file class loader?
I need this because for historical (wrong aprox., of course) reasons, the EJB returns classes that implement some view layer classes, and so I don't want them to be part of the ear file. I have too much code written this way as I used to use Unified Class Loader. My problem now is than I haven't found a way to "mix" both class loaders and so any class retured from the business layer will give ClassNotFound exceptions when used in the presentation layer. (Also, EJB3 POJOs throw ClassCastException). This is solved by packaging the war inside the ear, but I cannot do that.
I am changing properties in the following files:
1) conf/jboss-service.xml set NamingService CallByValue to true
2) deploy/ear-deployer.xml set Isolated and CallByValue attributes to true.
3) deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml set Java2ClassLoadingCompliance and UseJBossWebLoader to false
4) /WEB-INF/jboss-web.xml
5) /META-INF/jboss-app.xml
Thanks for any help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049424#4049424
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049424
18 years, 10 months
[JNDI/Naming/Network] - Re: javax.naming.NamingException: userEntity not bound
by v_anusuya
Thank you for the useful link. My jboss.xml and ejb-jar.xml files have the required changes. But I still get the junk characters in the jndi name.
Here are some snippets from jboss.xml and ejb-jar.xml files:-
//jboss.xml
<message-driven>
<ejb-name>ejb/messageServerMessage</ejb-name>
<local-jndi-name>ejb/messageServerMessage</local-jndi-name>
<destination-jndi-name>queue/MessageQueue</destination-jndi-name>
<resource-ref>
<res-ref-name>topic/MessageTopic</res-ref-name>
<jndi-name>topic/MessageTopic</jndi-name>
</resource-ref>
</message-driven>
//ejb-jar.xml
<display-name>ACLSessionBean</display-name>
<ejb-name>ejb/aclSession</ejb-name>
com.wdp.workflow.sessions.aclsession.ACLSessionHome
com.wdp.workflow.sessions.aclsession.ACLSession
<ejb-class>com.wdp.workflow.sessions.aclsession.ACLSessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/sessionEntity</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.wdp.workflow.entities.sessionentity.SessionEntityHome</local-home>
com.wdp.workflow.entities.sessionentity.SessionEntity
<ejb-link>ejb/sessionEntity</ejb-link>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>ejb/userEntity</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.wdp.workflow.entities.userentity.UserEntityHome</local-home>
com.wdp.workflow.entities.userentity.UserEntity
<ejb-link>ejb/userEntity</ejb-link>
</ejb-local-ref>
<resource-ref>
<res-ref-name>jdbc/Workflow</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049423#4049423
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049423
18 years, 10 months
[JBossWS] - Looking for explanation of wsdl mapping problem
by teknokrat
I am using the latest jbossWS to try and generate a JAX-WS client from a wsdl file, which I belive was generated via .NET. The problem is that the jboss wsconsume chokes wherever there exists a <s:element ref="s:schema" /> element with a org.xml.sax.SAXParseException: undefined element declaration 's:schema'. And this wsdl has a lot of them, all like this:
| <s:complexType>
| <s:sequence>
| <s:element ref="s:schema" />
| <s:any />
| </s:sequence>
| </s:complexType>
| </s:element>
| </s:sequence>
| </s:complexType>
|
s is the following namespace xmlns:s="http://www.w3.org/2001/XMLSchema".
If I remove the offending element, jbossws generates all the java classes just fine. Since I don't control the wsdl I can't go around editing it.
Can someone please explain to me what is the problem here? I can generate classes for this wsdl just fine using Axis, so is the problem with jbossws? Is this a valid wsdl element? Is there something I can do to make this problem go away?
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049421#4049421
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049421
18 years, 10 months