[JBoss JIRA] Created: (WELD-317) SFSB initialization fails to detect injectable initializer methods of super class
by Vivek Pandey (JIRA)
SFSB initialization fails to detect injectable initializer methods of super class
----------------------------------------------------------------------------------
Key: WELD-317
URL: https://jira.jboss.org/jira/browse/WELD-317
Project: Weld
Issue Type: Bug
Components: Bootstrap and Metamodel API
Affects Versions: 1.0.0.GA
Environment: glassfish v3, jdk6 u15, weld tck 1.0.1
Reporter: Vivek Pandey
This is regarding org.jboss.jsr299.tck.tests.lookup.injection.enterprise.SessionBeanInjectionOrderingTest. It tests order in which a SFSB's postConstruct and its superclass's initializers are called. Basically the super class's initializer should be called first before the subclass's postConstruct. However there seems to be a bug in Weld, as it skips the superclass initializer for this SFSB.
@Stateful
public class MegaPoorHenHouse extends PoorHenHouse implements MegaPoorHenHouseLocal
{
//There is no initializer() method in it, but Weld adds one during bean deploy
@PostConstruct
public void postConstruct() {
//
}
}
class PoorHenHouse extends HenHouse
{
@Inject
public void initialize() {
//
}
}
Weld does not invoke PoorHenHouse.initialize(). There seems to be a bug there. I think Beans.getInitializerMethods() should start looking for injectable initialize() method starting from the superclass at the end of the chain.
Looking in to the debugger it seems that during Bean deploy Weld is adding initialize() method to MegaPoorHenHouse. Inside Beans.getInitializerMethods(), when the MegaPoorHenHouse is processed to find initializer methods it finds the initializer method and adds it to seenMethod list. Since on the MegaPoorHenHouse the intializer() method dynamically added by Weld is not an injection point so its not added to the list of initializedMethods. Latter when the super class PoorHenHouse is processed to find injectable initialize() method isOverridden() returns true, as initialize() method was added to seenMethod list while processing the subclass, and the legitimate intialize() method on the this super class is skipped.
===>if (!isOverridden(method, seenMethods))
{
MethodInjectionPoint<?, ?> initializerMethod = MethodInjectionPoint.of(declaringBean, method);
initializerMethods.add(initializerMethod);
}
--
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
14 years, 3 months
[JBoss JIRA] Created: (CDITCK-78) Weld does not scan packaged jar in EAR file for Extension or the packaging is wrong
by Vivek Pandey (JIRA)
Weld does not scan packaged jar in EAR file for Extension or the packaging is wrong
-----------------------------------------------------------------------------------
Key: CDITCK-78
URL: https://jira.jboss.org/jira/browse/CDITCK-78
Project: CDI TCK
Issue Type: CTS Challenge
Security Level: Public (Everyone can see)
Affects Versions: 1.0.1.CR1
Reporter: Vivek Pandey
Either its a bug in Weld or its packaging issue of org.jboss.jsr299.tck.tests.extensions.container.event.ContainerEventTest.ear appears to be incorrect.
Here is the content of this ear file of a jsr299 tck test:
org.jboss.jsr299.tck.tests.extensions.container.event.ContainerEventTest.ear
-META-INF/services/javax.enterprise.inject.spi.Extension ==> with entries for Observer classes
- org.jboss.jsr299.tck.tests.extensions.container.event.ContainerEventTest.jar
- ...
The META-INF/services//javax.enterprise.inject.spi.Extension entries are defined as:
org.jboss.jsr299.tck.tests.extensions.container.event.ProcessBeanObserver
org.jboss.jsr299.tck.tests.extensions.container.event.ProcessInjectionTargetObserver
org.jboss.jsr299.tck.tests.extensions.container.event.ProcessAnnotatedTypeObserver
Weld does not scan org.jboss.jsr299.tck.tests.extensions.container.event.ContainerEventTest.jar for presence of Extension in the included jar file. If this behavior is not what jsr299 spec desires then a tleast the packaging should be such that the META-INF/services Extension classes are moved inside the jar file. JSR 299 is not clear on this but It seems that it should be expected to scan all the jars files included in the EAR file for presence of Extension.
--
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
14 years, 3 months
[JBoss JIRA] Created: (CDITCK-57) Issues in testGetStereotypesCalled and testIsNullableCalled
by Vive Pandey (JIRA)
Issues in testGetStereotypesCalled and testIsNullableCalled
-----------------------------------------------------------
Key: CDITCK-57
URL: https://jira.jboss.org/jira/browse/CDITCK-57
Project: CDI TCK
Issue Type: CTS Challenge
Security Level: Public (Everyone can see)
Components: Tests
Affects Versions: 1.0.1.CR1
Reporter: Vive Pandey
The following tests in CDI TCK 1.0.1 RC1 are failing on GlassFish v3. the tests seem to be invalid. See below:
*.definition.bean.custom.CustomBeanImplementationTest.testGetStereotypesCalled
*.definition.bean.custom.CustomBeanImplementationTest.testIsNullableCalled
the first one testGetStereotypesCalled is supposed to be set during called to Bean.getStereotypes(), and its never called. Same applies for testIsNullableCalled, which is supposed to return true when Bean.isNullable() is called, but is never called.
jsr 299 spec in 5.1.1 lays out this requirement for custom beans:
For a custom implementation of the Bean interface defined in Section 11.1, "The Bean interface", the container calls isAlternative() to determine whether the bean is an alternative, and getBeanClass() and getStereotypes() to determ- ine whether an alternative is selected in a certain bean archive.
In this test case, isAlternative() returns false, and correctly so because the associated beans.xml does not define any alternative beans or there is no @Alternative in the bean. This is defined in sec 5.1.1 and 11.1.
According to Bean.isNullable() returns true only if the Bean.create(), here CatBean.create() sometimes return null. In this case it never
public Cat create(CreationalContext<Cat> creationalContext){
return new Cat("kitty");
}
So in my investigation both these assertions testGetStereotypesCalled() and testIsNullableCalled() are invalid.
--
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
14 years, 3 months
[JBoss JIRA] Created: (CDITCK-70) Issue with org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ContainerEventTest
by Jitendra Kotamraju (JIRA)
Issue with org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ContainerEventTest
----------------------------------------------------------------------------------------
Key: CDITCK-70
URL: https://jira.jboss.org/jira/browse/CDITCK-70
Project: CDI TCK
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 1.0.0.GA
Environment: JDK 6 u15, GlassFish v3 b72, CDI TCK 1.0.1 RC1
Reporter: Jitendra Kotamraju
Fix For: 1.0.1.CR1
org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.TestFilter
--------------------------------------------------------------------------------------------------------------------
public class TestFilter implements Filter
{
@Inject
private Sheep sheep;
private boolean injectionPerformedCorrectly = false;
private boolean initializerCalled = false;
private boolean initCalledAfterInitializer = false;
@Inject
public void initialize(Sheep sheep) {}
public void destroy(){}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException{}
public void init(FilterConfig filterConfig) throws ServletException{}
}
AnnotatedType
-------------------------
AnnotatedType extends Annotated {
/**
* Get the business methods belonging to the class.
*
* @return the methods, or an empty set if none are defined
*/
public Set<AnnotatedMethod<? super X>> getMethods();
/**
* Get the fields belonging to the class
*
* @return the fields, or an empty set if none are defined
*/
public Set<AnnotatedField<? super X>> getFields();
}
ContainerEventTest.java
-----------------------------------------
private void validateFilterAnnotatedType(AnnotatedType<TestFilter> type) {
assert type.getFields().size() == 2;
assert type.getMethods().size() == 3;
}
* The javadoc is not clear what getMethods() and getFields() supposed to return. Do they supposed to return all methods and fields or only with @Inject annotation ? Either way, the number of fields should be 4 or 1. So the assertion doesn't seem correct to me.
Other testcases affected are:
testProcessAnnotatedTypeEventFiredForFilter
testProcessAnnotatedTypeEventFiredForJsfManagedBean
testProcessAnnotatedTypeEventFiredForServletListener
testProcessAnnotatedTypeEventFiredForTagLibraryListener
--
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
14 years, 3 months
[JBoss JIRA] Created: (CDITCK-75) @RunAs role in org.jboss.jsr299.tck.tests.event.observer.transactional.TransactionalObserversTest
by Hong Zhang (JIRA)
@RunAs role in org.jboss.jsr299.tck.tests.event.observer.transactional.TransactionalObserversTest
-------------------------------------------------------------------------------------------------
Key: CDITCK-75
URL: https://jira.jboss.org/jira/browse/CDITCK-75
Project: CDI TCK
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 1.0.0.GA
Environment: X86/Ubuntu
Reporter: Hong Zhang
org.jboss.jsr299.tck.tests.event.observer.transactional.TransactionalObserversTest failed to deploy on glassfish server due to no security role mapping for @RunAs roles defined in EJB classes. By creating a default mapping in glassfish through sun-ejb-jar.xml, the test was able to deploy/run. But we were wondering about the intention of the @RunAs role as the tests do not seem to actually use the security constraints.
And when this test ran in JBoss environment, how is the security role mapping done for these @RunAs roles?
--
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
14 years, 3 months
[JBoss JIRA] Created: (CDITCK-76) Incorrect <servlet-name> in org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.InjectionIntoWebServiceEndPointTest.war
by Jitendra Kotamraju (JIRA)
Incorrect <servlet-name> in org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.InjectionIntoWebServiceEndPointTest.war
----------------------------------------------------------------------------------------------------------------------------------
Key: CDITCK-76
URL: https://jira.jboss.org/jira/browse/CDITCK-76
Project: CDI TCK
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 1.0.0.GA
Environment: GlassFish V3
Reporter: Jitendra Kotamraju
For org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.InjectionIntoWebServiceEndPointTest.war, web.xml and WebService class are listed below:
<servlet>
<servlet-name>TestWebService</servlet-name>
<servlet-class>org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.SheepWSEndPoint</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
@WebService(name="SheepWS")
public class SheepWSEndPoint {
}
There is no webservices.xml packaged in the war file and web.xml doesn't have metadata-complete attribute. From the 109 spec's point of view, annotation processing kicks in, and it will create a virtual <webservice-description> in a webservices.xml for every found @WebService in the war. For example:
<webservice-description>
...
<servlet-link>org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.SheepWSEndPoint</servlet-link>
</webservice-description>
<servlet-link> is used to find an entry in web.xml. If it doesn't find any entry, spec says to use defaults to create <servlet> entry and url-pattern mapping. Copied the spec sections at the end of this report. For example, an impl looks for the following entry in web.xml:
<servlet>
<servlet-name>org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.SheepWSEndPoint</servlet-name>
...
</servlet>
299 tck test case has a problem with the <servlet-name>. It has "TestWebService" instead of org.jboss.jsr299.tck.tests.lookup.injection.non.contextual.ws.SheepWSEndPoint
--------
[5.3.2.1] and [5.3.2.2] sections of JSR 109
For Servlet based endpoints using this annotation, fully qualified name of the Service Implementation Bean class
must be used as the <servlet-link> element in the deployment descriptor to map the Port component to the actual
Servlet.
Following default mapping rules apply for Web modules that contain Servlet based endpoints that use this
annotation but do not package a web.xml or a partial web.xml:
• fully qualified name of the Service Implementation Bean class maps to <servlet-name> element in web.xml.
• fully qualified name of the Service Implementation Bean class maps to <servlet-class> element in web.xml
(also specified in section 7.1.2)
• serviceName attribute of javax.jws.WebService annotation prefixed with "/" maps to <url-pattern> element
in web.xml. If the serviceName attribute in javax.jws.WebService annotation is not specified, then
the default value as specified in JSR-181 specification is used.
--
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
14 years, 3 months