[JBoss JIRA] (SOLDER-315) Seam catch eats all exceptions silently
by Mike Mosiewicz (Created) (JIRA)
Seam catch eats all exceptions silently
---------------------------------------
Key: SOLDER-315
URL: https://issues.jboss.org/browse/SOLDER-315
Project: Solder
Issue Type: Bug
Components: Exception Handling
Affects Versions: 3.1.0.CR1
Environment: ANY
Reporter: Mike Mosiewicz
I observed that seam catch eats all exceptions silently. Specifically it make my development stop for a few hours becouse we didn't know there was model update exception. Here is what I investigated:
1. Every exception in CatchExceptionFilter appear to be handled (ie. catchEvent.isHandled() returned always true)
2. It was becouse it is marked handled in ExceptionHandlerDispatch.executeHandlers switch statement. I.e. here:
...
switch (breadthFirstEvent.getFlow()) {
case HANDLED:
eventException.setHandled(true);
return;
case MARK_HANDLED:
eventException.setHandled(true); <<<<<<<<<<<<<<<<<<
....
3. breadthFirstEvent.getFlow() is MARK_HANDLED becouse it's the default value.
The result is that it's enough there is a matching exception handler to mark the caught exception as handled and stop any exception display. And it's highly probable that you have seam-transaction in your library, so you have org.jboss.seam.transaction.SimpleTransactionExceptionHandler.markTransactionRollback handler active. That handler is intended to mark all the exceptional transactions to roll back. However it is irrelevant for this handler what kind of exception it handles. I wouldn't say that it actually handles exceptions. It just wants to know of all the exception that may cause transaction to be invalid and to rollback the transaction. But it definitely should be no mean to stop further processing of exception and it was probably not intended to hide exceptions.
I think there should be (at least) two kind of handlers. Those that just listen to exceptions and do some actions but they are not supposed to be a final destination for exceptions. These could be transaction related handlers, logging handlers, etc. And there should also be handlers that are able to deal with specific exceptions ultimately.
Right now there is a notion that exception is handled if there is a handler for the exception. If so - SimpleTransactionExceptionHandler should not be a handler.
I think it would be better if MARK_HANDLED was renamed to UNHANDLED and wouldn't cause eventException.setHandled(true). I would then use some annotation to add to those handler that are ultimate and definite, or set handled property programatically. The whole difference between HANDLED and MARK_HANDLED states is artificial. It feels like there should be a difference when some handler says that it really handled the situation or did not.
--
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, 9 months
[JBoss JIRA] (JBSEAM-4854) countQuery not correcly generated when group by is used
by Serkan Eskici (Created) (JIRA)
countQuery not correcly generated when group by is used
-------------------------------------------------------
Key: JBSEAM-4854
URL: https://issues.jboss.org/browse/JBSEAM-4854
Project: Seam 2
Issue Type: Bug
Components: Framework
Affects Versions: 2.3.0.ALPHA
Reporter: Serkan Eskici
When an EntityQuery contains a group-by, then the select statement of the count-query is not correctly generated.
Example query for reproducing the problem:
select min(e.receivedDate), count(*)
from Entity e
where ...
groupby date_trunc('year', e.receivedDate), date_trunc('quarter', e.receivedDate)
The count-query becomes as follows (which generates an exception when run):
select distinct date_trunc('year', l.receivedDate), date_trunc('quarter', e.receivedDate)
from etc.
--
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, 9 months
[JBoss JIRA] Created: (SEAM-89) Call to associateGroups(head, branch) does not persist the group relationship
by Bill Elliot (JIRA)
Call to associateGroups(head, branch) does not persist the group relationship
-----------------------------------------------------------------------------
Key: SEAM-89
URL: https://issues.jboss.org/browse/SEAM-89
Project: Seam 3 Distribution
Issue Type: Bug
Affects Versions: 3.0.0.Final
Environment: Windows 7 x64, MySQL 5.1
Reporter: Bill Elliot
This is using MySQL 5.1 and it appears the association is not being persisted. If I manually enter the table row the association is detected correctly. But, the call to associateGroups is not persisting the relationship. I have used the following code to test out this:
package org.jboss.seam.security.examples.idmconsole.tests;
import javax.inject.Inject;
import org.picketlink.idm.api.Group;
import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.api.PersistenceManager;
import org.picketlink.idm.api.RelationshipManager;
import org.picketlink.idm.common.exception.IdentityException;
public class TestSecurity {
@Inject IdentitySession identitySession;
public String testAction() throws IdentityException {
PersistenceManager pm = identitySession.getPersistenceManager();
RelationshipManager rm = identitySession.getRelationshipManager();
Group head = pm.findGroup("Head Office", "ORGANIZATION_UNIT");
Group branch = pm.findGroup("Branch Office", "ORGANIZATION_UNIT");
if( ! rm.isAssociated(head, branch) ) {
rm.associateGroups(head, branch);
}
boolean isAssociated = rm.isAssociated(head, branch);
return null;
}
}
The 2 groups in the test code exist in my test DB when I run the above code. I single step through the code to verify the situation after each line and everything is as expected, except that the call to rm.associateGroups(head, branch); does not persist the association.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 9 months
[JBoss JIRA] Created: (SEAM-96) identity.hasRole and identity.addRole do not seem to be interacting with JpaStore
by Bill Elliot (JIRA)
identity.hasRole and identity.addRole do not seem to be interacting with JpaStore
---------------------------------------------------------------------------------
Key: SEAM-96
URL: https://issues.jboss.org/browse/SEAM-96
Project: Seam 3 Distribution
Issue Type: Bug
Affects Versions: 3.0.0.Final
Environment: Windows 7, MySQL 5.1, AS6
Reporter: Bill Elliot
I am trying to use Roles with Seam Security. I have added the following to my MySQL DB.
insert into IdentityRoleName(id, name) values (1, 'admin');
insert into IdentityRoleName(id, name) values (2, 'manager');
insert into IdentityObjectType(id, name) values (1, 'USER');
insert into IdentityObjectType(id, name) values (2, 'GROUP');
insert into IdentityObject (id, name, identity_object_type_id) values (1, 'shane', 1);
insert into IdentityObject (id, name, identity_object_type_id) values (2, 'demo', 1);
insert into IdentityObject (id, name, identity_object_type_id) values (3, 'ROOT', 2);
insert into IdentityObject (id, name, identity_object_type_id) values (4, 'USERS', 2);
insert into IdentityObjectCredentialType (id, name) values (1, 'PASSWORD');
insert into IdentityObjectCredential (id, identity_object_id, credential_type_id, value) values (1, 1, 1, 'password');
insert into IdentityObjectCredential (id, identity_object_id, credential_type_id, value) values (2, 2, 1, 'demo');
insert into IdentityObjectRelationshipType (id, name) values (1, 'JBOSS_IDENTITY_MEMBERSHIP');
insert into IdentityObjectRelationshipType (id, name) values (2, 'JBOSS_IDENTITY_ROLE');
insert into IdentityObjectRelationship (id, name, relationship_type_id, from_identity_id, to_identity_id) values (1, 'admin', 2, 3, 2);
insert into IdentityObjectRelationship (id, name, relationship_type_id, from_identity_id, to_identity_id) values (2, 'admin', 2, 4, 2);
And my seam-beans.xml has the following:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:s="urn:java:ee" xmlns:drools="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
xmlns:auth="urn:java:org.jboss.seam.security" xmlns:security="urn:java:org.jboss.seam.security.permission"
xmlns:plidm="urn:java:org.jboss.seam.security.management.picketlink"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
<auth:Identity>
<s:modifies />
<auth:authenticatorName>NGOAuthenticator</auth:authenticatorName>
</auth:Identity>
<security:JpaPermissionStore>
<s:replaces />
<security:identityPermissionClass>com.ngo.domain.IdentityPermission</security:identityPermissionClass>
</security:JpaPermissionStore>
<plidm:JpaIdentityStoreConfiguration>
<s:replaces />
<plidm:identityClass>com.ngo.domain.IdentityObject</plidm:identityClass>
<plidm:credentialClass>com.ngo.domain.IdentityObjectCredential</plidm:credentialClass>
<plidm:relationshipClass>com.ngo.domain.IdentityObjectRelationship</plidm:relationshipClass>
<plidm:roleTypeClass>com.ngo.domain.IdentityRoleName</plidm:roleTypeClass>
<plidm:attributeClass>com.ngo.domain.IdentityObjectAttribute</plidm:attributeClass>
</plidm:JpaIdentityStoreConfiguration>
</beans>
When I try to execute the following "identity.getRoles()" I get no roles and therefore when I execute identity.hasRole( "admin", "ROOT", "GROUP" ) it returns false.
What am I missing?
I have also tried removing the relationship entries and executing identity.addRole( "admin", "ROOT", "GROUP" ) just before the hasRole and it says I now have the Role. But, the values are not added to the DB.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 9 months
[JBoss JIRA] (SEAMWICKET-45) SeamWicketTester does not associate conversation context with request
by Jozef Hartinger (Created) (JIRA)
SeamWicketTester does not associate conversation context with request
---------------------------------------------------------------------
Key: SEAMWICKET-45
URL: https://issues.jboss.org/browse/SEAMWICKET-45
Project: Seam for Apache Wicket
Issue Type: Bug
Affects Versions: 3.1.0.Beta3
Reporter: Jozef Hartinger
Priority: Blocker
Fix For: 3.1.0.CR1
When running org.jboss.seam.wicket.examples.numberguess.test.HomePageTest the conversation context is not associated with the request. In a non-mock environment, the request is associated by WeldListener.
When using SeamWicketTester, only the request context seems to be associated with the request causing the following exception:
Marked as blocker since it probably causes any testing using SeamWicketTester to fail.
{noformat}
java.lang.IllegalStateException: Must call associate() before calling activate()
at org.jboss.weld.context.AbstractConversationContext.activate(AbstractConversationContext.java:277)
at org.jboss.seam.wicket.SeamRequestCycle.onRequestTargetSet(SeamRequestCycle.java:68)
at org.apache.wicket.RequestCycle$1.add(RequestCycle.java:260)
at org.apache.wicket.RequestCycle$1.add(RequestCycle.java:276)
at org.apache.wicket.util.collections.ArrayListStack.push(ArrayListStack.java:73)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:587)
at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:501)
at org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:413)
at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:302)
at org.jboss.seam.wicket.examples.numberguess.test.HomePageTest.testRestart(HomePageTest.java:71)
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:246)
at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)
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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38)
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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:82)
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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:68)
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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:54)
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 org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)
at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:239)
at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:202)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)
at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:216)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:161)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:175)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:123)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)
at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:128)
at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:107)
at org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:203)
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.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at org.jboss.as.jmx.tcl.TcclMBeanServer.invoke(TcclMBeanServer.java:214)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor638.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
{noformat}
--
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, 9 months