[JBoss JIRA] Created: (JBSEAM-368) STATELESS component injection rules are not intuitive/undocumented
by Christian Bauer (JIRA)
STATELESS component injection rules are not intuitive/undocumented
------------------------------------------------------------------
Key: JBSEAM-368
URL: http://jira.jboss.com/jira/browse/JBSEAM-368
Project: JBoss Seam
Issue Type: Bug
Reporter: Christian Bauer
Priority: Minor
This is probably a non-issue, so feel free to ignore.
It took me a while to figure out why this works:
@In(create=true)
MyStatelessComponent myComponent;
but this doesn't:
@In
MyStatelessComponent myComponent;
It was easy to figure out that it apparently is required, but from looking at the documentation this isn't clear. I also found it difficult to think about "creation of a component" when it is already there in the stateless EJB pool. I checked the code and there is some consistency in the internal logic, of course.
Users however might read the docs and say: "@In searches all contexts hierarchically, so it should find myComponent in STATELESS, because Seam logged that binding on startup."
Also, attempts to remove the create="true" with
@In(value = "myComponent", scope = ScopeType.STATELESS)
MyStatelessComponent myComponent;
resulted in JNDI lookup("myComponent"), which makes not much sense and returns null.
I suggest we add something to the documentation about lookup/injection of stateless components (I'm not sure if I'm 100% right about this, otherwise I would have added it).
Side note, I found the following additional debug logging lines in Component.java very helpful during development:
private Object getInstanceToInject(In in, String name, Object bean, boolean enforceRequired)
{
Object result;
if ( name.startsWith("#") )
{
log.debug("Searching for injection variable with value binding expression: " + name);
FacesContext facesCtx = FacesContext.getCurrentInstance();
Application application = facesCtx.getApplication();
result = application.createValueBinding(name).getValue(facesCtx);
}
else if (in.scope()==ScopeType.UNSPECIFIED)
{
log.debug("Searching hierarchically for injection variable in all scopes: " + name);
result = getInstance(name, in.create());
}
else
{
if ( in.create() )
{
throw new IllegalArgumentException(
"cannot combine create=true with explicit scope on @In: " +
getAttributeMessage(name)
);
}
log.debug("Searching for injection variable in scope: " + name + ", scope: " + in.scope());
result = in.scope().getContext().get(name);
}
if (result==null && enforceRequired && in.required())
{
throw new RequiredException(
"In attribute requires value for component: " +
getAttributeMessage(name)
);
}
else
{
return result;
}
}
--
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
19 years, 7 months
[JBoss JIRA] Created: (JBSEAM-335) NullPointerException if user quikcly decides to click a different link or button before the page renders
by Keith Naas (JIRA)
NullPointerException if user quikcly decides to click a different link or button before the page renders
--------------------------------------------------------------------------------------------------------
Key: JBSEAM-335
URL: http://jira.jboss.com/jira/browse/JBSEAM-335
Project: JBoss Seam
Issue Type: Bug
Environment: Seam 1.0.1.GA. JBoss 4.0.4, Windows XP, Facelets, MyFaces, Hibernate
Reporter: Keith Naas
When a user is on one of our screens, they can decide to click a link before the next page loads. Sometimes, when this do this quickly enough, it causes a NullPointerException in Manager.touchConversationStack at line 181. Somehow, the currentConversationEntry is null and it breaks when it executes getCurrentConversationEntry().touch().
I tried unsuccessfully to duplicate this scenario on the Hotel and DVD Store demos hosted on JBoss.
Stack Trace
java.lang.NullPointerException
at org.jboss.seam.core.Manager.touchConversationStack(Manager.java:181)
at org.jboss.seam.core.Manager.storeConversation(Manager.java:368)
at org.jboss.seam.jsf.AbstractSeamPhaseListener.storeAnyConversationContext(AbstractSeamPhaseListener.java:69)
at org.jboss.seam.jsf.SeamStateManager.saveSerializedView(SeamStateManager.java:45)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:578)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
.....
--
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
19 years, 7 months
[JBoss JIRA] Created: (JBRULES-506) Exception thrown when retract, reassert and retract again
by Leo Liang (JIRA)
Exception thrown when retract, reassert and retract again
---------------------------------------------------------
Key: JBRULES-506
URL: http://jira.jboss.com/jira/browse/JBRULES-506
Project: JBoss Rules
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 3.0.4, 3.0.1
Reporter: Leo Liang
Assigned To: Mark Proctor
Attachments: Fact.java, test.drl, TestDriver.java
In one rule retract the object and re-assert it, then retract the object again in the following activated rule. A null pointer exception will occur at this time.
java.lang.NullPointerException
at org.drools.reteoo.TerminalNode.retractTuple(TerminalNode.java:216)
at org.drools.reteoo.LeftInputAdapterNode.retractObject(LeftInputAdapterNode.java:207)
at org.drools.reteoo.ObjectSource.propagateRetractObject(ObjectSource.java:141)
at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:180)
at org.drools.reteoo.Rete.retractObject(Rete.java:150)
at org.drools.reteoo.ReteooRuleBase.retractObject(ReteooRuleBase.java:207)
at org.drools.reteoo.ReteooWorkingMemory.doRetract(ReteooWorkingMemory.java:77)
at org.drools.common.AbstractWorkingMemory.retractObject(AbstractWorkingMemory.java:668)
at org.drools.base.DefaultKnowledgeHelper.retractObject(DefaultKnowledgeHelper.java:86)
at com.ericsson.ruletest.debug.Rule_test2_0.consequence(Rule_test2_0.java:8)
at com.ericsson.ruletest.debug.Rule_test2_0ConsequenceInvoker.evaluate(Rule_test2_0ConsequenceInvoker.java:22)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:437)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:407)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:269)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:256)
at com.ericsson.ruletest.TestDriver.main(TestDriver.java:26)
The given test case is the the simplified from my production code.
--------------- test.drl ------------------------
package com.ericsson.ruletest.debug
import com.ericsson.ruletest.Fact;
rule "test1"
salience 10
no-loop true
when
input:Fact();
then
retract(input);
assert(input);
end;
rule "test2"
salience 0
no-loop true
when
input:Fact();
then
retract(input);
end;
--
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
19 years, 7 months
[JBoss JIRA] Created: (JBSEAM-305) More sophisticated handling of request parameters
by Gavin King (JIRA)
More sophisticated handling of request parameters
-------------------------------------------------
Key: JBSEAM-305
URL: http://jira.jboss.com/jira/browse/JBSEAM-305
Project: JBoss Seam
Issue Type: Feature Request
Components: JSF
Reporter: Gavin King
Assigned To: Gavin King
Fix For: 1.1
Currently @RequestParameter does basic type conversion, but it would also be nice to support
(1) custom converters
(2) validation via Hibernate Validator
(3) validation via custom validators
eg.
@RequestParameter(required=true, converter="myConverterId", validator="myValidatorId")
@RequestParameter(converter="#{myComponent.myConverter}", validator="#{myComponent.myValidator}")
@RequestParameter @NotNull
<page view-id="/item.xhtml">
<parameter name="id" required="true">
<converter converterId="myConverterId"/>
<validator binding="#{myComponent.myValidator}"/>
</parameter>
</page>
--
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
19 years, 7 months
[JBoss JIRA] Created: (EJBTHREE-664) Injection using @Resource of SessionContext fails with NullPointerException while deploying the application
by jaikiran pai (JIRA)
Injection using @Resource of SessionContext fails with NullPointerException while deploying the application
-----------------------------------------------------------------------------------------------------------
Key: EJBTHREE-664
URL: http://jira.jboss.com/jira/browse/EJBTHREE-664
Project: EJB 3.0
Issue Type: Bug
Affects Versions: EJB 3.0 RC8 - FD
Environment: JBoss-4.0.4GCA, jboss-EJB-3.0_RC8-FD, Java: jdk1.5.0_07
Reporter: jaikiran pai
Attachments: Exception Stacktrace.txt, MyEJB3.ear, source.zip
I have StatelessSessionBean in which i am trying to inject the SessionContext. When i am trying to deploy the bean, server throws exceptions indicating a NullPointerException and subsequently the application is not deployed.
Here's a small extract from the exception stacktrace(The entire exception stacktrace is attached to this issue):
12:52:11,816 INFO [EARDeployer] Init J2EE application: file:/D:/JBoss4.0.4GCA/jboss-4.0.4.GA/server/default/deploy/MyEJB3.ear/
12:52:12,160 INFO [Ejb3Deployment] EJB3 deployment time took: 188
12:52:12,270 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=MyEJB3.ear,jar=myapp_ejb.jar,name=TestEJB3,service=EJB3 with dependencies:
12:52:12,691 WARN [ServiceController] Problem starting service jboss.j2ee:ear=MyEJB3.ear,jar=myapp_ejb.jar,name=TestEJB3,service=EJB3
java.lang.NullPointerException
at org.jboss.ejb3.injection.ResourceHandler.loadFieldInjectors(ResourceHandler.java:283) at org.jboss.ejb3.injection.ResourceHandler.loadInjectors(ResourceHandler.java:401)
at org.jboss.ejb3.injection.ResourceHandler.loadInjectors(ResourceHandler.java:381)
at org.jboss.ejb3.EJBContainer.resolveInjectors(EJBContainer.java:640)
at org.jboss.ejb3.EJBContainer.initializePool(EJBContainer.java:576)
at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:507)
at org.jboss.ejb3.SessionContainer.start(SessionContainer.java:82)
at org.jboss.ejb3.stateless.StatelessContainer.start(StatelessContainer.java:80)
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:585)
at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:99)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
12:52:13,785 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- MBeans waiting for other MBeans ---
ObjectName: jboss.j2ee:ear=MyEJB3.ear,jar=myapp_ejb.jar,name=TestEJB3,service=EJB3
State: FAILED
Reason: java.lang.NullPointerException
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.j2ee:ear=MyEJB3.ear,jar=myapp_ejb.jar,name=TestEJB3,service=EJB3
State: FAILED
Reason: java.lang.NullPointerException
I am using JBoss - 4.0.4 GCA. I followed the following steps after installing the server:
1) I downloaded jboss-EJB-3.0_RC8-FD
2) Copied ejb3-persistence.jar in server/default/lib
3) Copied ejb3-interceptors-aop.xml in server/default/deploy
4) ejb3.deployer in server/default/deploy
Note that with the injection part commented out, everything works fine, the EJB gets deployed and i am able to invoke methods on the EJB.
I have attached the source code and the .ear file along with this issue for reference. Just place the MyEJB3.ear file in the %JBOSS_HOME%/server/default/deploy directory, after following the steps mentioned above, and start the server to reproduce the issue.
--
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
19 years, 7 months
[JBoss JIRA] Created: (JBAS-3722) on Windows, org.jboss.test.naming.test.SimpleUnitTestCase fail
by Prabhat Jha (JIRA)
on Windows, org.jboss.test.naming.test.SimpleUnitTestCase fail
--------------------------------------------------------------
Key: JBAS-3722
URL: http://jira.jboss.com/jira/browse/JBAS-3722
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Naming
Affects Versions: JBossAS-4.0.5.GA
Environment: Windows 2003 - dev28 in qa lab, Sun jdk1.4.2
Reporter: Prabhat Jha
Assigned To: Scott M Stark
testHaParitionName and testDiscoveryPort of org.jboss.test.naming.test.SimpleUnitTestCase fail with :
javax.naming.CommunicationException: Could not obtain connection to any of these urls: 10.16.56.139:65535 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server 10.16.56.139:65535 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 10.16.56.139:65535 [Root exception is java.net.ConnectException: Connection refused: connect]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at org.jboss.test.naming.test.SimpleUnitTestCase.testDiscoveryPort(SimpleUnitTestCase.java:284)
Caused by: javax.naming.CommunicationException: Failed to connect to server 10.16.56.139:65535 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 10.16.56.139:65535 [Root exception is java.net.ConnectException: Connection refused: connect]]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
... 19 more
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server 10.16.56.139:65535 [Root exception is java.net.ConnectException: Connection refused: connect]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:243)
... 20 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:461)
at java.net.Socket.connect(Socket.java:411)
at java.net.Socket.<init>(Socket.java:310)
at java.net.Socket.<init>(Socket.java:212)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:84)
at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:77)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:239)
--
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
19 years, 7 months