[JBoss JIRA] Created: (EJBTHREE-1500) Discrepancies between removing a bean in cache vs bean passivated
by Galder Zamarreno (JIRA)
Discrepancies between removing a bean in cache vs bean passivated
-----------------------------------------------------------------
Key: EJBTHREE-1500
URL: https://jira.jboss.org/jira/browse/EJBTHREE-1500
Project: EJB 3.0
Issue Type: Sub-task
Affects Versions: AS 4.2.3.GA, AS 5.0.0.CR1
Reporter: Galder Zamarreno
Assignee: Galder Zamarreno
There's a discrepancy between removing a bean from the cache
after a timeout when bean is in cache compared to when bean is
passivated:
Example, when bean is in cache and has to be removed, this is called:
if (now - centry.lastUsed >= removalTimeout * 1000)
{
synchronized (centry)
{
it.remove();
}
}
Now, when bean is passivated, this is called:
if (now - centry.lastUsed >= removalTimeout * 1000)
{
get(centry.getId(), false);
remove(centry.getId());
}
And remove() method calls:
if(log.isTraceEnabled())
{
log.trace("Removing context " + key);
}
StatefulBeanContext ctx = null;
synchronized (cacheMap)
{
ctx = (StatefulBeanContext) cacheMap.get(key);
}
if(ctx == null)
throw new NoSuchEJBException("Could not find Stateful bean: " + key);
if (!ctx.isRemoved())
container.destroy(ctx);
++removeCount;
if (ctx.getCanRemoveFromCache())
{
synchronized (cacheMap)
{
cacheMap.remove(key);
}
}
What this means is that when a bean in cache is removed:
1.- removeCount is not updated
2.- container.destroy(ctx); is not executed and hence the @Remove
method is not executed either.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] Created: (JBWEB-72) html page and jsp are not display with in a Context defined in server.xml.
by Jean-Frederic Clere (JIRA)
html page and jsp are not display with in a Context defined in server.xml.
--------------------------------------------------------------------------
Key: JBWEB-72
URL: http://jira.jboss.com/jira/browse/JBWEB-72
Project: JBoss Web
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Core
Affects Versions: JBoss Web Server 1.0.1 GA
Environment: any
Reporter: Jean-Frederic Clere
Assigned To: Jean-Frederic Clere
Priority: Minor
When using a Context definition in server.xml like:
<Context path="/test" docBase="/home/jfclere/TMP/MYAPP" />
The jsp and html pages of /home/jfclere/TMP/MYAPP are not displayed (404 is returned).
That is because the conf/web.xml is not used to set the defaults when the <Context/> is processed.
DefaultWebXml is set in TomcatDeployer and that is after the <Context/> needs it. The default value is used but it is set to "web.xml".
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] Created: (JBRULES-1917) JBRMS does not support business rules with non ascii characters
by Gregory Chazalon (JIRA)
JBRMS does not support business rules with non ascii characters
---------------------------------------------------------------
Key: JBRULES-1917
URL: https://jira.jboss.org/jira/browse/JBRULES-1917
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.7
Reporter: Gregory Chazalon
Assignee: Mark Proctor
A very simple rule containing some Latin1 characters (e.g. 'é', 'à'..), is not compiled correctly when using the JBRMS web app.
The exact same rule defined in a DRL file, and compiled with the drools compiler API is well handled (no characters mismatch).
Actually, the rule defined both ways is :
{code}
rule "latin_message"
when
Let information message
then
information message containing latin characters léger problème à résoudre hôpital
end
{/code}
I strongly suspect a poor character encoding scheme inside the JBRMS code, but I haven't been able to identify it.
The problem is illustrated by the LatinMessageTest test case, bundled inside the small eclipse project provided.
It has two test methods, one building the rule using the drools compiler API, and the other using a binary package built with JBRMS.
The second one fails as of the poor character encoding suspected inside JBRMS web app.
Any help is appreciated.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] Created: (JBRULES-1602) The order of RHS statements shouldn't affect behavior (insertLogical)
by Patrick Gras (JIRA)
The order of RHS statements shouldn't affect behavior (insertLogical)
---------------------------------------------------------------------
Key: JBRULES-1602
URL: http://jira.jboss.com/jira/browse/JBRULES-1602
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Environment: Drools 4.0.7 & 4.0.4, Java5, eclipse compiler, windows XP.
Reporter: Patrick Gras
Assigned To: Mark Proctor
I have a class 'Cat' that is dynamic (JavaBean with PropertyChangeSupport ) with only a 'name' attribute.
Then I have the following rule:
rule "test"
when
$cat:Cat( name == "tom" )
then
$cat.setName("cat");
insertLogical(new String("test"));
end
When I test the rule against a Cat named tom, the logical inserted fact is not retracted. (So the fact is inserted because the rule matches, but is not retracted even if the rule is no more matching at the end.)
If I change the order of the RHS, it works fine. The fact is inserted and then retracted.
rule "test"
when
$cat:Cat( name == "tom" )
then
insertLogical(new String("test"));
$cat.setName("cat");
end
So the behavior depends on the ordering of the RHS statements.
Here is a complete example to show the problem:
public class Cat {
private String name;
protected PropertyChangeSupport changes = new PropertyChangeSupport(this);
public Cat(String name) {
super();
this.name = name;
}
public String getName() {
return this.name;
}
public void setName(String name) {
final String oldName = this.name;
this.name = name;
this.changes.firePropertyChange("name", oldName, name);
}
public void addPropertyChangeListener(final PropertyChangeListener listener) {
this.changes.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(
final PropertyChangeListener listener) {
this.changes.removePropertyChangeListener(listener);
}
}
public class RHSOrderingTest {
private static final String PACKAGE = "package ch.generali.pgr.rule ";
private static final String IMPORT = "import ch.generali.pgr.rules.Cat ";
private static final String WHEN = "rule \"test ok\" when $cat:Cat( name == \"tom\" ) ";
private static final String THEN_OK = "then insertLogical(Integer.valueOf(1)); $cat.setName(\"cat\"); end";
private static final String THEN_KO = "then $cat.setName(\"cat\"); insertLogical(Integer.valueOf(1)); end";
private static final String RULE_OK = PACKAGE + IMPORT + WHEN + THEN_OK;
private static final String RULE_KO = PACKAGE + IMPORT + WHEN + THEN_KO;
private static final String QUERY = "query \"My test Integer\" integer : Integer( intValue == 1 ) end";
public static void main(String[] args) {
boolean ok_1 = testWithRule(RULE_OK);
boolean ok_2 = testWithRule(RULE_KO);
System.out.println((ok_1 ? "SUCCESS: " : "FAILED: ") + THEN_OK);
System.out.println((ok_2 ? "SUCCESS: " : "FAILED: ") + THEN_KO);
}
private static boolean testWithRule(String rule) {
Cat tom = new Cat("tom");
RuleBase rb = createRuleBase(rule + "\n" + QUERY);
WorkingMemory wm = rb.newStatefulSession();
wm.insert(tom, true);
wm.fireAllRules();
QueryResults results = wm.getQueryResults("My test Integer");
return results.size() == 0;
}
private static RuleBase createRuleBase(String rules) {
try {
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
PackageBuilder packageBuilder = new PackageBuilder(conf);
Reader source = new StringReader(rules);
packageBuilder.addPackageFromDrl(source);
Package pkg = packageBuilder.getPackage();
ruleBase.addPackage(pkg);
return ruleBase;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] Created: (JBRULES-1665) put offending rule name in exception messages
by Alex McCarrier (JIRA)
put offending rule name in exception messages
---------------------------------------------
Key: JBRULES-1665
URL: http://jira.jboss.com/jira/browse/JBRULES-1665
Project: JBoss Drools
Issue Type: Feature Request
Components: Drl Parser/Builder
Affects Versions: FUTURE
Environment: all
Reporter: Alex McCarrier
Assigned To: Mark Proctor
Priority: Minor
It would be nice if drools compiler error messages would include the rule that caused the error. For instance, predicate eval errors, or "unable to resolve property" errors would state which rule was being evaluated when it encountered an error. Currently the developer has to go through the rules file looking for lines similar to the one reported in the error. Also, when it's this much work for a developer to find the offending rule, it is pretty much impossible for business users to figure out which rule they messed up.
If it's at all possible to add the rule name to these error messages, please do so. It would make our lives a lot easier. :)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] Created: (JBRULES-680) Support real-time problem modification during solving with utils for the single thread subsystem
by Geoffrey De Smet (JIRA)
Support real-time problem modification during solving with utils for the single thread subsystem
------------------------------------------------------------------------------------------------
Key: JBRULES-680
URL: http://jira.jboss.com/jira/browse/JBRULES-680
Project: JBoss Rules
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Solver
Reporter: Geoffrey De Smet
Assigned To: Geoffrey De Smet
Rete/Drools is single threaded, and so is the current implementation of the localsearchsolver,
but this single thread subsystem should be documented
and utils should be provided to allow for real-time problem modification
A simple way would be to use a producer-consumer pattern with a non blocking queue which holds "problem moves".
Each step the problem moves could be used.
Problems:
- bestsolutionrecalled also needs it's score adjusted. so we'll need a 2th working memory:
-- EITHER temporary, just for the problem move (or set of problem moves)
-- EITHER all the time, but then we'd have to hold a chain of moves, some of which might not be doable at the end
- cached selectors must be notified of refreshing their cache
- solution cloning normally doesn't clone the problem facts, just the proposed solution references. Do we need a full clone now?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[JBoss JIRA] Created: (JBRULES-2244) MVEL raising errors for declared types when there is a package import (import x.y.x.*)
by Edson Tirelli (JIRA)
MVEL raising errors for declared types when there is a package import (import x.y.x.*)
--------------------------------------------------------------------------------------
Key: JBRULES-2244
URL: https://jira.jboss.org/jira/browse/JBRULES-2244
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler, drools-core
Affects Versions: 5.0.1.FINAL, 5.0.0.FINAL
Reporter: Edson Tirelli
Assignee: Edson Tirelli
Fix For: 5.1.0.M1
The following DRL:
===================================================
package org.drools.examples.broker
import org.drools.examples.broker.model.*;
declare Statistics
symbol : String @key()
average : double
end
rule "Setup statistics"
when
$c : Company( $s : symbol )
not( Statistics( symbol == $s ) )
then
Statistics s = new Statistics();
s.symbol = $s;
insert( s );
end
===================================================
Generates the error:
-----------------------------
BuildError: Unable to build expression for 'consequence': Failed to compile: 1 compilation error(s):
- (1,10) unqualified type in strict mode for: Statistics ' Statistics s = new Statistics();
s.symbol = $s;
insert( s );
' broker.drl drools-examples-fusion/src/main/rules line 42 Drools Error
-----------------------------
But if we change the import to:
===================================================
import org.drools.examples.broker.model.Company
import org.drools.examples.broker.model.StockTick
import org.drools.examples.broker.model.SuddenDropEvent
===================================================
Everything works just fine.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months