You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/12/04 01:36:28 UTC

[GitHub] ducquoc opened a new issue #3116: Error pulsar-admin functions localrun with javax validation-api 2.x (standalone)

ducquoc opened a new issue #3116: Error pulsar-admin functions localrun with javax validation-api 2.x (standalone)
URL: https://github.com/apache/pulsar/issues/3116
 
 
   #### Expected behavior
   
   Pulsar functions can be run using fat JAR without exception. (JAR build from Spring Data JPA - Hibernate 5.x with Hibernate validator & *validation-api 2.x* , gradle shadow plugins)
   
   #### Actual behavior
   
   Exception: 
   ```
   org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stageEntityManagerFactory' defined in class path resource [com/example/functions/integration/config/StageDataSourceConfig.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.cfg.beanvalidation.IntegrationException: Error activating Bean Validation integration
   ... ... ...
   Caused by: java.lang.NoSuchMethodError: javax.validation.BootstrapConfiguration.getClockProviderClassName()Ljava/lang/String;
           at org.hibernate.validator.internal.xml.ValidationBootstrapParameters.<init>(ValidationBootstrapParameters.java:63) ~[pp-pulsar-functions-services-0.0.1-SNAPSHOT.jar:?]
           at org.hibernate.validator.internal.engine.ConfigurationImpl.parseValidationXml(ConfigurationImpl.java:540) ~[ms-pulsar-functions-services-0.0.1-SNAPSHOT.jar:?]
           at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:337) ~[ms-pulsar-functions-services-1.1.0-SNAPSHOT.jar:?]
           at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:110) ~[java-instance.jar:2.2.0]
           at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:501) ~[ms-pulsar-functions-services-1.1.0-SNAPSHOT.jar:?]
           at org.hibernate.cfg.beanvalidation.TypeSafeActivator.activate(TypeSafeActivator.java:84) ~[ms-pulsar-functions-services-1.1.0-SNAPSHOT.jar:?]
   ```
   
   #### Steps to reproduce
   
   1/ Create a Spring JPA project which use Hibernate vendor, with dependencies Hibernate Validator 6.x and javax validation-api 2.0.1.Final
   2/ Package as fat/uber JAR to be run with Pulsar function (SpringBoot format not recognized by Pulsar function, so we shoud use some other package plugins, such as Gradle shadowJar )
   3/ Start Pulsar standalone, Run functions with the jar. e.g.
   ```
   ./bin/pulsar-admin functions localrun   --inputs persistent://public/default/test-topic   --output persistent://public/default/test-out-topic   --jar /home/ducquoc/W/k8s-stream-ms/ms-pulsar-functions/services/build/libs/ms-pulsar-functions-services-1.1.0-SNAPSHOT.jar   --className com.example.microservices.stream.pulsar.StagingDbCollectFunction
   ```
   
   ** Work-around: 
   Patched the pulsar instances JAR build from same source version 2.2.0, using validation-api 2.0.1.Final
   http://www.mediafire.com/file/cop21opgaw3r1cz/java-instance.jar 
   Then use it to replace default in $PULSAR_HOME/instances , or use it in runtime parameter `pulsar.functions.java.instance.jar` to override
   
   #### System configuration
   **Pulsar version**: 2.2.0
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services