[JBoss JIRA] (AS7-3162) RESTEasy: Unknown servet name javax.ws.rs.core.Application when javax.ws.rs.core.Application subclass is on classpath
by Weinan Li (Commented) (JIRA)
[ https://issues.jboss.org/browse/AS7-3162?page=com.atlassian.jira.plugin.s... ]
Weinan Li commented on AS7-3162:
--------------------------------
You have mixed up the concept of javax.ws.rs.core.Application and the servlet in servlet-mapping.
The servlet-name in servlet-mapping is an instance of HttpServlet30Dispatcher or HttpServletDispatcher not a class that extends Application.
So I hate the servlet name used in as7 container. It creates confusions :-)
Let me repeat the concept more concisely here:
1. Use @ApplicationPath in your class that extends Application
2. Use servlet-mapping with servlet name "javax.ws.rs.core.Application"(which is actually an HttpServlet30Dispatcher servlet that AS7 has created for you.)
3. Use the traditional method to configure your application(listeners, context params, servlet, mappings). I've given you an example on this: https://github.com/liweinan/try-resteasy
> RESTEasy: Unknown servet name javax.ws.rs.core.Application when javax.ws.rs.core.Application subclass is on classpath
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: AS7-3162
> URL: https://issues.jboss.org/browse/AS7-3162
> Project: Application Server 7
> Issue Type: Bug
> Components: REST
> Affects Versions: 7.1.0.CR1b
> Reporter: Pavel Janousek
> Assignee: Weinan Li
> Priority: Blocker
>
> I've deployment like this:
> {code}
> @Deployment
> public static Archive<?> deploy() {
> WebArchive war = ShrinkWrap.create(WebArchive.class, "jaxrsnoap.war");
> war.addPackage(HttpRequest.class.getPackage());
> war.addClasses(ApplicationTestCase.class, ApplicationInvalid1.class);
> war.addAsWebInfResource(
> WebXml.get("<servlet-mapping>\n"
> + " <servlet-name>javax.ws.rs.core.Application</servlet-name>\n"
> + " <url-pattern>/myjaxrs/*</url-pattern>\n"
> + "</servlet-mapping>\n" + "\n"), "web.xml");
> return war;
> }
> {code}
> This deployment fails during deploying because of "Context [/jaxrsnoap] startup failed due to previous errors: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name javax.ws.rs.core.Application"
> ApplicationInvalid1 is empty subclass of javax.ws.rs.core.Application like:
> {code}
> public class ApplicationInvalid1 extends Application {
> private Set<Class<?>> classes = new HashSet<Class<?>>();
> public ApplicationInvalid1() {
> }
> @Override
> public Set<Class<?>> getClasses() {
> return classes;
> }
> }
> {code}
> There isn't any reference to this class in web.xml or somewhere else. Only class is placed on classpath. If I remove this class from deployment (= change appropriate line to "war.addClasses(ApplicationTestCase.class);", everything will be OK.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] Created: (JBRULES-3161) CEP - event both in and out of time window at the same time
by Radai Rosenblatt (JIRA)
CEP - event both in and out of time window at the same time
-----------------------------------------------------------
Key: JBRULES-3161
URL: https://issues.jboss.org/browse/JBRULES-3161
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.2.0.Final
Environment: jre 6u24, windows 7 x64
Reporter: Radai Rosenblatt
Assignee: Mark Proctor
Priority: Critical
given this object:
public class Event {
private Date started;
private Date finished;
private long duration;
//getters and setters
}
the following drools code:
declare Event
@role( event )
@duration ( duration )
@timestamp( started )
end
rule "Event Exists In Window"
when
$eventOne : Event() over window:time( 1h ) from entry-point "Event Stream"
then
//nothing
end
rule "No Event Exists In Window"
when
not ( Event() over window:time( 1h ) from entry-point "Event Stream" )
then
//nothing
end
and the following scenario:
now-1.5h the event now+1h
|---------------------------------------|
the window
|------------------|
---------------------------------|-------------> T
now
(an event at time T that start at T-1.5h and ends at T+1h)
both of the above rules fire. im not sure which of them _should_ fire for this scenario, but im pretty sure its either one or the other (to my understanding the conditions are logically exclusive - there either exists an event in the window or there doesnt)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] Created: (JBRULES-3130) Regression. Rule misfires due to constraint list[0].field1/2 in two rules
by Wolfgang Laun (JIRA)
Regression. Rule misfires due to constraint list[0].field1/2 in two rules
-------------------------------------------------------------------------
Key: JBRULES-3130
URL: https://issues.jboss.org/browse/JBRULES-3130
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.2.0.Final
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Priority: Critical
Fix For: 5.2.1.Final
A pair of constraints suich as list[0].a == null and list[0].b == null in two different rules causes one of the rules not to fire and the other one to fire erroneously (see results at the end).
Java:
================================================================
public class Three {
private String a;
private String b;
private String c;
public Three( String a, String b, String c ){
this.a = a;
this.b = b;
this.c = c;
}
public String getA(){ return a; }
public String getB(){ return b; }
public String getC(){ return c; }
}
================================================================
import java.util.*;
public class ListOfThree {
private List<Three> list;
private Class<?> clazz;
public ListOfThree( Three three, Class<?> clazz ){
list = new ArrayList<Three>();
list.add( three );
this.clazz = clazz;
}
public List<Three> getList(){ return list; }
public Class<?> getClazz(){ return clazz; }
}
================================================================
// Insertion of facts
Three three = new Three( "a", "b", "c" );
ListOfThree listof3 = new ListOfThree( three, java.lang.Object.class );
kSession.insert( listof3 );
three = new Three( "x", null, "z" );
listof3 = new ListOfThree( three, java.lang.String.class );
kSession.insert( listof3 );
three = new Three( null, "q", "r" );
listof3 = new ListOfThree( three, java.lang.Integer.class );
kSession.insert( listof3 );
===================================================================
rule 'rule1'
############################ dialect "mvel" ## does not matter
when
ListOfThree( list[0].a == null, $c: clazz );
then
System.out.println( "rule1 " + $c.getSimpleName() );
end
rule 'rule2'
############################ dialect "mvel" ## does not matter
when
ListOfThree( list[0].b == null, $c: clazz );
then
System.out.println( "rule2 " + $c.getSimpleName() );
end
=================================================================
Results:
rule2 Integer
rule1 Integer
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] Created: (JBRULES-2975) Cannot use constant from Enum declared in class any more
by Wolfgang Laun (JIRA)
Cannot use constant from Enum declared in class any more
---------------------------------------------------------
Key: JBRULES-2975
URL: https://issues.jboss.org/browse/JBRULES-2975
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Affects Versions: 5.2.0.M2
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Priority: Critical
Note that this was running with a build made around 2011-02-10!
Given the class
public class Triangle {
public enum Type {
INCOMPLETE, UNCLASSIFIED,
EQUILATERAL, ISOSCELES, RECTANGLED, ISOSCELES_RECTANGLED, ACUTE, OBTUSE;
}
private int alpha;
private int beta;
private int gamma;
private Type type;
public Triangle( int alpha, int beta ) {
this.alpha = alpha;
this.beta = beta;
this.type = Type.UNCLASSIFIED;
}
// getters, setter,...
}
and the rule
rule equilateral
when
$t: Triangle( type == Triangle.Type.UNCLASSIFIED,
alpha == beta && == gamma )
then
modify( $t ){ setType( Triangle.Type.EQUILATERAL ) }
end
this fails with
Exception in thread "main" org.drools.RuntimeDroolsException: [Error: object is not an instance of declaring class]
[Near : {... Triangle.Type.UNCLASSIFIED ....}]
^
[Line: 1, Column: 1]
at org.drools.rule.ReturnValueRestriction.isAllowed(ReturnValueRestriction.java:258)
at org.drools.rule.VariableConstraint.isAllowed(VariableConstraint.java:103)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:251)
at rss.drools.setup.Application.insert(Application.java:141)
at ex4.Main.makeFacts(Main.java:35)
at rss.drools.setup.Application.execute(Application.java:83)
at ex4.Main.main(Main.java:40)
Caused by: [Error: object is not an instance of declaring class]
[Near : {... Triangle.Type.UNCLASSIFIED ....}]
^
[Line: 1, Column: 1]
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:427)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:140)
at org.mvel2.ast.ASTNode.optimize(ASTNode.java:158)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:115)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:87)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:125)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:118)
at org.mvel2.MVEL.executeExpression(MVEL.java:954)
at org.drools.base.mvel.MVELReturnValueExpression.evaluate(MVELReturnValueExpression.java:88)
at org.drools.rule.ReturnValueRestriction.isAllowed(ReturnValueRestriction.java:247)
... 15 more
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:514)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:335)
... 24 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] (AS7-3162) RESTEasy: Unknown servet name javax.ws.rs.core.Application when javax.ws.rs.core.Application subclass is on classpath
by Pavel Janousek (Commented) (JIRA)
[ https://issues.jboss.org/browse/AS7-3162?page=com.atlassian.jira.plugin.s... ]
Pavel Janousek commented on AS7-3162:
-------------------------------------
Wait, wait, I've in mind a bit another case(s)...
Stuart refers from 2.3.2 section of JAX-RS 1.1. specs, right...
I think actual implementation in RESTEasy doesn't conform to JAX-RS specs in fully manner., I'll try to cover them after investigation and verifying.
At first: Do you agree that servlet-name *org.jboss.as.test.integration.jaxrs.deployments.ApplicatonEmptyWithoutAOP* should be added by the RESTEasy in this case:
Application impl:{code}package org.jboss.as.test.integration.jaxrs.deployments;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.core.Application;
public class ApplicationEmptyWithoutAOP extends Application {
private Set<Class<?>> classes = new HashSet<Class<?>>();
public ApplicationEmptyWithoutAOP() {
}
@Override
public Set<Class<?>> getClasses() {
return classes;
}
}
{code} and deployment contain only{code:xml}
<?xml version=1.0 encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" metadata-complete="false">
<servlet-mapping>
<servlet-name>org.jboss.as.test.integration.jaxrs.deployments.ApplicatonEmptyWithoutAOP</servlet-name>
<url-pattern>/myjaxrs/*</url-pattern>
</servlet-mapping>
</web-app>
{code} and only packages in WAR this Application, TestCase and SimpleHelloResource... - so no AOP, nor mixing mapping etc.
This deployment fails with "Context [/jaxrsnoap_without_aop] startup failed due to previous errors: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name org.jboss.as.test.integration.jaxrs.deployments.ApplicatonEmptyWithoutAOP" too. I'm writting now only about requirements in 2.3.2 section, nothing else...
Also 2.3.2 section cases 2 and 3 don't avoid to define javax.ws.rs.Application (the same as in the case when Application subclass isn't present) at all when it isn't defined in web.xml yet - I think this request doesn't break the specs too.
What do you think about these cases?
> RESTEasy: Unknown servet name javax.ws.rs.core.Application when javax.ws.rs.core.Application subclass is on classpath
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: AS7-3162
> URL: https://issues.jboss.org/browse/AS7-3162
> Project: Application Server 7
> Issue Type: Bug
> Components: REST
> Affects Versions: 7.1.0.CR1b
> Reporter: Pavel Janousek
> Assignee: Weinan Li
> Priority: Blocker
>
> I've deployment like this:
> {code}
> @Deployment
> public static Archive<?> deploy() {
> WebArchive war = ShrinkWrap.create(WebArchive.class, "jaxrsnoap.war");
> war.addPackage(HttpRequest.class.getPackage());
> war.addClasses(ApplicationTestCase.class, ApplicationInvalid1.class);
> war.addAsWebInfResource(
> WebXml.get("<servlet-mapping>\n"
> + " <servlet-name>javax.ws.rs.core.Application</servlet-name>\n"
> + " <url-pattern>/myjaxrs/*</url-pattern>\n"
> + "</servlet-mapping>\n" + "\n"), "web.xml");
> return war;
> }
> {code}
> This deployment fails during deploying because of "Context [/jaxrsnoap] startup failed due to previous errors: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name javax.ws.rs.core.Application"
> ApplicationInvalid1 is empty subclass of javax.ws.rs.core.Application like:
> {code}
> public class ApplicationInvalid1 extends Application {
> private Set<Class<?>> classes = new HashSet<Class<?>>();
> public ApplicationInvalid1() {
> }
> @Override
> public Set<Class<?>> getClasses() {
> return classes;
> }
> }
> {code}
> There isn't any reference to this class in web.xml or somewhere else. Only class is placed on classpath. If I remove this class from deployment (= change appropriate line to "war.addClasses(ApplicationTestCase.class);", everything will be OK.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] (JBRULES-3327) Weird exception thrown: java.lang.ClassCastException: org.drools.reteoo.InitialFactImpl cannot be cast to XXX...
by Miles Wen (Created) (JIRA)
Weird exception thrown: java.lang.ClassCastException: org.drools.reteoo.InitialFactImpl cannot be cast to XXX...
-----------------------------------------------------------------------------------------------------------------
Key: JBRULES-3327
URL: https://issues.jboss.org/browse/JBRULES-3327
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.3.0.Final
Environment: jdk 1.6u27, ubuntu linux 11.04
Reporter: Miles Wen
Assignee: Mark Proctor
This code throws exception at runtime, with default settings:
rule "out"
when
l1:Msg(str == 'test') and
l2:Msg(!bool) or
eval(!false)
then
end
which throws:
org.drools.RuntimeDroolsException: Unexpected exception executing action org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction@ef894ce
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:977)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:315)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:291)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:845)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at com.sample.DroolsTest.main(DroolsTest.java:51)
Caused by: org.drools.RuntimeDroolsException: com.sample.Rule_outEval0Invoker@3e1b05a2 : java.lang.ClassCastException: org.drools.reteoo.InitialFactImpl cannot be cast to com.sample.Msg
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:119)
at org.drools.reteoo.EvalConditionNode.assertLeftTuple(EvalConditionNode.java:178)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:197)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:146)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:158)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:215)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:244)
at org.drools.reteoo.Rete.assertObject(Rete.java:107)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:284)
at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:404)
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:975)
... 6 more
Caused by: java.lang.ClassCastException: org.drools.reteoo.InitialFactImpl cannot be cast to com.sample.Msg
at com.sample.Rule_outEval0Invoker.evaluate(Unknown Source)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:114)
... 17 more
P.S: 'Msg' is an arbitrary pojo fact defined by user.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] (AS7-3189) Infinispan caches should be accessible via jndi.
by Paul Ferraro (Created) (JIRA)
Infinispan caches should be accessible via jndi.
------------------------------------------------
Key: AS7-3189
URL: https://issues.jboss.org/browse/AS7-3189
Project: Application Server 7
Issue Type: Bug
Components: Clustering
Affects Versions: 7.1.0.CR1b, 7.0.0.CR1
Reporter: Paul Ferraro
Assignee: Paul Ferraro
Priority: Critical
Fix For: 7.1.0.Final
Since cache configurations are no longer defined when the EmbeddedCacheManagerService is started, but after, by a separate CacheConfigurationService, Cache instances need to be accessible via jndi. Otherwise an application that tries to access a cache via an injected CacheContainer (via jndi), can easily encounter a race condition, where the cache has not yet been defined.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months