[Red Hat JIRA] (WFLY-13617) Hibernate DataSourceBasedMultiTenantConnectionProviderImpl does not work for Multitenancy
by Scott Marlow (Jira)
[ https://issues.redhat.com/browse/WFLY-13617?page=com.atlassian.jira.plugi... ]
Scott Marlow commented on WFLY-13617:
-------------------------------------
Closing as this seems like a Hibernate ORM bug. Another WildFly user just experienced the same problem and opened https://hibernate.atlassian.net/browse/HHH-14448. Please refer to that issue and contribute to solving it as well!
> Hibernate DataSourceBasedMultiTenantConnectionProviderImpl does not work for Multitenancy
> -----------------------------------------------------------------------------------------
>
> Key: WFLY-13617
> URL: https://issues.redhat.com/browse/WFLY-13617
> Project: WildFly
> Issue Type: Bug
> Components: JPA / Hibernate
> Affects Versions: 19.1.0.Final, 20.0.0.Final
> Reporter: Rafael Sampaio
> Assignee: Scott Marlow
> Priority: Minor
>
> Hello All,
> I was using o the DataSourceBasedMultiTenantConnectionProviderImpl contained in Hibernate lib to perform DATABASE MultitenancyType up to Wildfly 18.
> Upgrading to version 19 (tested on 20 too), upon initialization of my application I get the error:
>
> {noformat}
> 14:07:52,655 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 84) MSC000001: Failed to start service jboss.persistenceunit."web-5.0.0#appPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."web-5.0.0#appPU": org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]14:07:52,655 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 84) MSC000001: Failed to start service jboss.persistenceunit."web-5.0.0#appPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."web-5.0.0#appPU": org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:198) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:128) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:658) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:212) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) at java.lang.Thread.run(Thread.java:748) at org.jboss.threads.JBossThread.run(JBossThread.java:485)Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:275) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152) at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:179) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:119) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1215) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1246) at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:170) ... 9 more
> Caused by: org.hibernate.HibernateException: Improper set up of DataSourceBasedMultiTenantConnectionProviderImpl at org.hibernate.engine.jdbc.connections.spi.DataSourceBasedMultiTenantConnectionProviderImpl.injectServices(DataSourceBasedMultiTenantConnectionProviderImpl.java:80) at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.buildJdbcConnectionAccess(JdbcEnvironmentInitiator.java:149) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:66) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:94) at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263) ... 21 more{noformat}
> The error happens inside this implementation:
>
>
> {noformat}
> public void injectServices(ServiceRegistryImplementor serviceRegistry) {
> final Object dataSourceConfigValue = serviceRegistry.getService( ConfigurationService.class )
> .getSettings()
> .get( AvailableSettings.DATASOURCE );
> if ( dataSourceConfigValue == null || ! String.class.isInstance( dataSourceConfigValue ) ) {
> throw new HibernateException( "Improper set up of DataSourceBasedMultiTenantConnectionProviderImpl" );
> }
> ...{noformat}
> The changed behavior is that the the parameter is no longer a String, but a WildFlyDataSource.
>
> I'm opening this case just to check if this is the expected behavior, and I should really override the necessary part of the code in order to circumvent the error or was this some sort of regression?
> Kindly,
> Rafael Sampaio
>
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
5 years, 2 months
[Red Hat JIRA] (WFCORE-5281) Review how StaticDiscoveryAddHandler and DiscoveryOptionAddHandler Operation Step Handlers are managing the runtime changes
by Yeray Borges Santana (Jira)
Yeray Borges Santana created WFCORE-5281:
--------------------------------------------
Summary: Review how StaticDiscoveryAddHandler and DiscoveryOptionAddHandler Operation Step Handlers are managing the runtime changes
Key: WFCORE-5281
URL: https://issues.redhat.com/browse/WFCORE-5281
Project: WildFly Core
Issue Type: Task
Components: Management
Reporter: Yeray Borges Santana
Assignee: Yeray Borges Santana
There could be cases, for example, when the operation is part of a composite operation, where the information processed and stored at the Model stage differs from the information available on the initial operation object. So it is a bad practice to get runtime data from the operation. Instead, the information should be retrieved from the model tree.
StaticDiscoveryAddHandler and DiscoveryOptionAddHandler OSHs are populating the host controller info at runtime from the operation object.
The task here is to validate whether this is correct.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
5 years, 2 months
[Red Hat JIRA] (WFLY-14410) Corruption of application-security-domain attachment between Stage.MODEL and Stage.RUNTIME
by Darran Lofthouse (Jira)
Darran Lofthouse created WFLY-14410:
---------------------------------------
Summary: Corruption of application-security-domain attachment between Stage.MODEL and Stage.RUNTIME
Key: WFLY-14410
URL: https://issues.redhat.com/browse/WFLY-14410
Project: WildFly
Issue Type: Bug
Components: EJB, Security, Web (Undertow)
Affects Versions: 22.0.0.Final
Reporter: Darran Lofthouse
This may only affect Undertow but could also affect EJB.
We add an attachment to the OperationContext in Stage.MODEL so we can coordinate the runtime API with Stage.RUNTIME, this strategy will work fine if we have only a single instance of the resource defined but if we have multiple resources defined there is no mechanism to prevent the attachment being replaced.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
5 years, 2 months
[Red Hat JIRA] (WFLY-12668) Bean validation is done twice in JAX-RS application
by Bartosz Baranowski (Jira)
[ https://issues.redhat.com/browse/WFLY-12668?page=com.atlassian.jira.plugi... ]
Bartosz Baranowski resolved WFLY-12668.
---------------------------------------
Resolution: Out of Date
10:40 $ curl -X POST -H "Content-Type: application/json" -d '{ "value": "123" }' http://localhost:8080/wildfly-validation-bug/rest/test
success✔ ~/redhat/tmp/wildfly-validation-bug [master|✔]
10:40 $ curl -X POST -H "Content-Type: application/json" -d '1234' http://localhost:8080/wildfly-validation-bug/rest/test
javax.ws.rs.ProcessingException: RESTEASY008200: JSON Binding deserialization error: javax.json.bind.JsonbException: Error deserialize JSON value into type: class boundary.model.MyModel.✔ ~/redhat/tmp/wildfly-validation-bug [master|✔]
10:41 $ curl -X POST -H "Content-Type: application/json" -d '1234' http://localhost:8080/wildfly-validation-bug/rest/test
javax.ws.rs.ProcessingException: RESTEASY008200: JSON Binding deserialization error: javax.json.bind.JsonbException: Error deserialize JSON value into type: class boundary.model.MyModel.✔ ~/redhat/tmp/wildfly-validation-bug [master|✔]
> Bean validation is done twice in JAX-RS application
> ---------------------------------------------------
>
> Key: WFLY-12668
> URL: https://issues.redhat.com/browse/WFLY-12668
> Project: WildFly
> Issue Type: Bug
> Components: Bean Validation, EJB, REST
> Affects Versions: 17.0.1.Final, 18.0.0.Final
> Environment: OpenJDK 11, reproduced on Win10 and Ubuntu 18.x
> Reporter: Daniel Munzinger
> Assignee: Bartosz Baranowski
> Priority: Major
>
> If a JAX-RS resource is implemented as a stateless session bean then the validation is done twice: first on the EJB proxy and on the real implementation. This results in two constraint errors although there is basically just one error.
> The interesting part: If you resend the request. Then you get a proper result with just one violation. If you do a valid request and then an invalid you get the two violations again (see also the reproduce section).
> I created the issue here because I think it is an integration issue with JAX-RS, bean validation and EJBs.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
5 years, 2 months
[Red Hat JIRA] (WFLY-12668) Bean validation is done twice in JAX-RS application
by Bartosz Baranowski (Jira)
[ https://issues.redhat.com/browse/WFLY-12668?page=com.atlassian.jira.plugi... ]
Bartosz Baranowski reassigned WFLY-12668:
-----------------------------------------
Assignee: Bartosz Baranowski (was: Cheng Fang)
> Bean validation is done twice in JAX-RS application
> ---------------------------------------------------
>
> Key: WFLY-12668
> URL: https://issues.redhat.com/browse/WFLY-12668
> Project: WildFly
> Issue Type: Bug
> Components: Bean Validation, EJB, REST
> Affects Versions: 17.0.1.Final, 18.0.0.Final
> Environment: OpenJDK 11, reproduced on Win10 and Ubuntu 18.x
> Reporter: Daniel Munzinger
> Assignee: Bartosz Baranowski
> Priority: Major
>
> If a JAX-RS resource is implemented as a stateless session bean then the validation is done twice: first on the EJB proxy and on the real implementation. This results in two constraint errors although there is basically just one error.
> The interesting part: If you resend the request. Then you get a proper result with just one violation. If you do a valid request and then an invalid you get the two violations again (see also the reproduce section).
> I created the issue here because I think it is an integration issue with JAX-RS, bean validation and EJBs.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
5 years, 2 months
[Red Hat JIRA] (WFLY-10137) EJB lookup over HTTP fails if object is used in the signiture
by Parul Sharma (Jira)
[ https://issues.redhat.com/browse/WFLY-10137?page=com.atlassian.jira.plugi... ]
Parul Sharma closed WFLY-10137.
-------------------------------
Resolution: Cannot Reproduce
> EJB lookup over HTTP fails if object is used in the signiture
> -------------------------------------------------------------
>
> Key: WFLY-10137
> URL: https://issues.redhat.com/browse/WFLY-10137
> Project: WildFly
> Issue Type: Bug
> Components: EJB, Remoting
> Affects Versions: 11.0.0.Final
> Reporter: peter craddock
> Assignee: Parul Sharma
> Priority: Major
>
> I have a swing client that makes calls to the EJB tier via RMI the majority of the calls work fine using the workaround from WFLY-9636.
> The following calls was failing when connected over HTTP but was fine when using the original TCP connection
> public EntityList getAllWorkingSetsForCube( ModelRef modelRef, FinanceCubeRef financeCubeRef, int userId, Integer[] allowedStates )
> I worked round this and found that creating a method without the Integer[] as part of the signature works.
--
This message was sent by Atlassian Jira
(v8.13.1#813001)
5 years, 2 months