[JBoss JIRA] Created: (JBRULES-2522) JPAVariablePersister will not work when @Id is declared on a superclass
by Julien Serdaru (JIRA)
JPAVariablePersister will not work when @Id is declared on a superclass
-----------------------------------------------------------------------
Key: JBRULES-2522
URL: https://jira.jboss.org/browse/JBRULES-2522
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.1.0.M1
Reporter: Julien Serdaru
Assignee: Mark Proctor
Given A and B:
@MappedSuperclass
public class A {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id = null;
}
@Entity
public class B extends A {
// Some other fields
}
In JPAVariablePersister:getClassIdValue, a lookup is done on the entity fields to autodetect the @Id annotation, which fails in this case since the method uses getDeclaredFields() instead of getFields():
private Long getClassIdValue(Object o) throws NoSuchMethodException,
SecurityException, IllegalAccessException,
InvocationTargetException, IllegalArgumentException {
Field[] fields = o.getClass().getDeclaredFields(); <-- THIS ONLY RETURNS THE LOCAL FIELDS, NOT THE SUPERCLASS.
...
return idValue;
}
Replacing getDeclaredFields() by getFields() should fix the problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 2 months
[JBoss JIRA] Created: (JBAS-7936) Add java.net.preferIPv4Stack=true to run.conf(.bat)
by Brian Stansberry (JIRA)
Add java.net.preferIPv4Stack=true to run.conf(.bat)
---------------------------------------------------
Key: JBAS-7936
URL: https://jira.jboss.org/jira/browse/JBAS-7936
Project: JBoss Application Server
Issue Type: Task
Security Level: Public (Everyone can see)
Reporter: Brian Stansberry
Assignee: Brian Stansberry
Fix For: JBossAS-6.0.0.M3
Needed to allow the "all" config to start on a machine (e.g. the Macbooks some of us use) that supports both IPv6 and IPv4. The validation performed by JGroups as part of JGRP-1152 will not let the AS start on such a system, as in the absence of any java.net.preferIPvXStack setting it will determine that IPv6 is preferred and will reject the default IPv4 multicast addresses the AS attempts to use.
Bela's improved on this handling in JGroups HEAD, which will be picked up in the next AS milestone after M3. So for that release this change should be reverted. I'll create a subtask for that.
--
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
16 years, 2 months
[JBoss JIRA] Created: (JBRULES-2527) NullPointerException during rule compilation on entry.getValue().getExtractor().getExtractToClass() instead of clear, understandable compiler error
by Geoffrey De Smet (JIRA)
NullPointerException during rule compilation on entry.getValue().getExtractor().getExtractToClass() instead of clear, understandable compiler error
---------------------------------------------------------------------------------------------------------------------------------------------------
Key: JBRULES-2527
URL: https://jira.jboss.org/browse/JBRULES-2527
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.1.0.M2
Reporter: Geoffrey De Smet
Assignee: Edson Tirelli
Priority: Minor
Fix For: FUTURE
When adding this rule, I got a NullPointerException:
rule "unwantedPatternShiftType2DaysPattern"
when
$pattern : ShiftType2DaysPattern(
$startDayOfWeek : startDayOfWeek,
$dayIndex0shiftType : dayIndex0shiftType,
$dayIndex1shiftType : dayIndex1shiftType
)
PatternContractLine(
pattern == $pattern, $contract : contract
)
Assignment(
eval(null == $dayIndex0shiftType) || (shiftType == $dayIndex0shiftType),
contract == $contract, shiftDateDayOfWeek == $startDayOfWeek,
$employee : employee, $firstDayIndex : shiftDateDayIndex
)
Assignment(
eval(null == $dayIndex1shiftType) || (shiftType == $dayIndex1shiftType),
employee == $employee,
shiftDateDayIndex == ($firstDayIndex + 1)
)
then
insertLogical(new IntConstraintOccurrence("unwantedPattern", ConstraintType.NEGATIVE_SOFT,
$pattern.getWeight(),
$employee, $pattern, $firstDayIndex));
end
It crashes on this line:
declarations.put( entry.getKey(),
entry.getValue().getExtractor().getExtractToClass() );
and in debug it shows that
entry.getValue() is $dayIndex1shiftType
and that
entry.getValue().getExtractor() is null
which makes .getExtractToClass() give the NPE
Exception in thread "main" java.lang.NullPointerException
at org.drools.rule.builder.PatternBuilder.getDeclarationsMap(PatternBuilder.java:666)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:599)
at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:269)
at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:294)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:213)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:108)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:79)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1142)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:628)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:252)
at org.drools.planner.config.localsearch.LocalSearchSolverConfig.buildRuleBase(LocalSearchSolverConfig.java:193)
at org.drools.planner.config.localsearch.LocalSearchSolverConfig.buildSolver(LocalSearchSolverConfig.java:170)
at org.drools.planner.config.XmlSolverConfigurer.buildSolver(XmlSolverConfigurer.java:77)
at org.drools.planner.examples.nurserostering.app.NurseRosteringApp.createSolver(NurseRosteringApp.java:31)
at org.drools.planner.examples.common.app.CommonApp.createSolutionBusiness(CommonApp.java:43)
at org.drools.planner.examples.common.app.CommonApp.<init>(CommonApp.java:22)
at org.drools.planner.examples.nurserostering.app.NurseRosteringApp.<init>(NurseRosteringApp.java:18)
at org.drools.planner.examples.nurserostering.app.NurseRosteringApp.main(NurseRosteringApp.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:110)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 2 months