[JBossCache] - Exception setting an eviction policy
by patinete
Hello
I am trying to set an eviction policy to a Region that already has one. My problem comes up when the eviction policy's type that I want to configure differs from the old one, throwing a ClassCastException. In my case, the new eviction policy is FIFO and the old one is LRU.
What I am doing...
| RegionManager regionMgr = cache.getEvictionRegionManager();
| Region region = regionMgr.getRegion(strRegion);
| region.setEvictionConfiguration(config);
|
The exception I got:
16:16:20,557 ERROR [STDERR] Exception in thread "Timer-14"
16:16:20,557 ERROR [STDERR] java.lang.ClassCastException: org.jboss.cache.eviction.FIFOConfiguration
16:16:20,557 ERROR [STDERR] at org.jboss.cache.eviction.LRUAlgorithm.shouldEvictNode(LRUAlgorithm.java:38)
16:16:20,557 ERROR [STDERR] at org.jboss.cache.eviction.LRUAlgorithm.prune(LRUAlgorithm.java:117)
16:16:20,557 ERROR [STDERR] at org.jboss.cache.eviction.BaseEvictionAlgorithm.process(BaseEvictionAlgorithm.java:98)
16:16:20,557 ERROR [STDERR] at org.jboss.cache.eviction.EvictionTimerTask.run(EvictionTimerTask.java:80)
16:16:20,557 ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
16:16:20,557 ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
I hope someone could help me, I dont know if I miss something.
Thank you guys
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055666#4055666
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055666
18Â years, 10Â months
[JBoss Seam] - Extending ThemeSelector
by KnisterPeter
I've extended the theme selector based on this description: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=103571
I need an entity manager inside it and therefore added an @In annotation to my manager property, but when the (overriden) select method is called the entity manager is null.
Anyone has an idea why this is the case? All my other beans and enterprise beans do work as expected and get the entity manager injected.
Below is the relevant part of my code:
@Name("org.jboss.seam.theme.themeSelector")
| @Scope(ScopeType.SESSION)
| @Intercept(InterceptionType.NEVER)
| @Install(precedence = Install.APPLICATION)
| public class CampaignTheme extends ThemeSelector {
|
| @In
| private EntityManager em;
|
| /**
| * @see org.jboss.seam.theme.ThemeSelector#select()
| */
| @Override
| public void select() {
| String theme;
| try {
| theme = (String) this.em.createQuery("...")
| .getSingleResult();
| } catch (NoResultException e) {
| theme = DEFAULT_THEME;
| }
| setTheme(theme);
| }
| ...
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055664#4055664
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055664
18Â years, 10Â months
[JCA/JBoss] - Re: Why is jboss closing my connection?
by adrianï¼ jboss.org
The point I'm making is that you wouldn't do it that way (demarcate logon/logoff).
A user can logon and not do anything. You are wasting resources.
Instead you would allocate a connection for a unit of work (e.g. upload/download some files).
For each unit of work, you would "reauthenticate" based on the CRI or Subject.
That way you get maximum sharing of connections and you don't have
unused connections lying around when they are not being used.
The number of open connections is directly related to the number of active units of work,
not the number of SFSBs a lot of which could be idle.
This would be most efficient if the backend supports something like session suspension
as some telnet servers do.
Related to that is (if you are writing the back end yourself), you would be better using the
XAResource interface and storing the session against the XID on the backend server.
That way you can use "interleaving" where you start the session on one connection
suspend it (close() - returning the connection to the pool for somebody else to use)
and resume it on a different physical connection (or the same connection)
when you need it again.
e.g. psuedo code
| ConnectionFactory cf = ...
| Connection c = cf.getConnection(); // Allocate connection from pool - start the session - XAResource.start(xid, TMNOFLAGS);
| Object data;
| try
| {
| data = c.download();
| }
| finally
| {
| // Return the connection to the pool - suspend the session - XAResource.suspend(xid);
| c.close();
| }
|
| // Do some long running process, we don't need to have the connection for this
| // so let somebody else use it!
| Object result = calc(data);
|
| Connection c = cf.getConnection(); // Reget a connection - resume the session - XAResource.start(xid, TM_RESUME);
| try
| {
| c.upload(result);
| }
| finally
| {
| c.close();
| }
|
Finally, you also have greater ability to reap connections that are idle during low load periods.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055663#4055663
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055663
18Â years, 10Â months
[JBoss Seam] - Selecting from a dataTable works randomly
by lkowalczyk
I have a dataTable with a control variable named "report". The dataTable is populated from a collection of EJB3 entities.
Upon clicking one of the links in the table the user is transferred to another view which accepts an @In parameter named report. This view creates another dataTable (in the form of a UIData object) and displays it.
All of this works only once -- all subsequent attempts to click my way through the tables fail miserably with an exception in com.sun.facelets.el.LegacyValueBinding.setValue.
The first dataTable looks like this:
<h:dataTable var="report" value="#{reports}" id="list">
| <h:commandLink rendered="#{report.ready}" action="#{showreport.show}" value="Show report"/>
| </h:dataTable>
|
The #{showreport.show} action does nothing but creating a UIData object marked with an @Out annotation and some data values (a List also marked with an @Out).
The UIData object is then displayed by the following tag:
<h:dataTable binding="#{showreport.dataTable}" value="#{showreport.tableRows}"/>
As I said before, this scheme works perfectly until I return to the first dataTable and click on the "Show report" link again. The second (and any next) time I get this exception:
javax.faces.el.PropertyNotFoundException: /report/showreport.xhtml @22,97 binding="#{showreport.dataTable}": Bean: org.javassist.tmp.java.lang.Object_$$_javassist_187, property: dataTable
at com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:72)
at org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:443)
at org.jboss.seam.jsf.SeamApplication11.createComponent(SeamApplication11.java:78)
at com.sun.facelets.tag.jsf.ComponentHandler.createComponent(ComponentHandler.java:237)
[...]
Creating a setter for the dataTable property does not help much -- the same exception is thrown.
How do I ensure that the results of calling an action are consistent throughout the use of the application?
I'm using Seam 1.2.1.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055659#4055659
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055659
18Â years, 10Â months