{"action":"created","issue":{"url":"https://api.github.com/repos/hibernate/hibernate-validator/issues/838","repository_url":"https://api.github.com/repos/hibernate/hibernate-validator","labels_url":"https://api.github.com/repos/hibernate/hibernate-validator/issues/838/labels{/name}","comments_url":"https://api.github.com/repos/hibernate/hibernate-validator/issues/838/comments","events_url":"https://api.github.com/repos/hibernate/hibernate-validator/issues/838/events","html_url":"https://github.com/hibernate/hibernate-validator/pull/838","id":250315833,"number":838,"title":"HV-1463 Add test for using @ScriptAssert under OSGi","user":{"login":"marko-bekhta","id":4004823,"avatar_url":"https://avatars3.githubusercontent.com/u/4004823?v=4","gravatar_id":"","url":"https://api.github.com/users/marko-bekhta","html_url":"https://github.com/marko-bekhta","followers_url":"https://api.github.com/users/marko-bekhta/followers","following_url":"https://api.github.com/users/marko-bekhta/following{/other_user}","gists_url":"https://api.github.com/users/marko-bekhta/gists{/gist_id}","starred_url":"https://api.github.com/users/marko-bekhta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marko-bekhta/subscriptions","organizations_url":"https://api.github.com/users/marko-bekhta/orgs","repos_url":"https://api.github.com/users/marko-bekhta/repos","events_url":"https://api.github.com/users/marko-bekhta/events{/privacy}","received_events_url":"https://api.github.com/users/marko-bekhta/received_events","type":"User","site_admin":false},"labels":[{"id":379076397,"url":"https://api.github.com/repos/hibernate/hibernate-validator/labels/Needs%20more%20opinions","name":"Needs more opinions","color":"207de5","default":false},{"id":175370888,"url":"https://api.github.com/repos/hibernate/hibernate-validator/labels/Ready%20for%20review","name":"Ready for review","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2017-08-15T13:35:04Z","updated_at":"2017-10-18T13:59:06Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/hibernate/hibernate-validator/pulls/838","html_url":"https://github.com/hibernate/hibernate-validator/pull/838","diff_url":"https://github.com/hibernate/hibernate-validator/pull/838.diff","patch_url":"https://github.com/hibernate/hibernate-validator/pull/838.patch"},"body":"- https://hibernate.atlassian.net/browse/HV-1463\r\n\r\nI've added a simple test for `ScriptAssert`. The problem described in the issue is caused by how OSGi works with script engines. What I found while reading through similar issues - is that engines are not picked up correctly by OSGi and as a result an exception from `javax.script` is thrown. So to fix\r\n\r\n> java.lang.ClassNotFoundException: javax.script.ScriptException ....\r\n\r\nI just added one more import for `javax.script.*`. But the problem remains - engines are not picked up. I'm not very familiar with the OSGi and from what I found on OSGi+JSR-233 topic is that people recommend to manually create engines rather than request them like this `new ScriptEngineManager().getEngineByName( languageName )`. Which I don't think what we should do...\r\n\r\nSo maybe you have an  idea how this should be fixed correctly? If needed current exception is next:\r\n```\r\njavax.script.ScriptException: No JSR 223 script engine found for language \"groovy\".\r\n\r\n\tat org.hibernate.validator.internal.util.scriptengine.ScriptEvaluatorFactory.createNewScriptEvaluator(ScriptEvaluatorFactory.java:90)\r\n\tat org.hibernate.validator.internal.util.scriptengine.ScriptEvaluatorFactory.getScriptEvaluatorByLanguageName(ScriptEvaluatorFactory.java:70)\r\n\tat org.hibernate.validator.internal.constraintvalidators.hv.ScriptAssertContext.getScriptEvaluator(ScriptAssertContext.java:60)\r\n\tat org.hibernate.validator.internal.constraintvalidators.hv.ScriptAssertContext.<init>(ScriptAssertContext.java:34)\r\n\tat org.hibernate.validator.internal.constraintvalidators.hv.ScriptAssertValidator.initialize(ScriptAssertValidator.java:43)\r\n\tat org.hibernate.validator.internal.constraintvalidators.hv.ScriptAssertValidator.initialize(ScriptAssertValidator.java:28)\r\n\tat org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.initializeValidator(ConstraintValidatorManager.java:225)\r\n\tat org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.createAndInitializeValidator(ConstraintValidatorManager.java:151)\r\n\tat org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.getInitializedValidator(ConstraintValidatorManager.java:109)\r\n\tat org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getInitializedConstraintValidator(ConstraintTree.java:174)\r\n\tat org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:111)\r\n\tat org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:82)\r\n\tat org.hibernate.validator.internal.metadata.core.MetaConstraint.doValidateConstraint(MetaConstraint.java:117)\r\n\tat org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:110)\r\n\tat org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:552)\r\n\tat org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForSingleDefaultGroupElement(ValidatorImpl.java:510)\r\n\tat org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:479)\r\n\tat org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:444)\r\n\tat org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:394)\r\n\tat org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:183)\r\n\tat org.hibernate.validator.osgi.integrationtest.OsgiIntegrationTest.canUseScripAssertConstraint(OsgiIntegrationTest.java:269)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\r\n\tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\r\n\tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\r\n\tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\r\n\tat org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runLeafWithRetry(ContainerTestRunner.java:97)\r\n\tat org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChildWithRetry(ContainerTestRunner.java:84)\r\n\tat org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:75)\r\n\tat org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:44)\r\n\tat org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)\r\n\tat org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)\r\n\tat org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)\r\n\tat org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)\r\n\tat org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)\r\n\tat org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)\r\n\tat org.junit.runners.ParentRunner.run(ParentRunner.java:363)\r\n\tat org.junit.runner.JUnitCore.run(JUnitCore.java:137)\r\n\tat org.junit.runner.JUnitCore.run(JUnitCore.java:115)\r\n\tat org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.invokeViaJUnit(JUnitProbeInvoker.java:124)\r\n\tat org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.findAndInvoke(JUnitProbeInvoker.java:97)\r\n\tat org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.call(JUnitProbeInvoker.java:73)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.ops4j.pax.exam.rbc.internal.RemoteBundleContextImpl.remoteCall(RemoteBundleContextImpl.java:83)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324)\r\n\tat sun.rmi.transport.Transport$1.run(Transport.java:200)\r\n\tat sun.rmi.transport.Transport$1.run(Transport.java:197)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat sun.rmi.transport.Transport.serviceCall(Transport.java:196)\r\n\tat sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)\r\n\tat sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)\r\n\tat sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n```"},"comment":{"url":"https://api.github.com/repos/hibernate/hibernate-validator/issues/comments/337600359","html_url":"https://github.com/hibernate/hibernate-validator/pull/838#issuecomment-337600359","issue_url":"https://api.github.com/repos/hibernate/hibernate-validator/issues/838","id":337600359,"user":{"login":"gunnarmorling","id":28612,"avatar_url":"https://avatars2.githubusercontent.com/u/28612?v=4","gravatar_id":"","url":"https://api.github.com/users/gunnarmorling","html_url":"https://github.com/gunnarmorling","followers_url":"https://api.github.com/users/gunnarmorling/followers","following_url":"https://api.github.com/users/gunnarmorling/following{/other_user}","gists_url":"https://api.github.com/users/gunnarmorling/gists{/gist_id}","starred_url":"https://api.github.com/users/gunnarmorling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunnarmorling/subscriptions","organizations_url":"https://api.github.com/users/gunnarmorling/orgs","repos_url":"https://api.github.com/users/gunnarmorling/repos","events_url":"https://api.github.com/users/gunnarmorling/events{/privacy}","received_events_url":"https://api.github.com/users/gunnarmorling/received_events","type":"User","site_admin":false},"created_at":"2017-10-18T13:59:06Z","updated_at":"2017-10-18T13:59:06Z","author_association":"OWNER","body":"Ah, one more question: shouldn't this all go under `o.h.v.spi.scripting`? It's an extension point essentially which we mean to be implemented by advanced users."}}
{"actor":{"display_login":"gunnarmorling"}}