[JBoss JIRA] (WFLY-2967) Rationalize log-and-throw behavior in CMTTxInterceptor.handleInCallerTx
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-2967?page=com.atlassian.jira.plugin.... ]
Stuart Douglas commented on WFLY-2967:
--------------------------------------
I have removed this behaviour, we already have some rather unfortunate log and re-throw behaviour in the logging interceptor, which basically means that at the moment an exception may be logged twice for every EJB on the call stack (e.g. a servlet that called a chain of 3 EJB's could result in the exception being logged 7 times).
This should never have been there in the first place IMHO.
> Rationalize log-and-throw behavior in CMTTxInterceptor.handleInCallerTx
> -----------------------------------------------------------------------
>
> Key: WFLY-2967
> URL: https://issues.jboss.org/browse/WFLY-2967
> Project: WildFly
> Issue Type: Task
> Components: EJB
> Affects Versions: 8.0.0.Final
> Reporter: Brian Stansberry
> Assignee: Stuart Douglas
>
> CMTTxInterceptor.handleInCallerTx does a log-and-throw:
> {code}
> setRollbackOnly(tx);
> EjbLogger.ROOT_LOGGER.error(t);
> throw (Exception) t;
> {code}
> Generally this is an anti-pattern, although there may be utility in logging some events server-side as an aid in diagnostics or something. IMO if the exception indicates some sort of server fault, as opposed to a client or application state mistake, it needs to be logged server-side. But I'm not sure where the dividing line is.
> It doesn't look like this particular example is nicely playing such a role though.
> 1) It's only called in MANDATORY/REQUIRED/SUPPORTS scenarios where a tx already exists. So, what it logs is logged in some scenarios and not in others.
> 2) It logs stuff that looks pretty clearly like client mistakes, in particular NoSuchEJBException and NoSuchEntityException. I don't believe these add value to the server log, at least not at a level above DEBUG.
>
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (WFLY-3444) EjbTimerXmlPersister should check if timer.getNextExpiration() is null to avoid NPE
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-3444?page=com.atlassian.jira.plugin.... ]
Stuart Douglas reopened WFLY-3444:
----------------------------------
Assignee: Stuart Douglas (was: David Lloyd)
> EjbTimerXmlPersister should check if timer.getNextExpiration() is null to avoid NPE
> -----------------------------------------------------------------------------------
>
> Key: WFLY-3444
> URL: https://issues.jboss.org/browse/WFLY-3444
> Project: WildFly
> Issue Type: Bug
> Components: EJB
> Reporter: Scott Marlow
> Assignee: Stuart Douglas
> Fix For: 9.0.0.Beta1
>
>
> Seeing a NPE in org.jboss.as.ejb3.timerservice.persistence.filestore.EjbTimerXmlPersister. that probably needs a null check:
> {quote}
> Caused by: java.lang.NullPointerException
> at org.jboss.as.ejb3.timerservice.persistence.filestore.EjbTimerXmlPersister.writeCalendarTimer(EjbTimerXmlPersister.java:136)
> at org.jboss.as.ejb3.timerservice.persistence.filestore.EjbTimerXmlPersister.writeContent(EjbTimerXmlPersister.java:89)
> at org.jboss.as.ejb3.timerservice.persistence.filestore.EjbTimerXmlPersister.writeContent(EjbTimerXmlPersister.java:43)
> at org.jboss.staxmapper.XMLMapperImpl.doDeparse(XMLMapperImpl.java:88)
> at org.jboss.staxmapper.XMLMapperImpl.deparseDocument(XMLMapperImpl.java:83)
> at org.jboss.as.ejb3.timerservice.persistence.filestore.FileTimerPersistence.writeFile(FileTimerPersistence.java:440)
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (WFLY-3444) EjbTimerXmlPersister should check if timer.getNextExpiration() is null to avoid NPE
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-3444?page=com.atlassian.jira.plugin.... ]
Stuart Douglas resolved WFLY-3444.
----------------------------------
Resolution: Done
> EjbTimerXmlPersister should check if timer.getNextExpiration() is null to avoid NPE
> -----------------------------------------------------------------------------------
>
> Key: WFLY-3444
> URL: https://issues.jboss.org/browse/WFLY-3444
> Project: WildFly
> Issue Type: Bug
> Components: EJB
> Reporter: Scott Marlow
> Assignee: David Lloyd
> Fix For: 9.0.0.Beta1
>
>
> Seeing a NPE in org.jboss.as.ejb3.timerservice.persistence.filestore.EjbTimerXmlPersister. that probably needs a null check:
> {quote}
> Caused by: java.lang.NullPointerException
> at org.jboss.as.ejb3.timerservice.persistence.filestore.EjbTimerXmlPersister.writeCalendarTimer(EjbTimerXmlPersister.java:136)
> at org.jboss.as.ejb3.timerservice.persistence.filestore.EjbTimerXmlPersister.writeContent(EjbTimerXmlPersister.java:89)
> at org.jboss.as.ejb3.timerservice.persistence.filestore.EjbTimerXmlPersister.writeContent(EjbTimerXmlPersister.java:43)
> at org.jboss.staxmapper.XMLMapperImpl.doDeparse(XMLMapperImpl.java:88)
> at org.jboss.staxmapper.XMLMapperImpl.deparseDocument(XMLMapperImpl.java:83)
> at org.jboss.as.ejb3.timerservice.persistence.filestore.FileTimerPersistence.writeFile(FileTimerPersistence.java:440)
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (WFLY-4097) JAX-RS Returns Wrong Repsonse Code When A Method Is Not Allowed
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-4097?page=com.atlassian.jira.plugin.... ]
Stuart Douglas resolved WFLY-4097.
----------------------------------
Resolution: Rejected
This is not a bug. To return a 403 response code you need to create an ExceptionMapper for the EjbAccessException that can return any response you want.
> JAX-RS Returns Wrong Repsonse Code When A Method Is Not Allowed
> ---------------------------------------------------------------
>
> Key: WFLY-4097
> URL: https://issues.jboss.org/browse/WFLY-4097
> Project: WildFly
> Issue Type: Bug
> Components: EJB, REST, Security
> Affects Versions: 8.1.0.Final
> Environment: Windows 7
> Java 8u25
> WildFly 8.1.0.Final
> Reporter: shinzey shinzey
> Assignee: David Lloyd
> Priority: Critical
>
> My RESTful service is protected with @RolesAllowed:
> {quote}
> @Stateless
> @RolesAllowed("admin")
> @Path("admin")
> {quote}
> When a non-admin user is trying to request this service, it fails with 500 Internal Server Error, instead of 403 Forbidden. From the log we can see that @RolesAllowed is working as expected:
> {quote}
> org.jboss.resteasy.spi.UnhandledException: javax.ejb.EJBAccessException: JBAS014502: Invocation on method: public zhyi.wildweb.AdminService zhyi.wildweb.AdminService.getUsers() of bean: AdminService is not allowed
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (WFLY-2967) Rationalize log-and-throw behavior in CMTTxInterceptor.handleInCallerTx
by Stuart Douglas (JIRA)
[ https://issues.jboss.org/browse/WFLY-2967?page=com.atlassian.jira.plugin.... ]
Stuart Douglas reassigned WFLY-2967:
------------------------------------
Assignee: Stuart Douglas (was: David Lloyd)
> Rationalize log-and-throw behavior in CMTTxInterceptor.handleInCallerTx
> -----------------------------------------------------------------------
>
> Key: WFLY-2967
> URL: https://issues.jboss.org/browse/WFLY-2967
> Project: WildFly
> Issue Type: Task
> Components: EJB
> Affects Versions: 8.0.0.Final
> Reporter: Brian Stansberry
> Assignee: Stuart Douglas
>
> CMTTxInterceptor.handleInCallerTx does a log-and-throw:
> {code}
> setRollbackOnly(tx);
> EjbLogger.ROOT_LOGGER.error(t);
> throw (Exception) t;
> {code}
> Generally this is an anti-pattern, although there may be utility in logging some events server-side as an aid in diagnostics or something. IMO if the exception indicates some sort of server fault, as opposed to a client or application state mistake, it needs to be logged server-side. But I'm not sure where the dividing line is.
> It doesn't look like this particular example is nicely playing such a role though.
> 1) It's only called in MANDATORY/REQUIRED/SUPPORTS scenarios where a tx already exists. So, what it logs is logged in some scenarios and not in others.
> 2) It logs stuff that looks pretty clearly like client mistakes, in particular NoSuchEJBException and NoSuchEntityException. I don't believe these add value to the server log, at least not at a level above DEBUG.
>
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months
[JBoss JIRA] (WFLY-1366) @DataSourceDefinition incorrectly requires other properties than name and class-name
by Tomasz Adamski (JIRA)
[ https://issues.jboss.org/browse/WFLY-1366?page=com.atlassian.jira.plugin.... ]
Tomasz Adamski reopened WFLY-1366:
----------------------------------
> @DataSourceDefinition incorrectly requires other properties than name and class-name
> ------------------------------------------------------------------------------------
>
> Key: WFLY-1366
> URL: https://issues.jboss.org/browse/WFLY-1366
> Project: WildFly
> Issue Type: Feature Request
> Components: EE
> Affects Versions: 8.0.0.Alpha1
> Reporter: arjan tijms
> Assignee: Tomasz Adamski
> Labels: spec, validation
>
> When using the <data-source> element in e.g. web.xml or application.xml JBoss EAP 6.0.1/JBoss AS 7.1.3 does not accept a configuration without properties other than {{name}} and {{class-name}}. For instance:
> {code:xml}
> <data-source>
> <name>java:app/myDS</name>
> <class-name>com.example.MyDS</class-name>
> </data-source>
> {code}
> With such configuration, the following exception is thrown:
> {noformat}
> Caused by: org.jboss.jca.common.api.validator.ValidateException: IJ010069: Missing required element xa-datasource-property in org.jboss.jca.common.metadata.ds.v11.XADataSourceImpl
> at org.jboss.jca.common.metadata.ds.v10.XADataSourceImpl.validate(XADataSourceImpl.java:385)
> at org.jboss.jca.common.metadata.ds.v10.XADataSourceImpl.<init>(XADataSourceImpl.java:116)
> at org.jboss.jca.common.metadata.ds.v11.XADataSourceImpl.<init>(XADataSourceImpl.java:76)
> at org.jboss.as.connector.subsystems.datasources.ModifiableXaDataSource.getUnModifiableInstance(ModifiableXaDataSource.java:373)
> at org.jboss.as.connector.subsystems.datasources.XaDataSourceService.getDeployer(XaDataSourceService.java:70)
> at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:116)
> {noformat}
> At the point where the exception is thrown, the code checks if there are any properties at all:
> {code}
> if (this.xaDataSourceProperty.isEmpty())
> throw new ValidateException(
> bundle.requiredElementMissing(
> Tag.XA_DATASOURCE_PROPERTY.getLocalName(),
> this.getClass().getCanonicalName()));
> {code}
> I don't understand why this check is there. If I'm not mistaken the spec (e.g. JSR 250 section 2.13 and JSR 316 section EE.5.17) does not seem to mandate properties to be present and the corresponding annotation only requires {{name}} and {{className}} to be specified.
> A workaround is to subclass the data source class and provide a dummy property, e.g.
> {code:xml}
> <data-source>
> <name>java:app/myDS</name>
> <class-name>com.example.MySubDS</class-name>
> <property>
> <name>dummy</name>
> <value>dummy</value>
> </property>
> </data-source>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 11 months